sprout-seg 1.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.
Files changed (51) hide show
  1. sprout_seg-1.1.0/LICENSE +21 -0
  2. sprout_seg-1.1.0/PKG-INFO +75 -0
  3. sprout_seg-1.1.0/docs/pypi_sprout_seg.md +38 -0
  4. sprout_seg-1.1.0/pyproject.toml +52 -0
  5. sprout_seg-1.1.0/setup.cfg +4 -0
  6. sprout_seg-1.1.0/sprout_core/__init__.py +3 -0
  7. sprout_seg-1.1.0/sprout_core/adaptive_seed_combine.py +945 -0
  8. sprout_seg-1.1.0/sprout_core/batch_grow.py +99 -0
  9. sprout_seg-1.1.0/sprout_core/batch_nninteractive.py +97 -0
  10. sprout_seg-1.1.0/sprout_core/batch_sam.py +69 -0
  11. sprout_seg-1.1.0/sprout_core/batch_seeds.py +248 -0
  12. sprout_seg-1.1.0/sprout_core/boundary.py +386 -0
  13. sprout_seg-1.1.0/sprout_core/cli.py +145 -0
  14. sprout_seg-1.1.0/sprout_core/config_core.py +1965 -0
  15. sprout_seg-1.1.0/sprout_core/img_process.py +231 -0
  16. sprout_seg-1.1.0/sprout_core/make_adaptive_seed.py +1114 -0
  17. sprout_seg-1.1.0/sprout_core/make_grow.py +656 -0
  18. sprout_seg-1.1.0/sprout_core/make_mesh.py +432 -0
  19. sprout_seg-1.1.0/sprout_core/make_seeds.py +456 -0
  20. sprout_seg-1.1.0/sprout_core/make_sweep_adaptive_seed.py +469 -0
  21. sprout_seg-1.1.0/sprout_core/nni_engine.py +434 -0
  22. sprout_seg-1.1.0/sprout_core/nni_prob_session.py +200 -0
  23. sprout_seg-1.1.0/sprout_core/nninteractive_predict.py +870 -0
  24. sprout_seg-1.1.0/sprout_core/prompt_engine.py +129 -0
  25. sprout_seg-1.1.0/sprout_core/prompt_points.py +595 -0
  26. sprout_seg-1.1.0/sprout_core/prompt_seg.py +590 -0
  27. sprout_seg-1.1.0/sprout_core/roi.py +600 -0
  28. sprout_seg-1.1.0/sprout_core/sam_predict.py +219 -0
  29. sprout_seg-1.1.0/sprout_core/seed_roi.py +172 -0
  30. sprout_seg-1.1.0/sprout_core/seed_sweep.py +410 -0
  31. sprout_seg-1.1.0/sprout_core/sprout_core.py +1363 -0
  32. sprout_seg-1.1.0/sprout_core/sprout_prompt_core.py +1469 -0
  33. sprout_seg-1.1.0/sprout_core/stat_plot.py +0 -0
  34. sprout_seg-1.1.0/sprout_core/vis_lib.py +200 -0
  35. sprout_seg-1.1.0/sprout_seg.egg-info/PKG-INFO +75 -0
  36. sprout_seg-1.1.0/sprout_seg.egg-info/SOURCES.txt +49 -0
  37. sprout_seg-1.1.0/sprout_seg.egg-info/dependency_links.txt +1 -0
  38. sprout_seg-1.1.0/sprout_seg.egg-info/entry_points.txt +2 -0
  39. sprout_seg-1.1.0/sprout_seg.egg-info/requires.txt +20 -0
  40. sprout_seg-1.1.0/sprout_seg.egg-info/top_level.txt +1 -0
  41. sprout_seg-1.1.0/tests/test_adaptive_seed_history.py +99 -0
  42. sprout_seg-1.1.0/tests/test_batch.py +65 -0
  43. sprout_seg-1.1.0/tests/test_checks.py +184 -0
  44. sprout_seg-1.1.0/tests/test_float_images.py +145 -0
  45. sprout_seg-1.1.0/tests/test_known_bugs.py +236 -0
  46. sprout_seg-1.1.0/tests/test_label_helpers.py +61 -0
  47. sprout_seg-1.1.0/tests/test_morphology.py +77 -0
  48. sprout_seg-1.1.0/tests/test_nn_merge.py +50 -0
  49. sprout_seg-1.1.0/tests/test_packaging.py +95 -0
  50. sprout_seg-1.1.0/tests/test_sweep.py +542 -0
  51. sprout_seg-1.1.0/tests/test_sweep_tab.py +36 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Yichen He
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,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: sprout-seg
3
+ Version: 1.1.0
4
+ Summary: SPROUT: semi-automated parcellation of 2D and 3D greyscale images into parts, by thresholds, erosion and growing
5
+ Author: Yichen He
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/EchanHe/SPROUT
8
+ Project-URL: Documentation, https://github.com/EchanHe/SPROUT#readme
9
+ Project-URL: Issues, https://github.com/EchanHe/SPROUT/issues
10
+ Project-URL: Changelog, https://github.com/EchanHe/SPROUT/blob/main/CHANGELOG.md
11
+ Keywords: segmentation,image analysis,micro-CT,CT,MRI,3D,multi-class,seeds,region growing
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy>=1.26
20
+ Requires-Dist: scipy>=1.15
21
+ Requires-Dist: scikit-image>=0.22
22
+ Requires-Dist: pandas>=2.2
23
+ Requires-Dist: tifffile>=2024.2.12
24
+ Requires-Dist: imagecodecs>=2025.3.30
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: psutil>=5.9
27
+ Requires-Dist: pillow>=10
28
+ Provides-Extra: mesh
29
+ Requires-Dist: trimesh>=4.3; extra == "mesh"
30
+ Requires-Dist: matplotlib>=3.8; extra == "mesh"
31
+ Provides-Extra: ai
32
+ Requires-Dist: nninteractive>=1.1.3; extra == "ai"
33
+ Requires-Dist: scikit-learn; extra == "ai"
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest; extra == "test"
36
+ Dynamic: license-file
37
+
38
+ # sprout-seg
39
+
40
+ The core and command line of [SPROUT](https://github.com/EchanHe/SPROUT): multi-part segmentation of 2D and 3D greyscale images (e.g. CT, MRI) without training data. For the napari plugin, see [napari-sprout](https://pypi.org/project/napari-sprout/).
41
+
42
+ - **Seeds**: thresholds and erosion split an image into parts; adaptive and sweep modes combine several settings.
43
+ - **Grow**: seeds grow back to the full shape of each part.
44
+ - **Prompts**: seeds as prompts for nnInteractive or SAM.
45
+ - **Batch**: many images from one CSV. Runs on CPU.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install sprout-seg # command line only (e.g. on a cluster)
51
+ pip install "napari-sprout[all]" # with the napari plugin, napari and Qt
52
+ ```
53
+
54
+ Extras: `sprout-seg[ai]` (nnInteractive; with an NVIDIA GPU, install PyTorch for your CUDA version first), `sprout-seg[mesh]` (meshes).
55
+
56
+ ## Use
57
+
58
+ Every step is a YAML config ([templates](https://github.com/EchanHe/SPROUT/tree/main/template)):
59
+
60
+ ```bash
61
+ sprout --seeds --config make_seeds.yaml
62
+ sprout --sweep_adaptive --config sweep_adaptive_seed.yaml
63
+ sprout --adaptive_seed --config make_adaptive_seed.yaml
64
+ sprout --grow --config make_grow.yaml
65
+ sprout --seeds --batch --config batch_seeds.yaml
66
+ sprout --help
67
+ ```
68
+
69
+ Docs, demo data and videos: [github.com/EchanHe/SPROUT](https://github.com/EchanHe/SPROUT).
70
+
71
+ ## Cite
72
+
73
+ Y. He, M. Camaiti, L.E. Roberts, J.M. Mulqueeney, E. Ioannou, M. Didziokas, A. Goswami. *SPROUT: A User-friendly, Scalable Toolkit for Multi-class Segmentation of Volumetric Images.* [bioRxiv 2024](https://www.biorxiv.org/content/10.1101/2024.11.22.624847v2.abstract).
74
+
75
+ MIT License.
@@ -0,0 +1,38 @@
1
+ # sprout-seg
2
+
3
+ The core and command line of [SPROUT](https://github.com/EchanHe/SPROUT): multi-part segmentation of 2D and 3D greyscale images (e.g. CT, MRI) without training data. For the napari plugin, see [napari-sprout](https://pypi.org/project/napari-sprout/).
4
+
5
+ - **Seeds**: thresholds and erosion split an image into parts; adaptive and sweep modes combine several settings.
6
+ - **Grow**: seeds grow back to the full shape of each part.
7
+ - **Prompts**: seeds as prompts for nnInteractive or SAM.
8
+ - **Batch**: many images from one CSV. Runs on CPU.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pip install sprout-seg # command line only (e.g. on a cluster)
14
+ pip install "napari-sprout[all]" # with the napari plugin, napari and Qt
15
+ ```
16
+
17
+ Extras: `sprout-seg[ai]` (nnInteractive; with an NVIDIA GPU, install PyTorch for your CUDA version first), `sprout-seg[mesh]` (meshes).
18
+
19
+ ## Use
20
+
21
+ Every step is a YAML config ([templates](https://github.com/EchanHe/SPROUT/tree/main/template)):
22
+
23
+ ```bash
24
+ sprout --seeds --config make_seeds.yaml
25
+ sprout --sweep_adaptive --config sweep_adaptive_seed.yaml
26
+ sprout --adaptive_seed --config make_adaptive_seed.yaml
27
+ sprout --grow --config make_grow.yaml
28
+ sprout --seeds --batch --config batch_seeds.yaml
29
+ sprout --help
30
+ ```
31
+
32
+ Docs, demo data and videos: [github.com/EchanHe/SPROUT](https://github.com/EchanHe/SPROUT).
33
+
34
+ ## Cite
35
+
36
+ Y. He, M. Camaiti, L.E. Roberts, J.M. Mulqueeney, E. Ioannou, M. Didziokas, A. Goswami. *SPROUT: A User-friendly, Scalable Toolkit for Multi-class Segmentation of Volumetric Images.* [bioRxiv 2024](https://www.biorxiv.org/content/10.1101/2024.11.22.624847v2.abstract).
37
+
38
+ MIT License.
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sprout-seg"
7
+ dynamic = ["version"]
8
+ description = "SPROUT: semi-automated parcellation of 2D and 3D greyscale images into parts, by thresholds, erosion and growing"
9
+ readme = { file = "docs/pypi_sprout_seg.md", content-type = "text/markdown" } # the PyPI page (README.MD has relative links)
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "Yichen He" }]
13
+ keywords = ["segmentation", "image analysis", "micro-CT", "CT", "MRI", "3D", "multi-class", "seeds", "region growing"]
14
+ requires-python = ">=3.10"
15
+ # Lower bounds are the versions the CI tests (requirements-ci.txt); the "latest" CI job tests the newest.
16
+ dependencies = [
17
+ "numpy>=1.26",
18
+ "scipy>=1.15",
19
+ "scikit-image>=0.22",
20
+ "pandas>=2.2",
21
+ "tifffile>=2024.2.12",
22
+ "imagecodecs>=2025.3.30",
23
+ "pyyaml>=6.0",
24
+ "psutil>=5.9",
25
+ "pillow>=10",
26
+ ]
27
+ classifiers = [
28
+ "Programming Language :: Python :: 3",
29
+ "Operating System :: OS Independent",
30
+ "Intended Audience :: Science/Research",
31
+ "Topic :: Scientific/Engineering :: Image Processing",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ mesh = ["trimesh>=4.3", "matplotlib>=3.8"]
36
+ ai = ["nninteractive>=1.1.3", "scikit-learn"]
37
+ test = ["pytest"]
38
+
39
+ [project.scripts]
40
+ sprout = "sprout_core.cli:main"
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/EchanHe/SPROUT"
44
+ Documentation = "https://github.com/EchanHe/SPROUT#readme"
45
+ Issues = "https://github.com/EchanHe/SPROUT/issues"
46
+ Changelog = "https://github.com/EchanHe/SPROUT/blob/main/CHANGELOG.md"
47
+
48
+ [tool.setuptools.packages.find]
49
+ include = ["sprout_core*"]
50
+
51
+ [tool.setuptools.dynamic]
52
+ version = { attr = "sprout_core.__version__" }
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ # sprout_core package initialization
2
+
3
+ __version__ = "1.1.0"