lbm_suite2p_python 2.5.1__tar.gz → 2.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/LICENSE.md +17 -17
  2. {lbm_suite2p_python-2.5.1/lbm_suite2p_python.egg-info → lbm_suite2p_python-2.5.2}/PKG-INFO +243 -243
  3. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/README.md +216 -216
  4. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/__init__.py +138 -138
  5. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/__main__.py +6 -6
  6. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/_benchmarking.py +9 -9
  7. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/cellpose.py +1842 -1842
  8. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/cellpose_workflow.py +483 -483
  9. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/conversion.py +1019 -1019
  10. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/default_ops.py +222 -222
  11. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/grid_search.py +926 -926
  12. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/gui.py +361 -361
  13. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/merging.py +380 -380
  14. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/normcorre.py +847 -847
  15. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/postprocessing.py +1296 -1296
  16. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/run_lsp.py +1292 -1292
  17. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/utils.py +128 -128
  18. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/volume.py +1873 -1873
  19. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/zplane.py +4429 -4429
  20. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2/lbm_suite2p_python.egg-info}/PKG-INFO +243 -243
  21. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python.egg-info/requires.txt +1 -1
  22. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/pyproject.toml +127 -127
  23. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/setup.cfg +4 -4
  24. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/tests/test_pipeline_parameters.py +625 -625
  25. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/tests/test_refactored_pipeline.py +88 -88
  26. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/tests/test_run_volume.py +79 -79
  27. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/MANIFEST.in +0 -0
  28. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python/cli.py +0 -0
  29. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python.egg-info/SOURCES.txt +0 -0
  30. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python.egg-info/dependency_links.txt +0 -0
  31. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python.egg-info/entry_points.txt +0 -0
  32. {lbm_suite2p_python-2.5.1 → lbm_suite2p_python-2.5.2}/lbm_suite2p_python.egg-info/top_level.txt +0 -0
@@ -1,17 +1,17 @@
1
- This software license is the 3-clause BSD license plus a fourth clause that prohibits redistribution for commercial purposes without further permission.
2
-
3
- BSD 3-Clause License
4
-
5
- Copyright (c) 2024, Miller Brain Observatory.
6
-
7
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8
-
9
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10
-
11
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12
-
13
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14
-
15
- Redistributions for commercial purposes are not permitted without the written permission of all code authors. For purposes of this license, commercial purposes is the incorporation of LBM-Suite2p-Python into anything for which you will charge fees or other compensation. Contact mbo@rockefeller.edu for more information.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ This software license is the 3-clause BSD license plus a fourth clause that prohibits redistribution for commercial purposes without further permission.
2
+
3
+ BSD 3-Clause License
4
+
5
+ Copyright (c) 2024, Miller Brain Observatory.
6
+
7
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8
+
9
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10
+
11
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12
+
13
+ Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14
+
15
+ Redistributions for commercial purposes are not permitted without the written permission of all code authors. For purposes of this license, commercial purposes is the incorporation of LBM-Suite2p-Python into anything for which you will charge fees or other compensation. Contact mbo@rockefeller.edu for more information.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,243 +1,243 @@
1
- Metadata-Version: 2.4
2
- Name: lbm_suite2p_python
3
- Version: 2.5.1
4
- Summary: Light Beads Microscopy Pipeline using Suite2p
5
- License-Expression: BSD-3-Clause
6
- Project-URL: homepage, https://github.com/MillerBrainObservatory/LBM-Suite2p-Python
7
- Keywords: Pipeline,Numpy,Microscopy,ScanImage,Suite2p,tiff
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Intended Audience :: Science/Research
10
- Classifier: Programming Language :: Python :: 3 :: Only
11
- Requires-Python: <3.12.10,>=3.12.7
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE.md
14
- Requires-Dist: mbo_utilities>=2.4.3
15
- Provides-Extra: suite2p
16
- Requires-Dist: suite2p_mbo>=2.0.1; extra == "suite2p"
17
- Provides-Extra: rastermap
18
- Requires-Dist: rastermap; extra == "rastermap"
19
- Provides-Extra: cellpose
20
- Requires-Dist: cellpose>=4.0.6; extra == "cellpose"
21
- Provides-Extra: torch
22
- Requires-Dist: torch>=2.7.0; extra == "torch"
23
- Requires-Dist: torchvision>=0.22.0; extra == "torch"
24
- Provides-Extra: all
25
- Requires-Dist: lbm_suite2p_python[cellpose,rastermap,suite2p,torch]; extra == "all"
26
- Dynamic: license-file
27
-
28
- <p align="center">
29
- <img src="docs/_static/logo_suit2p.png" height="180" alt="LBM-Suite2p-Python logo">
30
- </p>
31
-
32
- <p align="center">
33
- <a href="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/actions/workflows/test_python.yml"><img src="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/actions/workflows/test_python.yml/badge.svg" alt="Tests"></a>
34
- <a href="https://badge.fury.io/py/lbm-suite2p-python"><img src="https://badge.fury.io/py/lbm-suite2p-python.svg" alt="PyPI version"></a>
35
- <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><img src="https://img.shields.io/badge/docs-online-green" alt="Documentation"></a>
36
- <a href="https://doi.org/10.1038/s41592-021-01239-8"><img src="https://zenodo.org/badge/DOI/10.1007/978-3-319-76207-4_15.svg" alt="DOI"></a>
37
- </p>
38
-
39
- <p align="center">
40
- <a href="#installation"><b>Installation</b></a> ·
41
- <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><b>Documentation</b></a> ·
42
- <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html"><b>User Guide</b></a> ·
43
- <a href="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues"><b>Issues</b></a>
44
- </p>
45
-
46
- A volumetric 2-photon calcium imaging processing pipeline for [Light Beads Microscopy](https://github.com/MillerBrainObservatory) (LBM) datasets, built on Suite2p.
47
-
48
- - **Process volumetric calcium imaging data** - motion correction, cell detection, and signal extraction across z-planes
49
- - **Automated quality diagnostics** - ROI quality metrics, ΔF/F traces, and correlation maps
50
- - **Scalable architecture** - process single planes or entire volumes with consistent parameters
51
-
52
- <p align="center">
53
- <img src="docs/_images/volume/all_planes_masks.png" height="180" alt="All Planes Masks" /><img src="docs/_images/outputs/08_traces_dff.png" height="180" alt="ΔF/F Traces" /><img src="docs/_images/volume/roi_map_3d.png" height="180" alt="3D ROI Map" />
54
- <br/>
55
- <em>Planar Suite2p outputs combined into a 3D representation of neural activity</em>
56
- </p>
57
-
58
- > **Note:**
59
- > `lbm_suite2p_python` is in **late-beta** stage of active development. File an [issue](https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues) for bugs or feature requests.
60
-
61
- ## Installation
62
-
63
- `lbm_suite2p_python` is available on [PyPI](https://pypi.org/project/lbm-suite2p-python/):
64
-
65
- > We recommend using a virtual environment. For help setting up a virtual environment, see [the MBO guide on virtual environments](https://millerbrainobservatory.github.io/guides/venvs.html).
66
-
67
- ```bash
68
- # create a new project folder
69
- mkdir my_project && cd my_project
70
-
71
- # create environment and install (uv recommended)
72
- uv venv --python 3.12.9
73
- uv pip install lbm_suite2p_python
74
-
75
- # or with pip
76
- pip install lbm_suite2p_python
77
- ```
78
-
79
- ### Optional Dependencies
80
-
81
- ```bash
82
- # With rastermap for activity clustering visualization
83
- uv pip install "lbm_suite2p_python[rastermap]"
84
-
85
- # With cellpose for anatomical cell detection (includes PyTorch)
86
- uv pip install "lbm_suite2p_python[cellpose]"
87
-
88
- # All optional dependencies
89
- uv pip install "lbm_suite2p_python[all]"
90
- ```
91
-
92
- ### Development Installation
93
-
94
- ```bash
95
- git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
96
- cd LBM-Suite2p-Python
97
- uv pip install -e ".[dev]"
98
- ```
99
-
100
- ## Quick Start
101
-
102
- ```python
103
- import lbm_suite2p_python as lsp
104
-
105
- results = lsp.pipeline(
106
- input_data="D:/data/raw", # path to file, directory, or list of files
107
- save_path=None, # default: save next to input
108
- ops=None, # default: use MBO-optimized parameters
109
- planes=None, # default: process all planes (1-indexed)
110
- roi_mode=None, # default: stitch multi-ROI data
111
- keep_reg=True, # default: keep data.bin (registered binary)
112
- keep_raw=False, # default: delete data_raw.bin after processing
113
- force_reg=False, # default: skip if already registered
114
- force_detect=False, # default: skip if stat.npy exists
115
- dff_window_size=None, # default: auto-calculate from tau and framerate
116
- dff_percentile=20, # default: 20th percentile for baseline
117
- dff_smooth_window=None, # default: auto-calculate from tau and framerate
118
- )
119
- ```
120
-
121
- > [User Guide](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html) for full API reference and examples
122
-
123
- ## Output Gallery
124
-
125
- ### Planar Results
126
-
127
- Each z-plane produces diagnostic images automatically saved during processing.
128
-
129
- <p align="center">
130
- <table>
131
- <tr>
132
- <td align="center">
133
- <img src="docs/_images/outputs/01_correlation_segmentation.png" alt="Correlation Segmentation" width="280"/>
134
- <br/><em>correlation image with ROI overlay</em>
135
- </td>
136
- <td align="center">
137
- <img src="docs/_images/outputs/03_mean_segmentation.png" alt="Mean Segmentation" width="280"/>
138
- <br/><em>mean image with ROI overlay</em>
139
- </td>
140
- </tr>
141
- <tr>
142
- <td align="center">
143
- <img src="docs/_images/outputs/05_quality_diagnostics.png" alt="Quality Diagnostics" width="280"/>
144
- <br/><em>ROI quality metrics</em>
145
- </td>
146
- <td align="center">
147
- <img src="docs/_images/outputs/08_traces_dff.png" alt="ΔF/F Traces" width="280"/>
148
- <br/><em>ΔF/F traces sorted by quality</em>
149
- </td>
150
- </tr>
151
- </table>
152
- </p>
153
-
154
- ### Volumetric Results
155
-
156
- Volume-level visualizations combine data across all z-planes.
157
-
158
- <p align="center">
159
- <table>
160
- <tr>
161
- <td align="center">
162
- <img src="docs/_images/volume/orthoslices.png" alt="Orthoslices" width="300"/>
163
- <br/><em>XZ/YZ orthogonal projections</em>
164
- </td>
165
- <td align="center">
166
- <img src="docs/_images/volume/rastermap.png" alt="Rastermap" width="400"/>
167
- <br/><em>activity sorted by similarity (rastermap)</em>
168
- </td>
169
- </tr>
170
- </table>
171
- </p>
172
-
173
- ## GUI
174
-
175
- A graphical interface is available via [mbo_utilities](https://millerbrainobservatory.github.io/mbo_utilities/index.html#gui):
176
-
177
- ```bash
178
- pip install mbo_utilities
179
- mbo # launch GUI
180
- mbo /path/to/data # open file directly
181
- ```
182
-
183
- > **Note:** GUI functionality may lag behind the latest pipeline features.
184
-
185
- ## Troubleshooting
186
-
187
- <details>
188
- <summary><b>Git LFS Download Errors</b></summary>
189
-
190
- If you see `smudge filter lfs failed` when installing from GitHub:
191
-
192
- ```bash
193
- GIT_LFS_SKIP_SMUDGE=1 uv pip install git+https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
194
- ```
195
-
196
- Or set it permanently:
197
-
198
- ```powershell
199
- # Windows
200
- [System.Environment]::SetEnvironmentVariable('GIT_LFS_SKIP_SMUDGE', '1', 'User')
201
- ```
202
-
203
- ```bash
204
- # Linux/macOS
205
- echo 'export GIT_LFS_SKIP_SMUDGE=1' >> ~/.bashrc
206
- source ~/.bashrc
207
- ```
208
-
209
- </details>
210
-
211
- <details>
212
- <summary><b>GUI Dependencies</b></summary>
213
-
214
- **Linux / macOS:**
215
-
216
- ```bash
217
- sudo apt install libxcursor-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
218
- ```
219
-
220
- **Windows:**
221
- Install [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist)
222
-
223
- </details>
224
-
225
- ## Built With
226
-
227
- - **[Suite2p](https://github.com/MouseLand/suite2p)** - Core registration and segmentation
228
- - **[Cellpose](https://github.com/MouseLand/cellpose)** - Anatomical segmentation (optional)
229
- - **[Rastermap](https://github.com/MouseLand/rastermap)** - Activity clustering (optional)
230
- - **[mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)** - ScanImage I/O and metadata
231
-
232
- ## Issues & Support
233
-
234
- - **Bug reports:** [GitHub Issues](https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues)
235
- - **Questions:** See [documentation](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/) or [Suite2p docs](https://suite2p.readthedocs.io/)
236
-
237
- ## Contributing
238
-
239
- Contributions are welcome! This project uses:
240
-
241
- - **Ruff** for linting and formatting (line length: 88, numpy docstring style)
242
- - **pytest** for testing
243
- - **Sphinx** for documentation
1
+ Metadata-Version: 2.4
2
+ Name: lbm_suite2p_python
3
+ Version: 2.5.2
4
+ Summary: Light Beads Microscopy Pipeline using Suite2p
5
+ License-Expression: BSD-3-Clause
6
+ Project-URL: homepage, https://github.com/MillerBrainObservatory/LBM-Suite2p-Python
7
+ Keywords: Pipeline,Numpy,Microscopy,ScanImage,Suite2p,tiff
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Requires-Python: <3.12.10,>=3.12.7
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE.md
14
+ Requires-Dist: mbo_utilities>=2.5.0
15
+ Provides-Extra: suite2p
16
+ Requires-Dist: suite2p_mbo>=2.0.1; extra == "suite2p"
17
+ Provides-Extra: rastermap
18
+ Requires-Dist: rastermap; extra == "rastermap"
19
+ Provides-Extra: cellpose
20
+ Requires-Dist: cellpose>=4.0.6; extra == "cellpose"
21
+ Provides-Extra: torch
22
+ Requires-Dist: torch>=2.7.0; extra == "torch"
23
+ Requires-Dist: torchvision>=0.22.0; extra == "torch"
24
+ Provides-Extra: all
25
+ Requires-Dist: lbm_suite2p_python[cellpose,rastermap,suite2p,torch]; extra == "all"
26
+ Dynamic: license-file
27
+
28
+ <p align="center">
29
+ <img src="docs/_static/logo_suit2p.png" height="180" alt="LBM-Suite2p-Python logo">
30
+ </p>
31
+
32
+ <p align="center">
33
+ <a href="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/actions/workflows/test_python.yml"><img src="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/actions/workflows/test_python.yml/badge.svg" alt="Tests"></a>
34
+ <a href="https://badge.fury.io/py/lbm-suite2p-python"><img src="https://badge.fury.io/py/lbm-suite2p-python.svg" alt="PyPI version"></a>
35
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><img src="https://img.shields.io/badge/docs-online-green" alt="Documentation"></a>
36
+ <a href="https://doi.org/10.1038/s41592-021-01239-8"><img src="https://zenodo.org/badge/DOI/10.1007/978-3-319-76207-4_15.svg" alt="DOI"></a>
37
+ </p>
38
+
39
+ <p align="center">
40
+ <a href="#installation"><b>Installation</b></a> ·
41
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><b>Documentation</b></a> ·
42
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html"><b>User Guide</b></a> ·
43
+ <a href="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues"><b>Issues</b></a>
44
+ </p>
45
+
46
+ A volumetric 2-photon calcium imaging processing pipeline for [Light Beads Microscopy](https://github.com/MillerBrainObservatory) (LBM) datasets, built on Suite2p.
47
+
48
+ - **Process volumetric calcium imaging data** - motion correction, cell detection, and signal extraction across z-planes
49
+ - **Automated quality diagnostics** - ROI quality metrics, ΔF/F traces, and correlation maps
50
+ - **Scalable architecture** - process single planes or entire volumes with consistent parameters
51
+
52
+ <p align="center">
53
+ <img src="docs/_images/volume/all_planes_masks.png" height="180" alt="All Planes Masks" /><img src="docs/_images/outputs/08_traces_dff.png" height="180" alt="ΔF/F Traces" /><img src="docs/_images/volume/roi_map_3d.png" height="180" alt="3D ROI Map" />
54
+ <br/>
55
+ <em>Planar Suite2p outputs combined into a 3D representation of neural activity</em>
56
+ </p>
57
+
58
+ > **Note:**
59
+ > `lbm_suite2p_python` is in **late-beta** stage of active development. File an [issue](https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues) for bugs or feature requests.
60
+
61
+ ## Installation
62
+
63
+ `lbm_suite2p_python` is available on [PyPI](https://pypi.org/project/lbm-suite2p-python/):
64
+
65
+ > We recommend using a virtual environment. For help setting up a virtual environment, see [the MBO guide on virtual environments](https://millerbrainobservatory.github.io/guides/venvs.html).
66
+
67
+ ```bash
68
+ # create a new project folder
69
+ mkdir my_project && cd my_project
70
+
71
+ # create environment and install (uv recommended)
72
+ uv venv --python 3.12.9
73
+ uv pip install lbm_suite2p_python
74
+
75
+ # or with pip
76
+ pip install lbm_suite2p_python
77
+ ```
78
+
79
+ ### Optional Dependencies
80
+
81
+ ```bash
82
+ # With rastermap for activity clustering visualization
83
+ uv pip install "lbm_suite2p_python[rastermap]"
84
+
85
+ # With cellpose for anatomical cell detection (includes PyTorch)
86
+ uv pip install "lbm_suite2p_python[cellpose]"
87
+
88
+ # All optional dependencies
89
+ uv pip install "lbm_suite2p_python[all]"
90
+ ```
91
+
92
+ ### Development Installation
93
+
94
+ ```bash
95
+ git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
96
+ cd LBM-Suite2p-Python
97
+ uv pip install -e ".[dev]"
98
+ ```
99
+
100
+ ## Quick Start
101
+
102
+ ```python
103
+ import lbm_suite2p_python as lsp
104
+
105
+ results = lsp.pipeline(
106
+ input_data="D:/data/raw", # path to file, directory, or list of files
107
+ save_path=None, # default: save next to input
108
+ ops=None, # default: use MBO-optimized parameters
109
+ planes=None, # default: process all planes (1-indexed)
110
+ roi_mode=None, # default: stitch multi-ROI data
111
+ keep_reg=True, # default: keep data.bin (registered binary)
112
+ keep_raw=False, # default: delete data_raw.bin after processing
113
+ force_reg=False, # default: skip if already registered
114
+ force_detect=False, # default: skip if stat.npy exists
115
+ dff_window_size=None, # default: auto-calculate from tau and framerate
116
+ dff_percentile=20, # default: 20th percentile for baseline
117
+ dff_smooth_window=None, # default: auto-calculate from tau and framerate
118
+ )
119
+ ```
120
+
121
+ > [User Guide](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html) for full API reference and examples
122
+
123
+ ## Output Gallery
124
+
125
+ ### Planar Results
126
+
127
+ Each z-plane produces diagnostic images automatically saved during processing.
128
+
129
+ <p align="center">
130
+ <table>
131
+ <tr>
132
+ <td align="center">
133
+ <img src="docs/_images/outputs/01_correlation_segmentation.png" alt="Correlation Segmentation" width="280"/>
134
+ <br/><em>correlation image with ROI overlay</em>
135
+ </td>
136
+ <td align="center">
137
+ <img src="docs/_images/outputs/03_mean_segmentation.png" alt="Mean Segmentation" width="280"/>
138
+ <br/><em>mean image with ROI overlay</em>
139
+ </td>
140
+ </tr>
141
+ <tr>
142
+ <td align="center">
143
+ <img src="docs/_images/outputs/05_quality_diagnostics.png" alt="Quality Diagnostics" width="280"/>
144
+ <br/><em>ROI quality metrics</em>
145
+ </td>
146
+ <td align="center">
147
+ <img src="docs/_images/outputs/08_traces_dff.png" alt="ΔF/F Traces" width="280"/>
148
+ <br/><em>ΔF/F traces sorted by quality</em>
149
+ </td>
150
+ </tr>
151
+ </table>
152
+ </p>
153
+
154
+ ### Volumetric Results
155
+
156
+ Volume-level visualizations combine data across all z-planes.
157
+
158
+ <p align="center">
159
+ <table>
160
+ <tr>
161
+ <td align="center">
162
+ <img src="docs/_images/volume/orthoslices.png" alt="Orthoslices" width="300"/>
163
+ <br/><em>XZ/YZ orthogonal projections</em>
164
+ </td>
165
+ <td align="center">
166
+ <img src="docs/_images/volume/rastermap.png" alt="Rastermap" width="400"/>
167
+ <br/><em>activity sorted by similarity (rastermap)</em>
168
+ </td>
169
+ </tr>
170
+ </table>
171
+ </p>
172
+
173
+ ## GUI
174
+
175
+ A graphical interface is available via [mbo_utilities](https://millerbrainobservatory.github.io/mbo_utilities/index.html#gui):
176
+
177
+ ```bash
178
+ pip install mbo_utilities
179
+ mbo # launch GUI
180
+ mbo /path/to/data # open file directly
181
+ ```
182
+
183
+ > **Note:** GUI functionality may lag behind the latest pipeline features.
184
+
185
+ ## Troubleshooting
186
+
187
+ <details>
188
+ <summary><b>Git LFS Download Errors</b></summary>
189
+
190
+ If you see `smudge filter lfs failed` when installing from GitHub:
191
+
192
+ ```bash
193
+ GIT_LFS_SKIP_SMUDGE=1 uv pip install git+https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
194
+ ```
195
+
196
+ Or set it permanently:
197
+
198
+ ```powershell
199
+ # Windows
200
+ [System.Environment]::SetEnvironmentVariable('GIT_LFS_SKIP_SMUDGE', '1', 'User')
201
+ ```
202
+
203
+ ```bash
204
+ # Linux/macOS
205
+ echo 'export GIT_LFS_SKIP_SMUDGE=1' >> ~/.bashrc
206
+ source ~/.bashrc
207
+ ```
208
+
209
+ </details>
210
+
211
+ <details>
212
+ <summary><b>GUI Dependencies</b></summary>
213
+
214
+ **Linux / macOS:**
215
+
216
+ ```bash
217
+ sudo apt install libxcursor-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
218
+ ```
219
+
220
+ **Windows:**
221
+ Install [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist)
222
+
223
+ </details>
224
+
225
+ ## Built With
226
+
227
+ - **[Suite2p](https://github.com/MouseLand/suite2p)** - Core registration and segmentation
228
+ - **[Cellpose](https://github.com/MouseLand/cellpose)** - Anatomical segmentation (optional)
229
+ - **[Rastermap](https://github.com/MouseLand/rastermap)** - Activity clustering (optional)
230
+ - **[mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)** - ScanImage I/O and metadata
231
+
232
+ ## Issues & Support
233
+
234
+ - **Bug reports:** [GitHub Issues](https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues)
235
+ - **Questions:** See [documentation](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/) or [Suite2p docs](https://suite2p.readthedocs.io/)
236
+
237
+ ## Contributing
238
+
239
+ Contributions are welcome! This project uses:
240
+
241
+ - **Ruff** for linting and formatting (line length: 88, numpy docstring style)
242
+ - **pytest** for testing
243
+ - **Sphinx** for documentation