lbm_suite2p_python 2.0.3__tar.gz → 2.0.4__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.
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/LICENSE.md +17 -17
- {lbm_suite2p_python-2.0.3/lbm_suite2p_python.egg-info → lbm_suite2p_python-2.0.4}/PKG-INFO +94 -94
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/README.md +68 -68
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/__init__.py +30 -30
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/__main__.py +101 -101
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/_benchmarking.py +29 -29
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/default_ops.py +42 -42
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/merging.py +282 -282
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/postprocessing.py +474 -474
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/run_lsp.py +779 -763
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/utils.py +173 -173
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/volume.py +503 -503
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python/zplane.py +1417 -1417
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4/lbm_suite2p_python.egg-info}/PKG-INFO +94 -94
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/pyproject.toml +137 -137
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/setup.cfg +4 -4
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/tests/test_run_volume.py +79 -79
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/MANIFEST.in +0 -0
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python.egg-info/SOURCES.txt +0 -0
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python.egg-info/dependency_links.txt +0 -0
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python.egg-info/entry_points.txt +0 -0
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/lbm_suite2p_python.egg-info/requires.txt +0 -0
- {lbm_suite2p_python-2.0.3 → lbm_suite2p_python-2.0.4}/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,94 +1,94 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: lbm_suite2p_python
|
|
3
|
-
Version: 2.0.
|
|
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.0.4
|
|
15
|
-
Provides-Extra: cpsam
|
|
16
|
-
Requires-Dist: cellpose==4.0.6; extra == "cpsam"
|
|
17
|
-
Requires-Dist: pytorch; extra == "cpsam"
|
|
18
|
-
Requires-Dist: torchaudio; extra == "cpsam"
|
|
19
|
-
Provides-Extra: cpu
|
|
20
|
-
Requires-Dist: torch>=2.7.0; extra == "cpu"
|
|
21
|
-
Requires-Dist: torchvision>=0.22.0; extra == "cpu"
|
|
22
|
-
Provides-Extra: cu126
|
|
23
|
-
Requires-Dist: torch>=2.7.0; extra == "cu126"
|
|
24
|
-
Requires-Dist: torchvision>=0.22.0; extra == "cu126"
|
|
25
|
-
Dynamic: license-file
|
|
26
|
-
|
|
27
|
-
# Light Beads Microscopy (LBM) Pipeline: Suite2p
|
|
28
|
-
|
|
29
|
-
[](https://pypi.org/project/lbm-suite2p-python/)
|
|
30
|
-
|
|
31
|
-
[](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/index.html)
|
|
32
|
-
|
|
33
|
-
This package is still in a *late-beta* stage of development.
|
|
34
|
-
|
|
35
|
-
A pipeline for processing volumetric 2-photon Light Beads Microscopy (LBM) datasets.
|
|
36
|
-
|
|
37
|
-
This pipeline uses the following open-source software:
|
|
38
|
-
|
|
39
|
-
- [suite2p](https://github.com/MouseLand/suite2p)
|
|
40
|
-
- [cellpose](https://github.com/MouseLand/cellpose)
|
|
41
|
-
- [rastermap](https://github.com/MouseLand/rastermap)
|
|
42
|
-
- [mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)
|
|
43
|
-
- [scanreader](https://github.com/atlab/scanreader)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
[](https://doi.org/10.1038/s41592-021-01239-8)
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Installation
|
|
51
|
-
|
|
52
|
-
This pipeline is installable with `pip`:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pip install lbm_suite2p_python
|
|
56
|
-
# with uv: uv pip install lbm_suite2p_python
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
We highly encourage the use of a virtual environment. If you are unfamiliar with virtual environments, see our documentation [here](https://millerbrainobservatory.github.io/mbo_utilities/venvs.html).
|
|
60
|
-
|
|
61
|
-
You may also use git to clone and install locally for updates not yet released to pypi:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
|
|
65
|
-
cd LBM-Suite2p-Python
|
|
66
|
-
|
|
67
|
-
# make sure your virtual environment is active
|
|
68
|
-
pip install "."
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Features
|
|
72
|
-
|
|
73
|
-
### 2.0.0
|
|
74
|
-
|
|
75
|
-
- Process ScanImage multi-ROI as separate datasets
|
|
76
|
-
- Post-processing cell filters for area, exceptional events and eccentricity
|
|
77
|
-
|
|
78
|
-
### 1.0.0
|
|
79
|
-
|
|
80
|
-
- Suite2p planar segmentation
|
|
81
|
-
- DF/F, baseline calculation and documentation
|
|
82
|
-
- Aggregate planar outputs into volumetric dataset
|
|
83
|
-
|
|
84
|
-
## Issues
|
|
85
|
-
|
|
86
|
-
Widgets may throw "Invalid Rect" errors. This can be safely ignored until it is [resolved](https://github.com/pygfx/wgpu-py/issues/716#issuecomment-2880853089).
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Acknowledgements
|
|
91
|
-
|
|
92
|
-
This pipeline is mostly a volumetric wrapper around [suite2p](https://github.com/MouseLand/suite2p), [cellpose](https://github.com/MouseLand/cellpose) and [Suite3D](https://github.com/alihaydaroglu/suite3d). We thank the contributors to those projects.
|
|
93
|
-
|
|
94
|
-
Thank you to the developers of [scanreader](https://github.com/atlab/scanreader), which provides a clean interface to ScanImage metadata using only tifffile and numpy.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lbm_suite2p_python
|
|
3
|
+
Version: 2.0.4
|
|
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.0.4
|
|
15
|
+
Provides-Extra: cpsam
|
|
16
|
+
Requires-Dist: cellpose==4.0.6; extra == "cpsam"
|
|
17
|
+
Requires-Dist: pytorch; extra == "cpsam"
|
|
18
|
+
Requires-Dist: torchaudio; extra == "cpsam"
|
|
19
|
+
Provides-Extra: cpu
|
|
20
|
+
Requires-Dist: torch>=2.7.0; extra == "cpu"
|
|
21
|
+
Requires-Dist: torchvision>=0.22.0; extra == "cpu"
|
|
22
|
+
Provides-Extra: cu126
|
|
23
|
+
Requires-Dist: torch>=2.7.0; extra == "cu126"
|
|
24
|
+
Requires-Dist: torchvision>=0.22.0; extra == "cu126"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# Light Beads Microscopy (LBM) Pipeline: Suite2p
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/lbm-suite2p-python/)
|
|
30
|
+
|
|
31
|
+
[](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/index.html)
|
|
32
|
+
|
|
33
|
+
This package is still in a *late-beta* stage of development.
|
|
34
|
+
|
|
35
|
+
A pipeline for processing volumetric 2-photon Light Beads Microscopy (LBM) datasets.
|
|
36
|
+
|
|
37
|
+
This pipeline uses the following open-source software:
|
|
38
|
+
|
|
39
|
+
- [suite2p](https://github.com/MouseLand/suite2p)
|
|
40
|
+
- [cellpose](https://github.com/MouseLand/cellpose)
|
|
41
|
+
- [rastermap](https://github.com/MouseLand/rastermap)
|
|
42
|
+
- [mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)
|
|
43
|
+
- [scanreader](https://github.com/atlab/scanreader)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[](https://doi.org/10.1038/s41592-021-01239-8)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
This pipeline is installable with `pip`:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install lbm_suite2p_python
|
|
56
|
+
# with uv: uv pip install lbm_suite2p_python
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
We highly encourage the use of a virtual environment. If you are unfamiliar with virtual environments, see our documentation [here](https://millerbrainobservatory.github.io/mbo_utilities/venvs.html).
|
|
60
|
+
|
|
61
|
+
You may also use git to clone and install locally for updates not yet released to pypi:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
|
|
65
|
+
cd LBM-Suite2p-Python
|
|
66
|
+
|
|
67
|
+
# make sure your virtual environment is active
|
|
68
|
+
pip install "."
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Features
|
|
72
|
+
|
|
73
|
+
### 2.0.0
|
|
74
|
+
|
|
75
|
+
- Process ScanImage multi-ROI as separate datasets
|
|
76
|
+
- Post-processing cell filters for area, exceptional events and eccentricity
|
|
77
|
+
|
|
78
|
+
### 1.0.0
|
|
79
|
+
|
|
80
|
+
- Suite2p planar segmentation
|
|
81
|
+
- DF/F, baseline calculation and documentation
|
|
82
|
+
- Aggregate planar outputs into volumetric dataset
|
|
83
|
+
|
|
84
|
+
## Issues
|
|
85
|
+
|
|
86
|
+
Widgets may throw "Invalid Rect" errors. This can be safely ignored until it is [resolved](https://github.com/pygfx/wgpu-py/issues/716#issuecomment-2880853089).
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Acknowledgements
|
|
91
|
+
|
|
92
|
+
This pipeline is mostly a volumetric wrapper around [suite2p](https://github.com/MouseLand/suite2p), [cellpose](https://github.com/MouseLand/cellpose) and [Suite3D](https://github.com/alihaydaroglu/suite3d). We thank the contributors to those projects.
|
|
93
|
+
|
|
94
|
+
Thank you to the developers of [scanreader](https://github.com/atlab/scanreader), which provides a clean interface to ScanImage metadata using only tifffile and numpy.
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# Light Beads Microscopy (LBM) Pipeline: Suite2p
|
|
2
|
-
|
|
3
|
-
[](https://pypi.org/project/lbm-suite2p-python/)
|
|
4
|
-
|
|
5
|
-
[](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/index.html)
|
|
6
|
-
|
|
7
|
-
This package is still in a *late-beta* stage of development.
|
|
8
|
-
|
|
9
|
-
A pipeline for processing volumetric 2-photon Light Beads Microscopy (LBM) datasets.
|
|
10
|
-
|
|
11
|
-
This pipeline uses the following open-source software:
|
|
12
|
-
|
|
13
|
-
- [suite2p](https://github.com/MouseLand/suite2p)
|
|
14
|
-
- [cellpose](https://github.com/MouseLand/cellpose)
|
|
15
|
-
- [rastermap](https://github.com/MouseLand/rastermap)
|
|
16
|
-
- [mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)
|
|
17
|
-
- [scanreader](https://github.com/atlab/scanreader)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[](https://doi.org/10.1038/s41592-021-01239-8)
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Installation
|
|
25
|
-
|
|
26
|
-
This pipeline is installable with `pip`:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
pip install lbm_suite2p_python
|
|
30
|
-
# with uv: uv pip install lbm_suite2p_python
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
We highly encourage the use of a virtual environment. If you are unfamiliar with virtual environments, see our documentation [here](https://millerbrainobservatory.github.io/mbo_utilities/venvs.html).
|
|
34
|
-
|
|
35
|
-
You may also use git to clone and install locally for updates not yet released to pypi:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
|
|
39
|
-
cd LBM-Suite2p-Python
|
|
40
|
-
|
|
41
|
-
# make sure your virtual environment is active
|
|
42
|
-
pip install "."
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Features
|
|
46
|
-
|
|
47
|
-
### 2.0.0
|
|
48
|
-
|
|
49
|
-
- Process ScanImage multi-ROI as separate datasets
|
|
50
|
-
- Post-processing cell filters for area, exceptional events and eccentricity
|
|
51
|
-
|
|
52
|
-
### 1.0.0
|
|
53
|
-
|
|
54
|
-
- Suite2p planar segmentation
|
|
55
|
-
- DF/F, baseline calculation and documentation
|
|
56
|
-
- Aggregate planar outputs into volumetric dataset
|
|
57
|
-
|
|
58
|
-
## Issues
|
|
59
|
-
|
|
60
|
-
Widgets may throw "Invalid Rect" errors. This can be safely ignored until it is [resolved](https://github.com/pygfx/wgpu-py/issues/716#issuecomment-2880853089).
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Acknowledgements
|
|
65
|
-
|
|
66
|
-
This pipeline is mostly a volumetric wrapper around [suite2p](https://github.com/MouseLand/suite2p), [cellpose](https://github.com/MouseLand/cellpose) and [Suite3D](https://github.com/alihaydaroglu/suite3d). We thank the contributors to those projects.
|
|
67
|
-
|
|
68
|
-
Thank you to the developers of [scanreader](https://github.com/atlab/scanreader), which provides a clean interface to ScanImage metadata using only tifffile and numpy.
|
|
1
|
+
# Light Beads Microscopy (LBM) Pipeline: Suite2p
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/lbm-suite2p-python/)
|
|
4
|
+
|
|
5
|
+
[](https://millerbrainobservatory.github.io/LBM-Suite2p-Python/index.html)
|
|
6
|
+
|
|
7
|
+
This package is still in a *late-beta* stage of development.
|
|
8
|
+
|
|
9
|
+
A pipeline for processing volumetric 2-photon Light Beads Microscopy (LBM) datasets.
|
|
10
|
+
|
|
11
|
+
This pipeline uses the following open-source software:
|
|
12
|
+
|
|
13
|
+
- [suite2p](https://github.com/MouseLand/suite2p)
|
|
14
|
+
- [cellpose](https://github.com/MouseLand/cellpose)
|
|
15
|
+
- [rastermap](https://github.com/MouseLand/rastermap)
|
|
16
|
+
- [mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities)
|
|
17
|
+
- [scanreader](https://github.com/atlab/scanreader)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
[](https://doi.org/10.1038/s41592-021-01239-8)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
This pipeline is installable with `pip`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install lbm_suite2p_python
|
|
30
|
+
# with uv: uv pip install lbm_suite2p_python
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
We highly encourage the use of a virtual environment. If you are unfamiliar with virtual environments, see our documentation [here](https://millerbrainobservatory.github.io/mbo_utilities/venvs.html).
|
|
34
|
+
|
|
35
|
+
You may also use git to clone and install locally for updates not yet released to pypi:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
|
|
39
|
+
cd LBM-Suite2p-Python
|
|
40
|
+
|
|
41
|
+
# make sure your virtual environment is active
|
|
42
|
+
pip install "."
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
### 2.0.0
|
|
48
|
+
|
|
49
|
+
- Process ScanImage multi-ROI as separate datasets
|
|
50
|
+
- Post-processing cell filters for area, exceptional events and eccentricity
|
|
51
|
+
|
|
52
|
+
### 1.0.0
|
|
53
|
+
|
|
54
|
+
- Suite2p planar segmentation
|
|
55
|
+
- DF/F, baseline calculation and documentation
|
|
56
|
+
- Aggregate planar outputs into volumetric dataset
|
|
57
|
+
|
|
58
|
+
## Issues
|
|
59
|
+
|
|
60
|
+
Widgets may throw "Invalid Rect" errors. This can be safely ignored until it is [resolved](https://github.com/pygfx/wgpu-py/issues/716#issuecomment-2880853089).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Acknowledgements
|
|
65
|
+
|
|
66
|
+
This pipeline is mostly a volumetric wrapper around [suite2p](https://github.com/MouseLand/suite2p), [cellpose](https://github.com/MouseLand/cellpose) and [Suite3D](https://github.com/alihaydaroglu/suite3d). We thank the contributors to those projects.
|
|
67
|
+
|
|
68
|
+
Thank you to the developers of [scanreader](https://github.com/atlab/scanreader), which provides a clean interface to ScanImage metadata using only tifffile and numpy.
|
|
@@ -1,30 +1,30 @@
|
|
|
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
|
-
from lbm_suite2p_python.utils import *
|
|
6
|
-
from lbm_suite2p_python.volume import *
|
|
7
|
-
from lbm_suite2p_python.zplane import *
|
|
8
|
-
|
|
9
|
-
try:
|
|
10
|
-
__version__ = version("lbm_suite2p_python")
|
|
11
|
-
except PackageNotFoundError:
|
|
12
|
-
# fallback for editable installs
|
|
13
|
-
__version__ = "0.0.0"
|
|
14
|
-
|
|
15
|
-
__all__ = [
|
|
16
|
-
"run_volume",
|
|
17
|
-
"run_plane",
|
|
18
|
-
"plot_traces",
|
|
19
|
-
"plot_masks",
|
|
20
|
-
"plot_rastermap",
|
|
21
|
-
"plot_traces_noise",
|
|
22
|
-
"plot_volume_signal",
|
|
23
|
-
"plot_projection",
|
|
24
|
-
"plot_execution_time",
|
|
25
|
-
"plot_noise_distribution",
|
|
26
|
-
"dff_rolling_percentile",
|
|
27
|
-
"load_ops",
|
|
28
|
-
"load_planar_results",
|
|
29
|
-
"default_ops",
|
|
30
|
-
]
|
|
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
|
+
from lbm_suite2p_python.utils import *
|
|
6
|
+
from lbm_suite2p_python.volume import *
|
|
7
|
+
from lbm_suite2p_python.zplane import *
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
__version__ = version("lbm_suite2p_python")
|
|
11
|
+
except PackageNotFoundError:
|
|
12
|
+
# fallback for editable installs
|
|
13
|
+
__version__ = "0.0.0"
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"run_volume",
|
|
17
|
+
"run_plane",
|
|
18
|
+
"plot_traces",
|
|
19
|
+
"plot_masks",
|
|
20
|
+
"plot_rastermap",
|
|
21
|
+
"plot_traces_noise",
|
|
22
|
+
"plot_volume_signal",
|
|
23
|
+
"plot_projection",
|
|
24
|
+
"plot_execution_time",
|
|
25
|
+
"plot_noise_distribution",
|
|
26
|
+
"dff_rolling_percentile",
|
|
27
|
+
"load_ops",
|
|
28
|
+
"load_planar_results",
|
|
29
|
+
"default_ops",
|
|
30
|
+
]
|
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
import argparse
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from functools import partial
|
|
5
|
-
import lbm_suite2p_python as lsp
|
|
6
|
-
import mbo_utilities as mbo
|
|
7
|
-
|
|
8
|
-
print = partial(print, flush=True)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def add_args(parser: argparse.ArgumentParser):
|
|
12
|
-
"""
|
|
13
|
-
Add command-line arguments to the parser, dynamically adding arguments
|
|
14
|
-
for each key in the `ops` dictionary.
|
|
15
|
-
|
|
16
|
-
Parameters
|
|
17
|
-
----------
|
|
18
|
-
parser : argparse.ArgumentParser
|
|
19
|
-
The argument parser to which arguments are added.
|
|
20
|
-
|
|
21
|
-
Returns
|
|
22
|
-
-------
|
|
23
|
-
argparse.ArgumentParser
|
|
24
|
-
The parser with added arguments.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
parser.add_argument("--version", type=str, help="Print the version of the package.")
|
|
28
|
-
parser.add_argument("--ops", type=str, help="Path to the ops .npy file.")
|
|
29
|
-
parser.add_argument("--data", type=str, help="Path to the data.")
|
|
30
|
-
parser.add_argument("--save", type=str, help="Path to save the results.")
|
|
31
|
-
parser.add_argument(
|
|
32
|
-
"--subdir", type=str, help="Additional subdirectory add to save-path."
|
|
33
|
-
)
|
|
34
|
-
parser.add_argument(
|
|
35
|
-
"--max-depth",
|
|
36
|
-
type=int,
|
|
37
|
-
help="Number of subdirectories to check for files to process.",
|
|
38
|
-
)
|
|
39
|
-
parser.add_argument(
|
|
40
|
-
"--overwrite", action="store_true", help="Overwrite existing files."
|
|
41
|
-
)
|
|
42
|
-
parser.add_argument(
|
|
43
|
-
"--skip-existing", action="store_true", help="Skip existing files."
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
return parser
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def main():
|
|
50
|
-
"""
|
|
51
|
-
The main function that orchestrates the CLI operations.
|
|
52
|
-
"""
|
|
53
|
-
print("\n----------- LBM-Suite2p-Pipeline -----------\n")
|
|
54
|
-
from suite2p.default_ops import default_ops
|
|
55
|
-
|
|
56
|
-
parser = argparse.ArgumentParser(description="LBM-Suite2p-pipeline parameters")
|
|
57
|
-
parser = add_args(parser)
|
|
58
|
-
args = parser.parse_args()
|
|
59
|
-
|
|
60
|
-
if args.version:
|
|
61
|
-
print(f"lbm_suite2p_python v{lsp.__version__}")
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
ops = (
|
|
65
|
-
np.load(args.ops, allow_pickle=True).item()
|
|
66
|
-
if args.ops
|
|
67
|
-
else default_ops()
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
if not args.data:
|
|
71
|
-
raise ValueError("No input file or directory specified. Use --data")
|
|
72
|
-
|
|
73
|
-
input_path = Path(args.data)
|
|
74
|
-
|
|
75
|
-
# default to data-path / 'results'
|
|
76
|
-
save_path = Path(args.save) if args.save else input_path.parent / "results"
|
|
77
|
-
save_path.mkdir(parents=True, exist_ok=True)
|
|
78
|
-
|
|
79
|
-
# Optional user-defined save folder (e.g., plane_01_runA)
|
|
80
|
-
subdir = Path(args.subdir) if args.subdir else None
|
|
81
|
-
|
|
82
|
-
if input_path.is_file():
|
|
83
|
-
output_ops = lsp.run_plane(
|
|
84
|
-
input_path=input_path,
|
|
85
|
-
save_path=save_path,
|
|
86
|
-
ops=ops,
|
|
87
|
-
)
|
|
88
|
-
elif input_path.is_dir():
|
|
89
|
-
files = mbo.get_files(input_path, "tiff", max_depth=args.max_depth)
|
|
90
|
-
output_ops = lsp.run_volume(
|
|
91
|
-
ops=ops, input_files=files, save_path=save_path, save_folder=subdir
|
|
92
|
-
)
|
|
93
|
-
else:
|
|
94
|
-
raise FileNotFoundError(f"Input path does not exist: {input_path}")
|
|
95
|
-
|
|
96
|
-
print("Processing complete -----------")
|
|
97
|
-
return output_ops
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if __name__ == "__main__":
|
|
101
|
-
main()
|
|
1
|
+
import numpy as np
|
|
2
|
+
import argparse
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from functools import partial
|
|
5
|
+
import lbm_suite2p_python as lsp
|
|
6
|
+
import mbo_utilities as mbo
|
|
7
|
+
|
|
8
|
+
print = partial(print, flush=True)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def add_args(parser: argparse.ArgumentParser):
|
|
12
|
+
"""
|
|
13
|
+
Add command-line arguments to the parser, dynamically adding arguments
|
|
14
|
+
for each key in the `ops` dictionary.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
parser : argparse.ArgumentParser
|
|
19
|
+
The argument parser to which arguments are added.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
argparse.ArgumentParser
|
|
24
|
+
The parser with added arguments.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
parser.add_argument("--version", type=str, help="Print the version of the package.")
|
|
28
|
+
parser.add_argument("--ops", type=str, help="Path to the ops .npy file.")
|
|
29
|
+
parser.add_argument("--data", type=str, help="Path to the data.")
|
|
30
|
+
parser.add_argument("--save", type=str, help="Path to save the results.")
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
"--subdir", type=str, help="Additional subdirectory add to save-path."
|
|
33
|
+
)
|
|
34
|
+
parser.add_argument(
|
|
35
|
+
"--max-depth",
|
|
36
|
+
type=int,
|
|
37
|
+
help="Number of subdirectories to check for files to process.",
|
|
38
|
+
)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"--overwrite", action="store_true", help="Overwrite existing files."
|
|
41
|
+
)
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
"--skip-existing", action="store_true", help="Skip existing files."
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return parser
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def main():
|
|
50
|
+
"""
|
|
51
|
+
The main function that orchestrates the CLI operations.
|
|
52
|
+
"""
|
|
53
|
+
print("\n----------- LBM-Suite2p-Pipeline -----------\n")
|
|
54
|
+
from suite2p.default_ops import default_ops
|
|
55
|
+
|
|
56
|
+
parser = argparse.ArgumentParser(description="LBM-Suite2p-pipeline parameters")
|
|
57
|
+
parser = add_args(parser)
|
|
58
|
+
args = parser.parse_args()
|
|
59
|
+
|
|
60
|
+
if args.version:
|
|
61
|
+
print(f"lbm_suite2p_python v{lsp.__version__}")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
ops = (
|
|
65
|
+
np.load(args.ops, allow_pickle=True).item()
|
|
66
|
+
if args.ops
|
|
67
|
+
else default_ops()
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
if not args.data:
|
|
71
|
+
raise ValueError("No input file or directory specified. Use --data")
|
|
72
|
+
|
|
73
|
+
input_path = Path(args.data)
|
|
74
|
+
|
|
75
|
+
# default to data-path / 'results'
|
|
76
|
+
save_path = Path(args.save) if args.save else input_path.parent / "results"
|
|
77
|
+
save_path.mkdir(parents=True, exist_ok=True)
|
|
78
|
+
|
|
79
|
+
# Optional user-defined save folder (e.g., plane_01_runA)
|
|
80
|
+
subdir = Path(args.subdir) if args.subdir else None
|
|
81
|
+
|
|
82
|
+
if input_path.is_file():
|
|
83
|
+
output_ops = lsp.run_plane(
|
|
84
|
+
input_path=input_path,
|
|
85
|
+
save_path=save_path,
|
|
86
|
+
ops=ops,
|
|
87
|
+
)
|
|
88
|
+
elif input_path.is_dir():
|
|
89
|
+
files = mbo.get_files(input_path, "tiff", max_depth=args.max_depth)
|
|
90
|
+
output_ops = lsp.run_volume(
|
|
91
|
+
ops=ops, input_files=files, save_path=save_path, save_folder=subdir
|
|
92
|
+
)
|
|
93
|
+
else:
|
|
94
|
+
raise FileNotFoundError(f"Input path does not exist: {input_path}")
|
|
95
|
+
|
|
96
|
+
print("Processing complete -----------")
|
|
97
|
+
return output_ops
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if __name__ == "__main__":
|
|
101
|
+
main()
|