sphero-vem 0.1.0__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.
- sphero_vem-0.1.0/LICENSE +21 -0
- sphero_vem-0.1.0/PKG-INFO +138 -0
- sphero_vem-0.1.0/README.md +75 -0
- sphero_vem-0.1.0/pyproject.toml +105 -0
- sphero_vem-0.1.0/src/sphero_vem/__init__.py +110 -0
- sphero_vem-0.1.0/src/sphero_vem/denoising.py +771 -0
- sphero_vem-0.1.0/src/sphero_vem/io.py +464 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/__init__.py +29 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/distance.py +188 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/fractal.py +124 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/mesh.py +346 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/pipeline.py +332 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/sdf.py +330 -0
- sphero_vem-0.1.0/src/sphero_vem/measure/voxel.py +94 -0
- sphero_vem-0.1.0/src/sphero_vem/metrics.py +99 -0
- sphero_vem-0.1.0/src/sphero_vem/postprocessing.py +146 -0
- sphero_vem-0.1.0/src/sphero_vem/preprocessing.py +329 -0
- sphero_vem-0.1.0/src/sphero_vem/registration/__init__.py +30 -0
- sphero_vem-0.1.0/src/sphero_vem/registration/core.py +658 -0
- sphero_vem-0.1.0/src/sphero_vem/registration/cropping.py +324 -0
- sphero_vem-0.1.0/src/sphero_vem/registration/transforms.py +150 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/__init__.py +22 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/__init__.py +41 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/core.py +575 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/evaluation.py +202 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/finetuning.py +361 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/postptocessing.py +395 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/cellpose/utils.py +482 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/np/__init__.py +26 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/np/core.py +599 -0
- sphero_vem-0.1.0/src/sphero_vem/segmentation/np/utils.py +93 -0
- sphero_vem-0.1.0/src/sphero_vem/utils/__init__.py +33 -0
- sphero_vem-0.1.0/src/sphero_vem/utils/accelerator.py +239 -0
- sphero_vem-0.1.0/src/sphero_vem/utils/config.py +276 -0
- sphero_vem-0.1.0/src/sphero_vem/utils/logging.py +87 -0
- sphero_vem-0.1.0/src/sphero_vem/utils/misc.py +301 -0
sphero_vem-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Davide Bottone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sphero-vem
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Quantitative 3D analysis of volume electron microscopy data with ML and classical image processing
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 Davide Bottone
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Author: Davide Bottone
|
|
28
|
+
Author-email: d.bottone@pm.me
|
|
29
|
+
Requires-Python: >=3.12,<3.14
|
|
30
|
+
Classifier: Development Status :: 4 - Beta
|
|
31
|
+
Classifier: Intended Audience :: Science/Research
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
36
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
37
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
38
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
39
|
+
Classifier: Operating System :: OS Independent
|
|
40
|
+
Provides-Extra: cuda
|
|
41
|
+
Requires-Dist: careamics (>=0.0.9)
|
|
42
|
+
Requires-Dist: cellpose (>=4.0.3,<5.0.0)
|
|
43
|
+
Requires-Dist: cucim-cu12 (>=25.12.0,<26.0.0) ; extra == "cuda"
|
|
44
|
+
Requires-Dist: cupy-cuda12x (>=13.6.0,<14.0.0) ; extra == "cuda"
|
|
45
|
+
Requires-Dist: dacite (>=1.9.2,<2.0.0)
|
|
46
|
+
Requires-Dist: dask-image (>=2025.11.0,<2026.0.0)
|
|
47
|
+
Requires-Dist: dotenv (>=0.9.9,<0.10.0)
|
|
48
|
+
Requires-Dist: kornia (>=0.8.0,<0.9.0)
|
|
49
|
+
Requires-Dist: lightning (>=2.5.1,<3.0.0)
|
|
50
|
+
Requires-Dist: numpy (>=2.0.0,<3.0.0)
|
|
51
|
+
Requires-Dist: pandas (>=2.3.0,<3.0.0)
|
|
52
|
+
Requires-Dist: polars (>=1.39.2,<2.0.0)
|
|
53
|
+
Requires-Dist: scikit-learn (>=1.6.1,<2.0.0)
|
|
54
|
+
Requires-Dist: torch (>=2.0.0,<2.7.0)
|
|
55
|
+
Requires-Dist: torchvision (>=0.15.0,<0.22.0)
|
|
56
|
+
Requires-Dist: wandb (>=0.19.10,<0.20.0)
|
|
57
|
+
Requires-Dist: zarr (>=3.0.0,<4.0.0)
|
|
58
|
+
Project-URL: Documentation, https://dv-bt.github.io/sphero-vem/
|
|
59
|
+
Project-URL: Homepage, https://dv-bt.github.io/sphero-vem/
|
|
60
|
+
Project-URL: Repository, https://github.com/dv-bt/sphero-vem/
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
# sphero-vem
|
|
64
|
+
|
|
65
|
+
[](https://www.python.org)
|
|
66
|
+
[](https://github.com/dv-bt/sphero-vem/actions/workflows/ci.yml)
|
|
67
|
+
[](https://codecov.io/gh/dv-bt/sphero-vem)
|
|
68
|
+
[](https://github.com/astral-sh/ruff)
|
|
69
|
+
|
|
70
|
+
Python library for quantitative analysis of volumetric electron microscopy (vEM) data.
|
|
71
|
+
|
|
72
|
+
`sphero-vem` was developed for the end-to-end analysis pipeline described in:
|
|
73
|
+
|
|
74
|
+
> Bottone et al., *3D Reconstruction of Nanoparticle Distribution in Tumor Spheroids with Volume Electron Microscopy*, [Preprint: [https://doi.org/10.64898/2026.04.17.719153](https://doi.org/10.64898/2026.04.17.719153)]
|
|
75
|
+
|
|
76
|
+
While the library was originally developed for SBF-SEM data of nanoparticle-loaded tumor spheroids, the individual components are designed to be reusable for other vEM datasets and workflows.
|
|
77
|
+
|
|
78
|
+
## Capabilities
|
|
79
|
+
|
|
80
|
+
- **Denoising**: self-supervised Noise2Void via CAREamics on large zarr volumes
|
|
81
|
+
- **Registration**: intensity-based pairwise slice alignment with multi-resolution PyTorch optimization
|
|
82
|
+
- **Segmentation**: fine-tuning and inference with Cellpose-SAM for cells and nuclei; empirical Bayes approach for nanoparticles
|
|
83
|
+
- **Shape analysis**: 3D morphological descriptors via signed distance functions and mesh-based curvature (mean curvature, curvedness, shape index, fractal dimension)
|
|
84
|
+
- **Spatial analysis**: nanoparticle-to-nucleus distance quantification per cell
|
|
85
|
+
- **Data management**: zarr-native I/O with OME-NGFF multiscale support and processing metadata tracking
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
Clone the repository and install with [Poetry](https://python-poetry.org/):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/dv-bt/sphero-vem.git
|
|
93
|
+
cd sphero-vem
|
|
94
|
+
poetry install # CPU and limited GPU acceleration
|
|
95
|
+
poetry install -E cuda # with full CUDA 12.x GPU acceleration (Linux/Windows only)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Documentation
|
|
99
|
+
|
|
100
|
+
Full documentation is available on the [official website](https://dv-bt.github.io/sphero-vem/).
|
|
101
|
+
|
|
102
|
+
## Requirements
|
|
103
|
+
|
|
104
|
+
- Python 3.12–3.13
|
|
105
|
+
- [PyTorch](https://pytorch.org/) ≥ 2.0
|
|
106
|
+
- [NumPy](https://numpy.org/) ≥ 2.0
|
|
107
|
+
- [zarr](https://zarr.readthedocs.io/) ≥ 3.0
|
|
108
|
+
- [Cellpose](https://cellpose.readthedocs.io/) ≥ 4.0
|
|
109
|
+
- [CAREamics](https://careamics.github.io/) ≥ 0.0.9
|
|
110
|
+
|
|
111
|
+
## GPU acceleration
|
|
112
|
+
|
|
113
|
+
PyTorch-based stages (denoising, registration, Cellpose segmentation) support GPU execution via PyTorch's native device management, including CUDA and MPS (Apple Silicon), and require no additional dependencies.
|
|
114
|
+
|
|
115
|
+
Array operation stages (nanoparticle segmentation, shape analysis, spatial analysis) additionally support CUDA acceleration via CuPy and CuCIM, installed with the `cuda` optional dependency group above. GPU acceleration is handled automatically with a custom orchestrator.
|
|
116
|
+
|
|
117
|
+
## Dataset and model weights
|
|
118
|
+
|
|
119
|
+
The annotated SBF-SEM dataset used to develop this pipeline is available at BioImage Archive (https://doi.org/10.6019/S-BIAD3263). Fine-tuned Cellpose-SAM model weights are available on Zenodo (https://doi.org/10.5281/zenodo.19616546).
|
|
120
|
+
|
|
121
|
+
## Citation
|
|
122
|
+
|
|
123
|
+
If you use this library, please cite the accompanying paper:
|
|
124
|
+
|
|
125
|
+
```bibtex
|
|
126
|
+
@article {Bottone2026,
|
|
127
|
+
author = {Bottone, Davide and Gerken, Lukas RH and Habermann, Sebastian and Mateos, Jose Maria and Lucas, Miriam S and Riemann, Johannes and Fachet, Melanie and Resch-Genger, Ute and Kissling, Vera M and Roesslein, Matthias and Gogos, Alexander and Herrmann, Inge K},
|
|
128
|
+
title = {3D Reconstruction of Nanoparticle Distribution in Tumor Spheroids with Volume Electron Microscopy},
|
|
129
|
+
year = {2026},
|
|
130
|
+
doi = {10.64898/2026.04.17.719153},
|
|
131
|
+
eprint = {https://www.biorxiv.org/content/early/2026/04/21/2026.04.17.719153},
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
See [LICENSE](LICENSE) for details.
|
|
138
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# sphero-vem
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org)
|
|
4
|
+
[](https://github.com/dv-bt/sphero-vem/actions/workflows/ci.yml)
|
|
5
|
+
[](https://codecov.io/gh/dv-bt/sphero-vem)
|
|
6
|
+
[](https://github.com/astral-sh/ruff)
|
|
7
|
+
|
|
8
|
+
Python library for quantitative analysis of volumetric electron microscopy (vEM) data.
|
|
9
|
+
|
|
10
|
+
`sphero-vem` was developed for the end-to-end analysis pipeline described in:
|
|
11
|
+
|
|
12
|
+
> Bottone et al., *3D Reconstruction of Nanoparticle Distribution in Tumor Spheroids with Volume Electron Microscopy*, [Preprint: [https://doi.org/10.64898/2026.04.17.719153](https://doi.org/10.64898/2026.04.17.719153)]
|
|
13
|
+
|
|
14
|
+
While the library was originally developed for SBF-SEM data of nanoparticle-loaded tumor spheroids, the individual components are designed to be reusable for other vEM datasets and workflows.
|
|
15
|
+
|
|
16
|
+
## Capabilities
|
|
17
|
+
|
|
18
|
+
- **Denoising**: self-supervised Noise2Void via CAREamics on large zarr volumes
|
|
19
|
+
- **Registration**: intensity-based pairwise slice alignment with multi-resolution PyTorch optimization
|
|
20
|
+
- **Segmentation**: fine-tuning and inference with Cellpose-SAM for cells and nuclei; empirical Bayes approach for nanoparticles
|
|
21
|
+
- **Shape analysis**: 3D morphological descriptors via signed distance functions and mesh-based curvature (mean curvature, curvedness, shape index, fractal dimension)
|
|
22
|
+
- **Spatial analysis**: nanoparticle-to-nucleus distance quantification per cell
|
|
23
|
+
- **Data management**: zarr-native I/O with OME-NGFF multiscale support and processing metadata tracking
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Clone the repository and install with [Poetry](https://python-poetry.org/):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/dv-bt/sphero-vem.git
|
|
31
|
+
cd sphero-vem
|
|
32
|
+
poetry install # CPU and limited GPU acceleration
|
|
33
|
+
poetry install -E cuda # with full CUDA 12.x GPU acceleration (Linux/Windows only)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
Full documentation is available on the [official website](https://dv-bt.github.io/sphero-vem/).
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Python 3.12–3.13
|
|
43
|
+
- [PyTorch](https://pytorch.org/) ≥ 2.0
|
|
44
|
+
- [NumPy](https://numpy.org/) ≥ 2.0
|
|
45
|
+
- [zarr](https://zarr.readthedocs.io/) ≥ 3.0
|
|
46
|
+
- [Cellpose](https://cellpose.readthedocs.io/) ≥ 4.0
|
|
47
|
+
- [CAREamics](https://careamics.github.io/) ≥ 0.0.9
|
|
48
|
+
|
|
49
|
+
## GPU acceleration
|
|
50
|
+
|
|
51
|
+
PyTorch-based stages (denoising, registration, Cellpose segmentation) support GPU execution via PyTorch's native device management, including CUDA and MPS (Apple Silicon), and require no additional dependencies.
|
|
52
|
+
|
|
53
|
+
Array operation stages (nanoparticle segmentation, shape analysis, spatial analysis) additionally support CUDA acceleration via CuPy and CuCIM, installed with the `cuda` optional dependency group above. GPU acceleration is handled automatically with a custom orchestrator.
|
|
54
|
+
|
|
55
|
+
## Dataset and model weights
|
|
56
|
+
|
|
57
|
+
The annotated SBF-SEM dataset used to develop this pipeline is available at BioImage Archive (https://doi.org/10.6019/S-BIAD3263). Fine-tuned Cellpose-SAM model weights are available on Zenodo (https://doi.org/10.5281/zenodo.19616546).
|
|
58
|
+
|
|
59
|
+
## Citation
|
|
60
|
+
|
|
61
|
+
If you use this library, please cite the accompanying paper:
|
|
62
|
+
|
|
63
|
+
```bibtex
|
|
64
|
+
@article {Bottone2026,
|
|
65
|
+
author = {Bottone, Davide and Gerken, Lukas RH and Habermann, Sebastian and Mateos, Jose Maria and Lucas, Miriam S and Riemann, Johannes and Fachet, Melanie and Resch-Genger, Ute and Kissling, Vera M and Roesslein, Matthias and Gogos, Alexander and Herrmann, Inge K},
|
|
66
|
+
title = {3D Reconstruction of Nanoparticle Distribution in Tumor Spheroids with Volume Electron Microscopy},
|
|
67
|
+
year = {2026},
|
|
68
|
+
doi = {10.64898/2026.04.17.719153},
|
|
69
|
+
eprint = {https://www.biorxiv.org/content/early/2026/04/21/2026.04.17.719153},
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "sphero-vem"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Quantitative 3D analysis of volume electron microscopy data with ML and classical image processing"
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Davide Bottone",email = "d.bottone@pm.me"}
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
license = {file = "LICENSE"}
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"Intended Audience :: Science/Research",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Bio-Informatics",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
requires-python = ">=3.12,<3.14"
|
|
23
|
+
dependencies = [
|
|
24
|
+
"numpy (>=2.0.0,<3.0.0)",
|
|
25
|
+
"zarr (>=3.0.0,<4.0.0)",
|
|
26
|
+
"torch (>=2.0.0,<2.7.0)",
|
|
27
|
+
"torchvision (>=0.15.0,<0.22.0)",
|
|
28
|
+
"careamics (>=0.0.9)",
|
|
29
|
+
"kornia (>=0.8.0,<0.9.0)",
|
|
30
|
+
"lightning (>=2.5.1,<3.0.0)",
|
|
31
|
+
"dotenv (>=0.9.9,<0.10.0)",
|
|
32
|
+
"cellpose (>=4.0.3,<5.0.0)",
|
|
33
|
+
"scikit-learn (>=1.6.1,<2.0.0)",
|
|
34
|
+
"pandas (>=2.3.0,<3.0.0)",
|
|
35
|
+
"dask-image (>=2025.11.0,<2026.0.0)",
|
|
36
|
+
"dacite (>=1.9.2,<2.0.0)",
|
|
37
|
+
"polars (>=1.39.2,<2.0.0)",
|
|
38
|
+
"wandb (>=0.19.10,<0.20.0)",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://dv-bt.github.io/sphero-vem/"
|
|
43
|
+
Repository = "https://github.com/dv-bt/sphero-vem/"
|
|
44
|
+
Documentation = "https://dv-bt.github.io/sphero-vem/"
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
cuda = [
|
|
48
|
+
"cupy-cuda12x>=13.6.0,<14.0.0",
|
|
49
|
+
"cucim-cu12>=25.12.0,<26.0.0",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[tool.poetry]
|
|
53
|
+
packages = [{include = "sphero_vem", from = "src"}]
|
|
54
|
+
|
|
55
|
+
[tool.poetry.group.dev]
|
|
56
|
+
optional = true
|
|
57
|
+
|
|
58
|
+
[tool.poetry.group.dev.dependencies]
|
|
59
|
+
pytest = "^8.3.5"
|
|
60
|
+
pytest-cov = "^6.1.1"
|
|
61
|
+
ruff = "^0.11.4"
|
|
62
|
+
pre-commit = "^4.2.0"
|
|
63
|
+
bumpver = "^2025.1131"
|
|
64
|
+
|
|
65
|
+
[tool.poetry.group.docs]
|
|
66
|
+
optional = true
|
|
67
|
+
|
|
68
|
+
[tool.poetry.group.docs.dependencies]
|
|
69
|
+
sphinx = "^8.0.0"
|
|
70
|
+
pydata-sphinx-theme = "^0.16.0"
|
|
71
|
+
sphinx-autodoc-typehints = "^3.0.0"
|
|
72
|
+
|
|
73
|
+
[tool.poetry.group.napari]
|
|
74
|
+
optional = true
|
|
75
|
+
|
|
76
|
+
[tool.poetry.group.napari.dependencies]
|
|
77
|
+
napari = {extras = ["pyqt6"], version = "^0.6.6"}
|
|
78
|
+
|
|
79
|
+
[tool.poetry.group.notebook]
|
|
80
|
+
optional = true
|
|
81
|
+
|
|
82
|
+
[tool.poetry.group.notebook.dependencies]
|
|
83
|
+
ipykernel = "^6.29.5"
|
|
84
|
+
ipympl = "^0.9.7"
|
|
85
|
+
seaborn = "^0.13.2"
|
|
86
|
+
statannotations = ">=0.7.2,<0.8.0"
|
|
87
|
+
statsmodels = ">=0.14.6,<0.15.0"
|
|
88
|
+
|
|
89
|
+
[build-system]
|
|
90
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
91
|
+
build-backend = "poetry.core.masonry.api"
|
|
92
|
+
|
|
93
|
+
[tool.bumpver]
|
|
94
|
+
current_version = "0.1.0"
|
|
95
|
+
version_pattern = "MAJOR.MINOR.PATCH"
|
|
96
|
+
commit_message = "Bump version: {old_version} -> {new_version}"
|
|
97
|
+
tag_message = "{new_version}"
|
|
98
|
+
commit = true
|
|
99
|
+
tag = true
|
|
100
|
+
push = true
|
|
101
|
+
|
|
102
|
+
[tool.bumpver.file_patterns]
|
|
103
|
+
"pyproject.toml" = [
|
|
104
|
+
'version = "{version}"',
|
|
105
|
+
]
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""
|
|
2
|
+
sphero-vem: 3D Volumetric Analysis Tools for Electron Microscopy
|
|
3
|
+
|
|
4
|
+
A scientific Python package for processing, registering, segmenting, and analyzing
|
|
5
|
+
3D volumetric microscopy data, with focus on spheroid cell cultures and electron
|
|
6
|
+
microscopy imaging.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
__version__ = version("sphero-vem")
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
__version__ = "unknown"
|
|
15
|
+
|
|
16
|
+
# Core I/O operations
|
|
17
|
+
from .io import (
|
|
18
|
+
write_image,
|
|
19
|
+
stack_to_zarr,
|
|
20
|
+
write_zarr,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Preprocessing
|
|
24
|
+
from .preprocessing import (
|
|
25
|
+
downscale_tensor,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
# Registration
|
|
29
|
+
from .registration import (
|
|
30
|
+
RegistrationConfig,
|
|
31
|
+
register_image_pair,
|
|
32
|
+
register_stack,
|
|
33
|
+
TransformType,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Denoising
|
|
37
|
+
from .denoising import (
|
|
38
|
+
DenoisingConfig,
|
|
39
|
+
train_n2v,
|
|
40
|
+
denoise_stack,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Measurement
|
|
44
|
+
from .measure import (
|
|
45
|
+
LabelAnalysisConfig,
|
|
46
|
+
props_voxel,
|
|
47
|
+
props_sdf,
|
|
48
|
+
props_mesh,
|
|
49
|
+
props_fractal,
|
|
50
|
+
label_properties,
|
|
51
|
+
analyze_labels,
|
|
52
|
+
save_regionprops,
|
|
53
|
+
read_regionprops,
|
|
54
|
+
get_mesh,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Segmentation
|
|
58
|
+
from .segmentation.cellpose import (
|
|
59
|
+
CellposeFlowConfig,
|
|
60
|
+
calculate_flows,
|
|
61
|
+
calculate_masks,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Utilities
|
|
65
|
+
from .utils import (
|
|
66
|
+
BaseConfig,
|
|
67
|
+
ProcessingStep,
|
|
68
|
+
timestamp,
|
|
69
|
+
detect_torch_device,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
__all__ = [
|
|
73
|
+
# Version
|
|
74
|
+
"__version__",
|
|
75
|
+
# I/O
|
|
76
|
+
"write_image",
|
|
77
|
+
"stack_to_zarr",
|
|
78
|
+
"write_zarr",
|
|
79
|
+
# Preprocessing
|
|
80
|
+
"downscale_tensor",
|
|
81
|
+
# Registration
|
|
82
|
+
"RegistrationConfig",
|
|
83
|
+
"register_image_pair",
|
|
84
|
+
"register_stack",
|
|
85
|
+
"TransformType",
|
|
86
|
+
# Denoising
|
|
87
|
+
"DenoisingConfig",
|
|
88
|
+
"train_n2v",
|
|
89
|
+
"denoise_stack",
|
|
90
|
+
# Measurement
|
|
91
|
+
"LabelAnalysisConfig",
|
|
92
|
+
"props_voxel",
|
|
93
|
+
"props_sdf",
|
|
94
|
+
"props_mesh",
|
|
95
|
+
"props_fractal",
|
|
96
|
+
"label_properties",
|
|
97
|
+
"analyze_labels",
|
|
98
|
+
"save_regionprops",
|
|
99
|
+
"read_regionprops",
|
|
100
|
+
"get_mesh",
|
|
101
|
+
# Segmentation
|
|
102
|
+
"CellposeFlowConfig",
|
|
103
|
+
"calculate_flows",
|
|
104
|
+
"calculate_masks",
|
|
105
|
+
# Utilities
|
|
106
|
+
"BaseConfig",
|
|
107
|
+
"ProcessingStep",
|
|
108
|
+
"timestamp",
|
|
109
|
+
"detect_torch_device",
|
|
110
|
+
]
|