Metadata-Version: 2.4
Name: seudo
Version: 0.0.1
Summary: Python port of the SEUDO calcium-imaging source-extraction toolbox (in progress)
Author: Adam Charles, Jeff Gauthier
License-Expression: MIT
Project-URL: Homepage, https://github.com/adamshch/SEUDO
Project-URL: Repository, https://github.com/adamshch/SEUDO
Keywords: calcium imaging,neuroscience,source extraction,fluorescence,microscopy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: PyQt5
Requires-Dist: matplotlib
Requires-Dist: h5py
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# seudo

Python port (in progress) of [SEUDO](https://github.com/adamshch/SEUDO), a
toolbox for removing false transients from calcium imaging source
extraction. Original MATLAB implementation and paper: Gauthier & Charles,
*eLife* 2021.

This package is being ported incrementally from the MATLAB codebase
(`../code` in the source repository). Currently implemented:

- The core SEUDO solver (`estimate_time_courses_with_seudo`) — sparse
  regression separating each source's true activity from unmodeled
  ("blob") contamination, for a single frame at a time.
- Transient detection and per-transient spatial profile computation
  (`identify_transients`, `compute_transient_info`).
- Automatic true/false transient classification by profile correlation
  (`auto_classify_transients`).
- A PyQt5 GUI (`seudo.gui.ClassifyTransientsWindow`) for manually
  reviewing and classifying transients.

Not yet ported: the `rwl1df`/`bpdndf` dynamic SEUDO modes, the `'lbq'`
auto-classification method, parameter search / Bayesian optimization, and
several of the original MATLAB GUIs (parameter review, transient detail
viewer).

## Install

```bash
pip install seudo
```

This includes the PyQt5 classification GUI and h5py (for loading real
MATLAB v7.3 `.mat` files) as standard dependencies, since the GUI is a
core part of the workflow, not an add-on.

For local development, from this directory:

```bash
pip install -e .[dev]
pytest
```

## Quick start

```python
from seudo import Seudo

# movie: (Y, X, F) array; profiles: (Y, X, nCells) array
se = Seudo(movie, profiles, time_courses=time_courses)

se.compute_transient_info('default')
result = se.estimate_time_courses_with_seudo(sigma2=0.002, lambda_blob=10, blob_radius=3)
```

To open the manual classification GUI:

```python
from PyQt5 import QtWidgets
from seudo.gui import ClassifyTransientsWindow

app = QtWidgets.QApplication([])
win = ClassifyTransientsWindow(se, 'default')
win.show()
app.exec_()
```

## License

MIT, see `LICENSE`.
