Metadata-Version: 2.4
Name: stiminterp
Version: 0.1
Summary: Photostimulation artifact removal via interpolation
Author-email: Sumiya Kuroda <s.kuroda@ucl.ac.uk>
License: BSD-3-Clause
Project-URL: Homepage, https://github.com/SainsburyWellcomeCentre/stiminterp
Project-URL: Bug Tracker, https://github.com/SainsburyWellcomeCentre/stiminterp/issues
Project-URL: Source Code, https://github.com/SainsburyWellcomeCentre/stiminterp
Project-URL: User Support, https://github.com/SainsburyWellcomeCentre/stiminterp/issues
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: BSD License
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: tifffile
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: PyYAML
Requires-Dist: fancylog
Requires-Dist: matplotlib
Requires-Dist: pandas
Requires-Dist: tqdm
Requires-Dist: scikit-learn
Requires-Dist: scikit-image
Requires-Dist: scanimage-tiff-reader
Requires-Dist: h5py
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: tox; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: setuptools_scm; extra == "dev"
Dynamic: license-file

[![Python
Version](https://img.shields.io/pypi/pyversions/stiminterp.svg)](https://pypi.org/project/stiminterp)
[![PyPI
Version](https://img.shields.io/pypi/v/stiminterp.svg)](https://pypi.org/project/stiminterp)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-orange.svg)](https://opensource.org/licenses/BSD-3-Clause)

# stiminterp

**stiminterp** provides an 1D-interpolation-based solution for removing
photostimulation artefacts from multiphoton calcium imaging data.

The holographic stimulation saturates the PMTs and causes data loss. By identifying lines with the stimulation artefacts, this pipeline can replace the pixel rows containing the stimulation artefacts with the average values from corresponding rows in the preceding and following frames.

------------------------------------------------------------------------

## Installation

Create a fresh environment and install via pip:

    conda create -n stiminterp-env python=3.12
    conda activate stiminterp-env
    pip install stiminterp

------------------------------------------------------------------------

## Overview

Understanding the causal role of brain dynamics is one of the fundamental questions in systemns neuroscience. Multiphoton holographic optogenetics, combined with multiphoton calcium imaging, enables causal testing of circuit models at single-cell resolution. However, photostimulation can saturate PMTs, producing line artefacts in the imaging data.

With `stiminterp` you can:

-   Detect artefact-contaminated lines from HDF5 generated by ScanImage
-   Perform spatiotemporal 1D-interpolation using `scipy.interpolate`
-   Recover calcium imaging movies that can be fed into standard analysis pipelines such as `suite2p`
------------------------------------------------------------------------

## Data Source & Funding

Sample data used for examples will be publicly available in the near future.

All microscopy data has been acquired using a custom two-photon microscope by [Sumiya Kuroda](https://github.com/sumiya-kuroda) in the [Mrsic-Flogel Lab](https://www.sainsburywellcome.org/web/groups/mrsic-flogel-lab) and Dale Elgar from [COSYS Ltd.](https://www.cosys.org.uk/).

This work represents a joint collaboration between Stanford University and the Sainsbury Wellcome Centre for Neural Circuits and Behaviour, University College London, supported by the Gatsby Charitable Foundation.

------------------------------------------------------------------------

## References

Previous work on artefact removal of all-optical imaging movies:
- [Drinnenberg et al, 2025, bioRxiv](https://www.biorxiv.org/content/10.1101/2025.10.21.683734v1)
- [Attinger et al, 2025, bioRxiv](https://www.biorxiv.org/content/10.1101/2025.10.21.683723v1)

This package was inspired by [previous calcium imaging analysis pipeline at Deisseroth lab](https://github.com/deisseroth-lab/two-photon/tree/main).

This repo was made using [neuroinformatics-unit/python-cookiecutter](https://github.com/neuroinformatics-unit/python-cookiecutter). See [here](https://python-cookiecutter.neuroinformatics.dev/) for more info.

------------------------------------------------------------------------

## Contributing

Contributions are welcome. Please open an issue or submit a pull request
on GitHub.

------------------------------------------------------------------------

## License

BSD-3-Clause
