napari-sigma 0.0.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.
- napari_sigma-0.0.1/LICENSE +38 -0
- napari_sigma-0.0.1/MANIFEST.in +4 -0
- napari_sigma-0.0.1/PKG-INFO +246 -0
- napari_sigma-0.0.1/README.md +204 -0
- napari_sigma-0.0.1/docs/getting-started.md +52 -0
- napari_sigma-0.0.1/docs/images/morphology-2d/01-analyze-objects.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-2d/02-topology-interaction.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-3d-er/01-vesselness-aware-segmentation.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-3d-er/02-analyze-objects.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-3d-er/03-topology-interaction.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-3d-mitochondria/01-analyze-objects.png +0 -0
- napari_sigma-0.0.1/docs/images/morphology-3d-mitochondria/02-topology-interaction.png +0 -0
- napari_sigma-0.0.1/docs/images/proximity-assay/01-full-image-analysis.png +0 -0
- napari_sigma-0.0.1/docs/images/proximity-assay/02-roi-analysis.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-2d/01-raw-image.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-2d/02-median-denoised.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-2d/03-vesselness-response.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-2d/04-segmentation-result.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/01-raw-volume.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/02-median-filtered.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/03-combined-response.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/04-vessel-rescaled.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/05-otsu-segmentation.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-er/06-average-projection.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-mitochondria/01-raw-volume.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-mitochondria/02-median-upsampled.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-mitochondria/03-vesselness-response.png +0 -0
- napari_sigma-0.0.1/docs/images/segmentation-3d-mitochondria/04-segmentation-result.png +0 -0
- napari_sigma-0.0.1/docs/images/tracking/01-match-frame-visualization.png +0 -0
- napari_sigma-0.0.1/docs/images/tracking/02-tracking-events.png +0 -0
- napari_sigma-0.0.1/docs/images/tracking/03-object-context-source.png +0 -0
- napari_sigma-0.0.1/docs/images/tracking/04-object-context-successor.png +0 -0
- napari_sigma-0.0.1/docs/images/tracking/05-refine-links.png +0 -0
- napari_sigma-0.0.1/docs/morphology-analysis.md +92 -0
- napari_sigma-0.0.1/docs/proximity-analysis.md +78 -0
- napari_sigma-0.0.1/docs/segmentation.md +187 -0
- napari_sigma-0.0.1/docs/tracking.md +97 -0
- napari_sigma-0.0.1/pyproject.toml +79 -0
- napari_sigma-0.0.1/setup.cfg +4 -0
- napari_sigma-0.0.1/src/frangi_filter/__init__.py +0 -0
- napari_sigma-0.0.1/src/frangi_filter/frangi_filter.py +502 -0
- napari_sigma-0.0.1/src/frangi_filter/gaussian_smoothing.py +163 -0
- napari_sigma-0.0.1/src/napari_sigma/__init__.py +11 -0
- napari_sigma-0.0.1/src/napari_sigma/_analysis.py +2653 -0
- napari_sigma-0.0.1/src/napari_sigma/_image_io.py +379 -0
- napari_sigma-0.0.1/src/napari_sigma/_layer_candidates.py +60 -0
- napari_sigma-0.0.1/src/napari_sigma/_nis_tiff.py +295 -0
- napari_sigma-0.0.1/src/napari_sigma/_proximity.py +903 -0
- napari_sigma-0.0.1/src/napari_sigma/_tracking.py +2358 -0
- napari_sigma-0.0.1/src/napari_sigma/_version.py +20 -0
- napari_sigma-0.0.1/src/napari_sigma/_widget.py +14133 -0
- napari_sigma-0.0.1/src/napari_sigma/_writer.py +223 -0
- napari_sigma-0.0.1/src/napari_sigma/napari.yaml +25 -0
- napari_sigma-0.0.1/src/napari_sigma/segmentation.py +1159 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/PKG-INFO +246 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/SOURCES.txt +58 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/dependency_links.txt +1 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/entry_points.txt +2 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/requires.txt +16 -0
- napari_sigma-0.0.1/src/napari_sigma.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<<<<<<< HEAD
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 fenghuibao
|
|
5
|
+
=======
|
|
6
|
+
|
|
7
|
+
The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Huibao Feng
|
|
10
|
+
>>>>>>> 8d6afec (initial commit)
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
<<<<<<< HEAD
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
=======
|
|
23
|
+
The above copyright notice and this permission notice shall be included in
|
|
24
|
+
all copies or substantial portions of the Software.
|
|
25
|
+
>>>>>>> 8d6afec (initial commit)
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
<<<<<<< HEAD
|
|
33
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
SOFTWARE.
|
|
35
|
+
=======
|
|
36
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
37
|
+
THE SOFTWARE.
|
|
38
|
+
>>>>>>> 8d6afec (initial commit)
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: napari-sigma
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: SIGMA (Structurally-aware Intensity-ordered GMM-MRF Algorithm) is a microscopy toolkit for structural and dynamic analysis.
|
|
5
|
+
Author-email: Huibao Feng <fenghuibao@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/fenghuibao/napari-sigma
|
|
8
|
+
Project-URL: Repository, https://github.com/fenghuibao/napari-sigma
|
|
9
|
+
Project-URL: Issues, https://github.com/fenghuibao/napari-sigma/issues
|
|
10
|
+
Keywords: napari,microscopy,segmentation,morphology,tracking,proximity-analysis
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Framework :: napari
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: dask[array]>=2024.1.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.7.0
|
|
28
|
+
Requires-Dist: napari>=0.5.0
|
|
29
|
+
Requires-Dist: numpy>=1.24.0
|
|
30
|
+
Requires-Dist: opencv-python>=4.7.0
|
|
31
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
32
|
+
Requires-Dist: pillow>=9.0.0
|
|
33
|
+
Requires-Dist: qtpy>=2.4.0
|
|
34
|
+
Requires-Dist: scikit-image>=0.20.0
|
|
35
|
+
Requires-Dist: scikit-learn>=1.3.0
|
|
36
|
+
Requires-Dist: scipy>=1.10.0
|
|
37
|
+
Requires-Dist: tifffile>=2023.1.1
|
|
38
|
+
Requires-Dist: torch>=2.0.0
|
|
39
|
+
Provides-Extra: all
|
|
40
|
+
Requires-Dist: napari[all]; extra == "all"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# SIGMA (Structurally-aware Intensity-ordered GMM-MRF Algorithm)
|
|
44
|
+
|
|
45
|
+
[](./LICENSE)
|
|
46
|
+
[](https://pypi.org/project/napari-sigma/)
|
|
47
|
+
[](https://pypi.org/project/napari-sigma/)
|
|
48
|
+
[](https://napari-hub.org/plugins/napari-sigma)
|
|
49
|
+
[](https://napari.org/stable/plugins/index.html)
|
|
50
|
+
|
|
51
|
+
SIGMA is an annotation-free, image-adaptive napari framework for fluorescence image analysis. It combines an image-specific Gaussian mixture model (GMM) with intensity-ordered class assignment and a Markov random field (MRF) prior guided by local structural constraints derived from Hessian analysis. By estimating model parameters from each image, SIGMA is designed to retain faint or thin fluorescent structures while limiting mergers between closely apposed objects.
|
|
52
|
+
|
|
53
|
+
Its four connected workflows quantify cellular morphology, dynamics, and spatial organization:
|
|
54
|
+
|
|
55
|
+
- **Segmentation**: image-specific GMM-MRF segmentation guided by tubular or sheet-like structural responses
|
|
56
|
+
- **Morphology Analysis**: object geometry, skeleton branches, endpoints, junctions, and network topology
|
|
57
|
+
- **Tracking**: adjacent-frame object matching, remodeling-event classification, visualization, and link refinement
|
|
58
|
+
- **Proximity Analysis**: image-resolution overlap, distance, Manders coefficients, and ROI-restricted spatial association
|
|
59
|
+
|
|
60
|
+
SIGMA supports 2D, 3D, and time-series data and can run on CPU, CUDA, or Apple MPS when available.
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
Create a clean environment and install the published napari plugin:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
conda create -n sigma python=3.11
|
|
68
|
+
conda activate sigma
|
|
69
|
+
pip install --upgrade "napari-sigma[all]"
|
|
70
|
+
napari
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then select **SIGMA** from napari's **Plugins** menu.
|
|
74
|
+
|
|
75
|
+
### Development installation
|
|
76
|
+
|
|
77
|
+
From the repository root:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
conda create -n sigma-dev python=3.11
|
|
81
|
+
conda activate sigma-dev
|
|
82
|
+
pip install -e ".[all]"
|
|
83
|
+
napari
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Input data
|
|
87
|
+
|
|
88
|
+
The napari reader currently supports:
|
|
89
|
+
|
|
90
|
+
- TIFF: `.tif`, `.tiff`
|
|
91
|
+
- PNG: `.png`
|
|
92
|
+
- JPEG: `.jpg`, `.jpeg`
|
|
93
|
+
|
|
94
|
+
Microscope container formats such as CZI, ND2, LIF, and LSM should first be exported to one of the supported formats.
|
|
95
|
+
|
|
96
|
+
SIGMA preserves available physical-size and axis metadata. If physical size metadata is unavailable, pixel or voxel size defaults to `1.0`.
|
|
97
|
+
|
|
98
|
+
## Quick start
|
|
99
|
+
|
|
100
|
+
1. Open a microscopy image in napari.
|
|
101
|
+
2. Open **SIGMA** from the **Plugins** menu.
|
|
102
|
+
3. Use **Segmentation** to extract local structural evidence and infer a binary foreground mask.
|
|
103
|
+
4. Use **Morphology Analysis** to measure connected structures and their skeleton topology.
|
|
104
|
+
5. Use **Tracking** to associate objects across adjacent frames and classify linear, fission, fusion, or split-merge transitions.
|
|
105
|
+
6. Use **Proximity Analysis** to quantify the spatial association between structures segmented in separate fluorescence channels.
|
|
106
|
+
|
|
107
|
+
## Documentation
|
|
108
|
+
|
|
109
|
+
- [Getting started](./docs/getting-started.md)
|
|
110
|
+
- [Segmentation](./docs/segmentation.md)
|
|
111
|
+
- [Morphology Analysis](./docs/morphology-analysis.md)
|
|
112
|
+
- [Tracking](./docs/tracking.md)
|
|
113
|
+
- [Proximity Analysis](./docs/proximity-analysis.md)
|
|
114
|
+
|
|
115
|
+
## Example data
|
|
116
|
+
|
|
117
|
+
The repository includes example fluorescence data for every documented workflow. Segmentation and morphology use the same raw images; tracking and proximity analysis also include aligned segmentation inputs so those workflows can be run directly.
|
|
118
|
+
|
|
119
|
+
- **2D segmentation and morphology:** [`2d_example_raw.tif`](./example/2d/2d_example_raw.tif)
|
|
120
|
+
- **3D mitochondrial segmentation and morphology:** [`3d_example_Mitochondria.tif`](./example/3d/3d_example_Mitochondria.tif)
|
|
121
|
+
- **3D ER segmentation and morphology:** [`3d_example_ER.tif`](./example/3d/3d_example_ER.tif)
|
|
122
|
+
- **Tracking:** [`tracking_example.tif`](./example/Tracking/tracking_example.tif) and [`tracking_example_segmentation.tif`](./example/Tracking/tracking_example_segmentation.tif)
|
|
123
|
+
- **Mitochondria-ER proximity assay:** [`mitochondria raw`](./example/Proximity_analysis/proximity_assay_example_mito.tif), [`mitochondria segmentation`](./example/Proximity_analysis/proximity_assay_example_mito_segmentation.tif), [`ER raw`](./example/Proximity_analysis/proximity_assay_example_ER.tif), and [`ER segmentation`](./example/Proximity_analysis/proximity_assay_example_ER_segmentation.tif)
|
|
124
|
+
|
|
125
|
+
Use TIFF for workflows that depend on axis metadata or physical pixel and voxel sizes. Files used together must have matching spatial dimensions, time axes, physical scales, and, for proximity analysis, spatial alignment.
|
|
126
|
+
|
|
127
|
+
Follow the corresponding guides for the complete examples:
|
|
128
|
+
|
|
129
|
+
- [Segmentation](./docs/segmentation.md): 2D mitochondria, 3D mitochondria, and 3D ER
|
|
130
|
+
- [Morphology Analysis](./docs/morphology-analysis.md): object and skeleton analysis of the same three datasets
|
|
131
|
+
- [Tracking](./docs/tracking.md): adjacent-frame matching, event classification, visualization, and refinement
|
|
132
|
+
- [Proximity Analysis](./docs/proximity-analysis.md): full-volume and ROI-restricted mitochondria-ER analysis
|
|
133
|
+
|
|
134
|
+
## Segmentation
|
|
135
|
+
|
|
136
|
+
The Segmentation page contains five sections.
|
|
137
|
+
|
|
138
|
+
### Data / Axes / Device
|
|
139
|
+
|
|
140
|
+
- Open the source image.
|
|
141
|
+
- Select CPU, CUDA, or MPS.
|
|
142
|
+
- Select channel and frame ranges.
|
|
143
|
+
- Review the interpreted axis layout.
|
|
144
|
+
|
|
145
|
+
### Image Info
|
|
146
|
+
|
|
147
|
+
- Review image shape, axes, and physical scale.
|
|
148
|
+
- Apply corrected pixel or voxel sizes.
|
|
149
|
+
|
|
150
|
+
### Preprocessing
|
|
151
|
+
|
|
152
|
+
- Select the raw image layer used by preprocessing.
|
|
153
|
+
- Optionally apply median filtering, Gaussian background subtraction, and XY upsampling before extraction.
|
|
154
|
+
|
|
155
|
+
### Structural Awareness Extraction
|
|
156
|
+
|
|
157
|
+
- Extract Hessian-derived vesselness, sheetness, or their voxelwise combined response.
|
|
158
|
+
- Configure kernel radius, sigma range, PSF ratio, and response rescaling.
|
|
159
|
+
- Run on the selected computational device.
|
|
160
|
+
|
|
161
|
+
### GMM-MRF Segmentation
|
|
162
|
+
|
|
163
|
+
- Select raw and structural-response layers.
|
|
164
|
+
- Configure neighborhood smoothness and structure-weighted regularization.
|
|
165
|
+
- Set the numbers of intensity-ordered foreground and background Gaussian components and the EM sampling budgets.
|
|
166
|
+
- Run segmentation and return upsampled results to the original spatial resolution.
|
|
167
|
+
|
|
168
|
+
## Morphology Analysis
|
|
169
|
+
|
|
170
|
+
Morphology Analysis labels connected objects and provides calibrated 2D or 3D measurements:
|
|
171
|
+
|
|
172
|
+
- object size and shape measurements
|
|
173
|
+
- skeleton and branch statistics
|
|
174
|
+
- endpoint and junction detection
|
|
175
|
+
- branch-length distributions and topology summaries
|
|
176
|
+
- object and branch table export
|
|
177
|
+
|
|
178
|
+
## Tracking
|
|
179
|
+
|
|
180
|
+
Tracking operates on segmented time series under an adjacent-frame, minimum-displacement assumption and provides:
|
|
181
|
+
|
|
182
|
+
- intensity-weighted point sampling and frame-to-frame matching
|
|
183
|
+
- candidate-link costs based on distance, bidirectional coverage, and matched-point support
|
|
184
|
+
- linear, fission, fusion, and split-merge event classification
|
|
185
|
+
- matched-frame, event, and unlinked-object visualization
|
|
186
|
+
- interactive link refinement with undo support
|
|
187
|
+
- event table import and export
|
|
188
|
+
|
|
189
|
+
The **Max distance** control is expressed in the pixel or voxel units shown by the interface. Spatial anisotropy from the layer scale is incorporated into matching.
|
|
190
|
+
|
|
191
|
+
## Proximity Analysis
|
|
192
|
+
|
|
193
|
+
Proximity Analysis compares source and target structures segmented independently in aligned fluorescence channels. It provides:
|
|
194
|
+
|
|
195
|
+
- overlap and union measurements
|
|
196
|
+
- Dice and Jaccard coefficients
|
|
197
|
+
- Manders M1 and M2 coefficients
|
|
198
|
+
- surface and nearest-distance measurements
|
|
199
|
+
- full-image and polygon-ROI analysis
|
|
200
|
+
- summary table export
|
|
201
|
+
|
|
202
|
+
These measurements describe spatial association at the image resolution. They do not estimate physical membrane separation or, by themselves, establish molecular contact.
|
|
203
|
+
|
|
204
|
+
## Build validation
|
|
205
|
+
|
|
206
|
+
Build and validate the distribution locally:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
python -m pip install --upgrade build twine
|
|
210
|
+
python -m build
|
|
211
|
+
python -m twine check dist/*
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Release process
|
|
215
|
+
|
|
216
|
+
SIGMA is published as **`napari-sigma`**. The GitHub workflow uses PyPI Trusted Publishing; no long-lived PyPI API token is stored in the repository.
|
|
217
|
+
|
|
218
|
+
1. Update `src/napari_sigma/_version.py`.
|
|
219
|
+
2. Run the build validation commands above.
|
|
220
|
+
3. Commit the release changes.
|
|
221
|
+
4. Create and push a matching version tag, for example:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
git tag v0.0.1
|
|
225
|
+
git push origin v0.0.1
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The tag triggers distribution validation and publishes the built package to PyPI. The PyPI Trusted Publisher must be configured for this repository, the `test_and_deploy.yml` workflow, and the `pypi` environment.
|
|
229
|
+
|
|
230
|
+
## Runtime dependencies
|
|
231
|
+
|
|
232
|
+
Core runtime dependencies include napari, PyTorch, NumPy, SciPy, scikit-image, scikit-learn, OpenCV, tifffile, Pillow, matplotlib, dask, QtPy, and openpyxl. See [`pyproject.toml`](./pyproject.toml) for the authoritative version requirements.
|
|
233
|
+
|
|
234
|
+
## License
|
|
235
|
+
|
|
236
|
+
SIGMA is distributed under the [MIT License](./LICENSE).
|
|
237
|
+
|
|
238
|
+
## Issues
|
|
239
|
+
|
|
240
|
+
When reporting a problem, include:
|
|
241
|
+
|
|
242
|
+
- operating system and hardware
|
|
243
|
+
- Python, napari, Qt, and SIGMA versions
|
|
244
|
+
- computational device (`cpu`, `cuda`, or `mps`)
|
|
245
|
+
- input shape and axis interpretation
|
|
246
|
+
- traceback or warning output
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# SIGMA (Structurally-aware Intensity-ordered GMM-MRF Algorithm)
|
|
2
|
+
|
|
3
|
+
[](./LICENSE)
|
|
4
|
+
[](https://pypi.org/project/napari-sigma/)
|
|
5
|
+
[](https://pypi.org/project/napari-sigma/)
|
|
6
|
+
[](https://napari-hub.org/plugins/napari-sigma)
|
|
7
|
+
[](https://napari.org/stable/plugins/index.html)
|
|
8
|
+
|
|
9
|
+
SIGMA is an annotation-free, image-adaptive napari framework for fluorescence image analysis. It combines an image-specific Gaussian mixture model (GMM) with intensity-ordered class assignment and a Markov random field (MRF) prior guided by local structural constraints derived from Hessian analysis. By estimating model parameters from each image, SIGMA is designed to retain faint or thin fluorescent structures while limiting mergers between closely apposed objects.
|
|
10
|
+
|
|
11
|
+
Its four connected workflows quantify cellular morphology, dynamics, and spatial organization:
|
|
12
|
+
|
|
13
|
+
- **Segmentation**: image-specific GMM-MRF segmentation guided by tubular or sheet-like structural responses
|
|
14
|
+
- **Morphology Analysis**: object geometry, skeleton branches, endpoints, junctions, and network topology
|
|
15
|
+
- **Tracking**: adjacent-frame object matching, remodeling-event classification, visualization, and link refinement
|
|
16
|
+
- **Proximity Analysis**: image-resolution overlap, distance, Manders coefficients, and ROI-restricted spatial association
|
|
17
|
+
|
|
18
|
+
SIGMA supports 2D, 3D, and time-series data and can run on CPU, CUDA, or Apple MPS when available.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Create a clean environment and install the published napari plugin:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
conda create -n sigma python=3.11
|
|
26
|
+
conda activate sigma
|
|
27
|
+
pip install --upgrade "napari-sigma[all]"
|
|
28
|
+
napari
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then select **SIGMA** from napari's **Plugins** menu.
|
|
32
|
+
|
|
33
|
+
### Development installation
|
|
34
|
+
|
|
35
|
+
From the repository root:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
conda create -n sigma-dev python=3.11
|
|
39
|
+
conda activate sigma-dev
|
|
40
|
+
pip install -e ".[all]"
|
|
41
|
+
napari
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Input data
|
|
45
|
+
|
|
46
|
+
The napari reader currently supports:
|
|
47
|
+
|
|
48
|
+
- TIFF: `.tif`, `.tiff`
|
|
49
|
+
- PNG: `.png`
|
|
50
|
+
- JPEG: `.jpg`, `.jpeg`
|
|
51
|
+
|
|
52
|
+
Microscope container formats such as CZI, ND2, LIF, and LSM should first be exported to one of the supported formats.
|
|
53
|
+
|
|
54
|
+
SIGMA preserves available physical-size and axis metadata. If physical size metadata is unavailable, pixel or voxel size defaults to `1.0`.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
1. Open a microscopy image in napari.
|
|
59
|
+
2. Open **SIGMA** from the **Plugins** menu.
|
|
60
|
+
3. Use **Segmentation** to extract local structural evidence and infer a binary foreground mask.
|
|
61
|
+
4. Use **Morphology Analysis** to measure connected structures and their skeleton topology.
|
|
62
|
+
5. Use **Tracking** to associate objects across adjacent frames and classify linear, fission, fusion, or split-merge transitions.
|
|
63
|
+
6. Use **Proximity Analysis** to quantify the spatial association between structures segmented in separate fluorescence channels.
|
|
64
|
+
|
|
65
|
+
## Documentation
|
|
66
|
+
|
|
67
|
+
- [Getting started](./docs/getting-started.md)
|
|
68
|
+
- [Segmentation](./docs/segmentation.md)
|
|
69
|
+
- [Morphology Analysis](./docs/morphology-analysis.md)
|
|
70
|
+
- [Tracking](./docs/tracking.md)
|
|
71
|
+
- [Proximity Analysis](./docs/proximity-analysis.md)
|
|
72
|
+
|
|
73
|
+
## Example data
|
|
74
|
+
|
|
75
|
+
The repository includes example fluorescence data for every documented workflow. Segmentation and morphology use the same raw images; tracking and proximity analysis also include aligned segmentation inputs so those workflows can be run directly.
|
|
76
|
+
|
|
77
|
+
- **2D segmentation and morphology:** [`2d_example_raw.tif`](./example/2d/2d_example_raw.tif)
|
|
78
|
+
- **3D mitochondrial segmentation and morphology:** [`3d_example_Mitochondria.tif`](./example/3d/3d_example_Mitochondria.tif)
|
|
79
|
+
- **3D ER segmentation and morphology:** [`3d_example_ER.tif`](./example/3d/3d_example_ER.tif)
|
|
80
|
+
- **Tracking:** [`tracking_example.tif`](./example/Tracking/tracking_example.tif) and [`tracking_example_segmentation.tif`](./example/Tracking/tracking_example_segmentation.tif)
|
|
81
|
+
- **Mitochondria-ER proximity assay:** [`mitochondria raw`](./example/Proximity_analysis/proximity_assay_example_mito.tif), [`mitochondria segmentation`](./example/Proximity_analysis/proximity_assay_example_mito_segmentation.tif), [`ER raw`](./example/Proximity_analysis/proximity_assay_example_ER.tif), and [`ER segmentation`](./example/Proximity_analysis/proximity_assay_example_ER_segmentation.tif)
|
|
82
|
+
|
|
83
|
+
Use TIFF for workflows that depend on axis metadata or physical pixel and voxel sizes. Files used together must have matching spatial dimensions, time axes, physical scales, and, for proximity analysis, spatial alignment.
|
|
84
|
+
|
|
85
|
+
Follow the corresponding guides for the complete examples:
|
|
86
|
+
|
|
87
|
+
- [Segmentation](./docs/segmentation.md): 2D mitochondria, 3D mitochondria, and 3D ER
|
|
88
|
+
- [Morphology Analysis](./docs/morphology-analysis.md): object and skeleton analysis of the same three datasets
|
|
89
|
+
- [Tracking](./docs/tracking.md): adjacent-frame matching, event classification, visualization, and refinement
|
|
90
|
+
- [Proximity Analysis](./docs/proximity-analysis.md): full-volume and ROI-restricted mitochondria-ER analysis
|
|
91
|
+
|
|
92
|
+
## Segmentation
|
|
93
|
+
|
|
94
|
+
The Segmentation page contains five sections.
|
|
95
|
+
|
|
96
|
+
### Data / Axes / Device
|
|
97
|
+
|
|
98
|
+
- Open the source image.
|
|
99
|
+
- Select CPU, CUDA, or MPS.
|
|
100
|
+
- Select channel and frame ranges.
|
|
101
|
+
- Review the interpreted axis layout.
|
|
102
|
+
|
|
103
|
+
### Image Info
|
|
104
|
+
|
|
105
|
+
- Review image shape, axes, and physical scale.
|
|
106
|
+
- Apply corrected pixel or voxel sizes.
|
|
107
|
+
|
|
108
|
+
### Preprocessing
|
|
109
|
+
|
|
110
|
+
- Select the raw image layer used by preprocessing.
|
|
111
|
+
- Optionally apply median filtering, Gaussian background subtraction, and XY upsampling before extraction.
|
|
112
|
+
|
|
113
|
+
### Structural Awareness Extraction
|
|
114
|
+
|
|
115
|
+
- Extract Hessian-derived vesselness, sheetness, or their voxelwise combined response.
|
|
116
|
+
- Configure kernel radius, sigma range, PSF ratio, and response rescaling.
|
|
117
|
+
- Run on the selected computational device.
|
|
118
|
+
|
|
119
|
+
### GMM-MRF Segmentation
|
|
120
|
+
|
|
121
|
+
- Select raw and structural-response layers.
|
|
122
|
+
- Configure neighborhood smoothness and structure-weighted regularization.
|
|
123
|
+
- Set the numbers of intensity-ordered foreground and background Gaussian components and the EM sampling budgets.
|
|
124
|
+
- Run segmentation and return upsampled results to the original spatial resolution.
|
|
125
|
+
|
|
126
|
+
## Morphology Analysis
|
|
127
|
+
|
|
128
|
+
Morphology Analysis labels connected objects and provides calibrated 2D or 3D measurements:
|
|
129
|
+
|
|
130
|
+
- object size and shape measurements
|
|
131
|
+
- skeleton and branch statistics
|
|
132
|
+
- endpoint and junction detection
|
|
133
|
+
- branch-length distributions and topology summaries
|
|
134
|
+
- object and branch table export
|
|
135
|
+
|
|
136
|
+
## Tracking
|
|
137
|
+
|
|
138
|
+
Tracking operates on segmented time series under an adjacent-frame, minimum-displacement assumption and provides:
|
|
139
|
+
|
|
140
|
+
- intensity-weighted point sampling and frame-to-frame matching
|
|
141
|
+
- candidate-link costs based on distance, bidirectional coverage, and matched-point support
|
|
142
|
+
- linear, fission, fusion, and split-merge event classification
|
|
143
|
+
- matched-frame, event, and unlinked-object visualization
|
|
144
|
+
- interactive link refinement with undo support
|
|
145
|
+
- event table import and export
|
|
146
|
+
|
|
147
|
+
The **Max distance** control is expressed in the pixel or voxel units shown by the interface. Spatial anisotropy from the layer scale is incorporated into matching.
|
|
148
|
+
|
|
149
|
+
## Proximity Analysis
|
|
150
|
+
|
|
151
|
+
Proximity Analysis compares source and target structures segmented independently in aligned fluorescence channels. It provides:
|
|
152
|
+
|
|
153
|
+
- overlap and union measurements
|
|
154
|
+
- Dice and Jaccard coefficients
|
|
155
|
+
- Manders M1 and M2 coefficients
|
|
156
|
+
- surface and nearest-distance measurements
|
|
157
|
+
- full-image and polygon-ROI analysis
|
|
158
|
+
- summary table export
|
|
159
|
+
|
|
160
|
+
These measurements describe spatial association at the image resolution. They do not estimate physical membrane separation or, by themselves, establish molecular contact.
|
|
161
|
+
|
|
162
|
+
## Build validation
|
|
163
|
+
|
|
164
|
+
Build and validate the distribution locally:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
python -m pip install --upgrade build twine
|
|
168
|
+
python -m build
|
|
169
|
+
python -m twine check dist/*
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Release process
|
|
173
|
+
|
|
174
|
+
SIGMA is published as **`napari-sigma`**. The GitHub workflow uses PyPI Trusted Publishing; no long-lived PyPI API token is stored in the repository.
|
|
175
|
+
|
|
176
|
+
1. Update `src/napari_sigma/_version.py`.
|
|
177
|
+
2. Run the build validation commands above.
|
|
178
|
+
3. Commit the release changes.
|
|
179
|
+
4. Create and push a matching version tag, for example:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
git tag v0.0.1
|
|
183
|
+
git push origin v0.0.1
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The tag triggers distribution validation and publishes the built package to PyPI. The PyPI Trusted Publisher must be configured for this repository, the `test_and_deploy.yml` workflow, and the `pypi` environment.
|
|
187
|
+
|
|
188
|
+
## Runtime dependencies
|
|
189
|
+
|
|
190
|
+
Core runtime dependencies include napari, PyTorch, NumPy, SciPy, scikit-image, scikit-learn, OpenCV, tifffile, Pillow, matplotlib, dask, QtPy, and openpyxl. See [`pyproject.toml`](./pyproject.toml) for the authoritative version requirements.
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
SIGMA is distributed under the [MIT License](./LICENSE).
|
|
195
|
+
|
|
196
|
+
## Issues
|
|
197
|
+
|
|
198
|
+
When reporting a problem, include:
|
|
199
|
+
|
|
200
|
+
- operating system and hardware
|
|
201
|
+
- Python, napari, Qt, and SIGMA versions
|
|
202
|
+
- computational device (`cpu`, `cuda`, or `mps`)
|
|
203
|
+
- input shape and axis interpretation
|
|
204
|
+
- traceback or warning output
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
This guide covers the shortest path from a fluorescence image to an annotation-free SIGMA analysis. SIGMA estimates segmentation parameters from the selected image and uses local structural evidence to support faint tubular or sheet-like signal.
|
|
4
|
+
|
|
5
|
+
## 1. Install and open SIGMA
|
|
6
|
+
|
|
7
|
+
Create a clean environment and install the plugin:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
conda create -n sigma python=3.11
|
|
11
|
+
conda activate sigma
|
|
12
|
+
pip install --upgrade "napari-sigma[all]"
|
|
13
|
+
napari
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
In napari, open **Plugins > SIGMA**.
|
|
17
|
+
|
|
18
|
+
## 2. Open an image
|
|
19
|
+
|
|
20
|
+
SIGMA reads TIFF, PNG, and JPEG files. TIFF is recommended for microscopy data because it can preserve axes and physical pixel or voxel sizes.
|
|
21
|
+
|
|
22
|
+
Use **Open File** in the Segmentation tab. Spatial 3D images open in napari's 3D display mode by default; 2D time series remain in 2D. Confirm the interpreted channel, time, and slice ranges before processing. If the physical size is missing or incorrect, update it under **Image Info** before running an analysis that reports physical measurements.
|
|
23
|
+
|
|
24
|
+
Supported image organizations include:
|
|
25
|
+
|
|
26
|
+
- 2D images: `YX`
|
|
27
|
+
- 3D volumes: `ZYX`
|
|
28
|
+
- 2D time series: `TYX`
|
|
29
|
+
- 3D time series: `TZYX`
|
|
30
|
+
|
|
31
|
+
## 3. Select a device
|
|
32
|
+
|
|
33
|
+
- **CPU** works on every supported computer.
|
|
34
|
+
- **CUDA** uses a compatible NVIDIA GPU.
|
|
35
|
+
- **MPS** uses Apple Silicon GPU acceleration.
|
|
36
|
+
|
|
37
|
+
Device selection applies to supported denoising, structural extraction, and segmentation operations. Results are returned to napari as regular layers regardless of the selected device.
|
|
38
|
+
|
|
39
|
+
## 4. Follow a workflow
|
|
40
|
+
|
|
41
|
+
The usual order is:
|
|
42
|
+
|
|
43
|
+
1. [Segment the image](./segmentation.md).
|
|
44
|
+
2. [Measure morphology](./morphology-analysis.md).
|
|
45
|
+
3. For time series, [associate objects between adjacent frames and classify remodeling events](./tracking.md).
|
|
46
|
+
4. To compare structures segmented in aligned fluorescence channels, run [Proximity Analysis](./proximity-analysis.md).
|
|
47
|
+
|
|
48
|
+
Each page operates on napari layers. Check the selected layer before running a command, especially when several raw, processed, and segmentation layers are open.
|
|
49
|
+
|
|
50
|
+
## 5. Try the examples
|
|
51
|
+
|
|
52
|
+
The repository [indexes every example dataset on its front page](../README.md#example-data). Select a raw image or aligned input set there, then follow the linked workflow guide.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|