lbm_suite2p_python 2.4.0__tar.gz → 2.5.1__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 (41) hide show
  1. lbm_suite2p_python-2.5.1/PKG-INFO +243 -0
  2. lbm_suite2p_python-2.5.1/README.md +216 -0
  3. lbm_suite2p_python-2.5.1/lbm_suite2p_python/__init__.py +138 -0
  4. lbm_suite2p_python-2.5.1/lbm_suite2p_python/__main__.py +6 -0
  5. lbm_suite2p_python-2.5.1/lbm_suite2p_python/_benchmarking.py +9 -0
  6. lbm_suite2p_python-2.5.1/lbm_suite2p_python/cellpose.py +1842 -0
  7. lbm_suite2p_python-2.5.1/lbm_suite2p_python/cellpose_workflow.py +483 -0
  8. lbm_suite2p_python-2.5.1/lbm_suite2p_python/cli.py +529 -0
  9. lbm_suite2p_python-2.5.1/lbm_suite2p_python/conversion.py +1019 -0
  10. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python/default_ops.py +13 -4
  11. lbm_suite2p_python-2.5.1/lbm_suite2p_python/grid_search.py +926 -0
  12. lbm_suite2p_python-2.5.1/lbm_suite2p_python/gui.py +361 -0
  13. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python/merging.py +25 -8
  14. lbm_suite2p_python-2.5.1/lbm_suite2p_python/normcorre.py +847 -0
  15. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python/postprocessing.py +45 -37
  16. lbm_suite2p_python-2.5.1/lbm_suite2p_python/run_lsp.py +1292 -0
  17. lbm_suite2p_python-2.5.1/lbm_suite2p_python/utils.py +128 -0
  18. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python/volume.py +507 -146
  19. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python/zplane.py +1166 -302
  20. lbm_suite2p_python-2.5.1/lbm_suite2p_python.egg-info/PKG-INFO +243 -0
  21. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python.egg-info/SOURCES.txt +7 -0
  22. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python.egg-info/entry_points.txt +1 -0
  23. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python.egg-info/requires.txt +1 -1
  24. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/pyproject.toml +7 -3
  25. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/tests/test_pipeline_parameters.py +15 -9
  26. lbm_suite2p_python-2.5.1/tests/test_refactored_pipeline.py +88 -0
  27. lbm_suite2p_python-2.4.0/PKG-INFO +0 -180
  28. lbm_suite2p_python-2.4.0/README.md +0 -153
  29. lbm_suite2p_python-2.4.0/lbm_suite2p_python/__init__.py +0 -89
  30. lbm_suite2p_python-2.4.0/lbm_suite2p_python/__main__.py +0 -101
  31. lbm_suite2p_python-2.4.0/lbm_suite2p_python/_benchmarking.py +0 -29
  32. lbm_suite2p_python-2.4.0/lbm_suite2p_python/cellpose.py +0 -1086
  33. lbm_suite2p_python-2.4.0/lbm_suite2p_python/run_lsp.py +0 -2084
  34. lbm_suite2p_python-2.4.0/lbm_suite2p_python/utils.py +0 -173
  35. lbm_suite2p_python-2.4.0/lbm_suite2p_python.egg-info/PKG-INFO +0 -180
  36. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/LICENSE.md +0 -0
  37. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/MANIFEST.in +0 -0
  38. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python.egg-info/dependency_links.txt +0 -0
  39. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/lbm_suite2p_python.egg-info/top_level.txt +0 -0
  40. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/setup.cfg +0 -0
  41. {lbm_suite2p_python-2.4.0 → lbm_suite2p_python-2.5.1}/tests/test_run_volume.py +0 -0
@@ -0,0 +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
@@ -0,0 +1,216 @@
1
+ <p align="center">
2
+ <img src="docs/_static/logo_suit2p.png" height="180" alt="LBM-Suite2p-Python logo">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <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>
7
+ <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>
8
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><img src="https://img.shields.io/badge/docs-online-green" alt="Documentation"></a>
9
+ <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>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="#installation"><b>Installation</b></a> ·
14
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/"><b>Documentation</b></a> ·
15
+ <a href="https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html"><b>User Guide</b></a> ·
16
+ <a href="https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues"><b>Issues</b></a>
17
+ </p>
18
+
19
+ A volumetric 2-photon calcium imaging processing pipeline for [Light Beads Microscopy](https://github.com/MillerBrainObservatory) (LBM) datasets, built on Suite2p.
20
+
21
+ - **Process volumetric calcium imaging data** - motion correction, cell detection, and signal extraction across z-planes
22
+ - **Automated quality diagnostics** - ROI quality metrics, ΔF/F traces, and correlation maps
23
+ - **Scalable architecture** - process single planes or entire volumes with consistent parameters
24
+
25
+ <p align="center">
26
+ <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" />
27
+ <br/>
28
+ <em>Planar Suite2p outputs combined into a 3D representation of neural activity</em>
29
+ </p>
30
+
31
+ > **Note:**
32
+ > `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.
33
+
34
+ ## Installation
35
+
36
+ `lbm_suite2p_python` is available on [PyPI](https://pypi.org/project/lbm-suite2p-python/):
37
+
38
+ > 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).
39
+
40
+ ```bash
41
+ # create a new project folder
42
+ mkdir my_project && cd my_project
43
+
44
+ # create environment and install (uv recommended)
45
+ uv venv --python 3.12.9
46
+ uv pip install lbm_suite2p_python
47
+
48
+ # or with pip
49
+ pip install lbm_suite2p_python
50
+ ```
51
+
52
+ ### Optional Dependencies
53
+
54
+ ```bash
55
+ # With rastermap for activity clustering visualization
56
+ uv pip install "lbm_suite2p_python[rastermap]"
57
+
58
+ # With cellpose for anatomical cell detection (includes PyTorch)
59
+ uv pip install "lbm_suite2p_python[cellpose]"
60
+
61
+ # All optional dependencies
62
+ uv pip install "lbm_suite2p_python[all]"
63
+ ```
64
+
65
+ ### Development Installation
66
+
67
+ ```bash
68
+ git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
69
+ cd LBM-Suite2p-Python
70
+ uv pip install -e ".[dev]"
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ```python
76
+ import lbm_suite2p_python as lsp
77
+
78
+ results = lsp.pipeline(
79
+ input_data="D:/data/raw", # path to file, directory, or list of files
80
+ save_path=None, # default: save next to input
81
+ ops=None, # default: use MBO-optimized parameters
82
+ planes=None, # default: process all planes (1-indexed)
83
+ roi_mode=None, # default: stitch multi-ROI data
84
+ keep_reg=True, # default: keep data.bin (registered binary)
85
+ keep_raw=False, # default: delete data_raw.bin after processing
86
+ force_reg=False, # default: skip if already registered
87
+ force_detect=False, # default: skip if stat.npy exists
88
+ dff_window_size=None, # default: auto-calculate from tau and framerate
89
+ dff_percentile=20, # default: 20th percentile for baseline
90
+ dff_smooth_window=None, # default: auto-calculate from tau and framerate
91
+ )
92
+ ```
93
+
94
+ > [User Guide](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/user_guide.html) for full API reference and examples
95
+
96
+ ## Output Gallery
97
+
98
+ ### Planar Results
99
+
100
+ Each z-plane produces diagnostic images automatically saved during processing.
101
+
102
+ <p align="center">
103
+ <table>
104
+ <tr>
105
+ <td align="center">
106
+ <img src="docs/_images/outputs/01_correlation_segmentation.png" alt="Correlation Segmentation" width="280"/>
107
+ <br/><em>correlation image with ROI overlay</em>
108
+ </td>
109
+ <td align="center">
110
+ <img src="docs/_images/outputs/03_mean_segmentation.png" alt="Mean Segmentation" width="280"/>
111
+ <br/><em>mean image with ROI overlay</em>
112
+ </td>
113
+ </tr>
114
+ <tr>
115
+ <td align="center">
116
+ <img src="docs/_images/outputs/05_quality_diagnostics.png" alt="Quality Diagnostics" width="280"/>
117
+ <br/><em>ROI quality metrics</em>
118
+ </td>
119
+ <td align="center">
120
+ <img src="docs/_images/outputs/08_traces_dff.png" alt="ΔF/F Traces" width="280"/>
121
+ <br/><em>ΔF/F traces sorted by quality</em>
122
+ </td>
123
+ </tr>
124
+ </table>
125
+ </p>
126
+
127
+ ### Volumetric Results
128
+
129
+ Volume-level visualizations combine data across all z-planes.
130
+
131
+ <p align="center">
132
+ <table>
133
+ <tr>
134
+ <td align="center">
135
+ <img src="docs/_images/volume/orthoslices.png" alt="Orthoslices" width="300"/>
136
+ <br/><em>XZ/YZ orthogonal projections</em>
137
+ </td>
138
+ <td align="center">
139
+ <img src="docs/_images/volume/rastermap.png" alt="Rastermap" width="400"/>
140
+ <br/><em>activity sorted by similarity (rastermap)</em>
141
+ </td>
142
+ </tr>
143
+ </table>
144
+ </p>
145
+
146
+ ## GUI
147
+
148
+ A graphical interface is available via [mbo_utilities](https://millerbrainobservatory.github.io/mbo_utilities/index.html#gui):
149
+
150
+ ```bash
151
+ pip install mbo_utilities
152
+ mbo # launch GUI
153
+ mbo /path/to/data # open file directly
154
+ ```
155
+
156
+ > **Note:** GUI functionality may lag behind the latest pipeline features.
157
+
158
+ ## Troubleshooting
159
+
160
+ <details>
161
+ <summary><b>Git LFS Download Errors</b></summary>
162
+
163
+ If you see `smudge filter lfs failed` when installing from GitHub:
164
+
165
+ ```bash
166
+ GIT_LFS_SKIP_SMUDGE=1 uv pip install git+https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
167
+ ```
168
+
169
+ Or set it permanently:
170
+
171
+ ```powershell
172
+ # Windows
173
+ [System.Environment]::SetEnvironmentVariable('GIT_LFS_SKIP_SMUDGE', '1', 'User')
174
+ ```
175
+
176
+ ```bash
177
+ # Linux/macOS
178
+ echo 'export GIT_LFS_SKIP_SMUDGE=1' >> ~/.bashrc
179
+ source ~/.bashrc
180
+ ```
181
+
182
+ </details>
183
+
184
+ <details>
185
+ <summary><b>GUI Dependencies</b></summary>
186
+
187
+ **Linux / macOS:**
188
+
189
+ ```bash
190
+ sudo apt install libxcursor-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
191
+ ```
192
+
193
+ **Windows:**
194
+ Install [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist)
195
+
196
+ </details>
197
+
198
+ ## Built With
199
+
200
+ - **[Suite2p](https://github.com/MouseLand/suite2p)** - Core registration and segmentation
201
+ - **[Cellpose](https://github.com/MouseLand/cellpose)** - Anatomical segmentation (optional)
202
+ - **[Rastermap](https://github.com/MouseLand/rastermap)** - Activity clustering (optional)
203
+ - **[mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)** - ScanImage I/O and metadata
204
+
205
+ ## Issues & Support
206
+
207
+ - **Bug reports:** [GitHub Issues](https://github.com/MillerBrainObservatory/LBM-Suite2p-Python/issues)
208
+ - **Questions:** See [documentation](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/) or [Suite2p docs](https://suite2p.readthedocs.io/)
209
+
210
+ ## Contributing
211
+
212
+ Contributions are welcome! This project uses:
213
+
214
+ - **Ruff** for linting and formatting (line length: 88, numpy docstring style)
215
+ - **pytest** for testing
216
+ - **Sphinx** for documentation
@@ -0,0 +1,138 @@
1
+ from importlib.metadata import version, PackageNotFoundError
2
+
3
+ from lbm_suite2p_python.default_ops import default_ops
4
+ from lbm_suite2p_python.run_lsp import (
5
+ pipeline,
6
+ run_volume,
7
+ run_plane,
8
+ add_processing_step,
9
+ )
10
+
11
+ # Cellpose workflow exports
12
+ from lbm_suite2p_python.cellpose_workflow import (
13
+ redetect,
14
+ enhance_summary_image,
15
+ )
16
+ from lbm_suite2p_python.cellpose import (
17
+ train_cellpose,
18
+ annotate,
19
+ open_in_gui,
20
+ prepare_training_data,
21
+ masks_to_stat,
22
+ stat_to_masks,
23
+ )
24
+ from lbm_suite2p_python.conversion import (
25
+ export_for_gui,
26
+ import_from_gui,
27
+ get_results,
28
+ ensure_cellpose_format,
29
+ detect_format,
30
+ )
31
+
32
+ # Plotting exports
33
+ from lbm_suite2p_python.zplane import (
34
+ plot_traces,
35
+ animate_traces,
36
+ plot_zplane_figures,
37
+ plot_plane_quality_metrics,
38
+ plot_plane_diagnostics,
39
+ plot_trace_analysis,
40
+ plot_multiplane_masks,
41
+ plot_mask_comparison,
42
+ plot_regional_zoom,
43
+ plot_filtered_cells,
44
+ plot_diameter_histogram,
45
+ plot_projection,
46
+ )
47
+
48
+ from lbm_suite2p_python.volume import (
49
+ plot_volume_diagnostics,
50
+ plot_orthoslices,
51
+ plot_3d_roi_map,
52
+ plot_3d_rastermap_clusters,
53
+ plot_volume_signal,
54
+ plot_volume_neuron_counts,
55
+ consolidate_volume,
56
+ )
57
+
58
+ from lbm_suite2p_python.grid_search import (
59
+ grid_search,
60
+ collect_grid_results,
61
+ save_grid_results,
62
+ plot_grid_metrics,
63
+ )
64
+
65
+ # Re-export key modules for easier access
66
+ from lbm_suite2p_python import (
67
+ cellpose,
68
+ conversion,
69
+ utils,
70
+ postprocessing,
71
+ normcorre,
72
+ )
73
+
74
+ try:
75
+ __version__ = version("lbm_suite2p_python")
76
+ except PackageNotFoundError:
77
+ # fallback for editable installs
78
+ __version__ = "0.0.0"
79
+
80
+ __all__ = [
81
+ # Core API
82
+ "pipeline",
83
+ "run_volume",
84
+ "run_plane",
85
+ "default_ops",
86
+ "add_processing_step",
87
+
88
+ # Cellpose / HITL Workflow
89
+ "redetect",
90
+ "enhance_summary_image",
91
+ "train_cellpose",
92
+ "annotate",
93
+ "open_in_gui",
94
+ "prepare_training_data",
95
+ "masks_to_stat",
96
+ "stat_to_masks",
97
+ "export_for_gui",
98
+ "import_from_gui",
99
+ "get_results",
100
+ "ensure_cellpose_format",
101
+ "detect_format",
102
+
103
+ # Modules
104
+ "cellpose",
105
+ "conversion",
106
+ "utils",
107
+ "postprocessing",
108
+ "normcorre",
109
+
110
+ # Grid Search
111
+ "grid_search",
112
+ "collect_grid_results",
113
+ "save_grid_results",
114
+ "plot_grid_metrics",
115
+
116
+ # Plotting (Z-Plane)
117
+ "plot_traces",
118
+ "animate_traces",
119
+ "plot_zplane_figures",
120
+ "plot_plane_quality_metrics",
121
+ "plot_plane_diagnostics",
122
+ "plot_trace_analysis",
123
+ "plot_multiplane_masks",
124
+ "plot_mask_comparison",
125
+ "plot_regional_zoom",
126
+ "plot_filtered_cells",
127
+ "plot_diameter_histogram",
128
+
129
+ # Plotting (Volume)
130
+ "plot_volume_diagnostics",
131
+ "plot_orthoslices",
132
+ "plot_3d_roi_map",
133
+ "plot_3d_rastermap_clusters",
134
+ "plot_projection",
135
+ "plot_volume_signal",
136
+ "plot_volume_neuron_counts",
137
+ "consolidate_volume",
138
+ ]
@@ -0,0 +1,6 @@
1
+ """CLI entrypoint for lbm_suite2p_python."""
2
+
3
+ from lbm_suite2p_python.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -0,0 +1,9 @@
1
+ import psutil
2
+
3
+
4
+ def get_cpu_percent():
5
+ return psutil.cpu_percent(interval=None)
6
+
7
+
8
+ def get_ram_used():
9
+ return psutil.virtual_memory().used // (1024 * 1024)