numorph-3dunet 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.
Files changed (45) hide show
  1. numorph_3dunet-0.1.0/LICENSE +21 -0
  2. numorph_3dunet-0.1.0/PKG-INFO +135 -0
  3. numorph_3dunet-0.1.0/README.md +58 -0
  4. numorph_3dunet-0.1.0/pyproject.toml +85 -0
  5. numorph_3dunet-0.1.0/setup.cfg +4 -0
  6. numorph_3dunet-0.1.0/setup.py +27 -0
  7. numorph_3dunet-0.1.0/src/numorph_3dunet/__init__.py +9 -0
  8. numorph_3dunet-0.1.0/src/numorph_3dunet/cli.py +17 -0
  9. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/__init__.py +0 -0
  10. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/generate_chunks.py +509 -0
  11. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/generate_chunks2.py +258 -0
  12. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/img_utils.py +247 -0
  13. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/predict.py +21 -0
  14. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/predict_validation.py +113 -0
  15. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/preprocess.py +163 -0
  16. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/read_params.py +72 -0
  17. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/reannotate_centroids.py +45 -0
  18. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/remeasure_centroids.py +42 -0
  19. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/train_isensee2017.py +122 -0
  20. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/train_isensee2017_2.py +122 -0
  21. numorph_3dunet-0.1.0/src/numorph_3dunet/nuclei/train_isensee2017_3.py +122 -0
  22. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/__init__.py +0 -0
  23. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/augment.py +261 -0
  24. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/data.py +76 -0
  25. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/generator.py +273 -0
  26. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/generator2.py +57 -0
  27. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/metrics.py +68 -0
  28. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/normalize.py +85 -0
  29. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/predict_ok.py +43 -0
  30. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/prediction.py +174 -0
  31. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/prediction2.py +174 -0
  32. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/train_isensee2017.py +119 -0
  33. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/training.py +92 -0
  34. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/__init__.py +2 -0
  35. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/nilearn_custom_utils/__init__.py +0 -0
  36. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/nilearn_custom_utils/nilearn_utils.py +52 -0
  37. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/patches.py +113 -0
  38. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/sitk_utils.py +68 -0
  39. numorph_3dunet-0.1.0/src/numorph_3dunet/unet3d/utils/utils.py +80 -0
  40. numorph_3dunet-0.1.0/src/numorph_3dunet/version.py +26 -0
  41. numorph_3dunet-0.1.0/src/numorph_3dunet.egg-info/PKG-INFO +135 -0
  42. numorph_3dunet-0.1.0/src/numorph_3dunet.egg-info/SOURCES.txt +43 -0
  43. numorph_3dunet-0.1.0/src/numorph_3dunet.egg-info/dependency_links.txt +1 -0
  44. numorph_3dunet-0.1.0/src/numorph_3dunet.egg-info/requires.txt +51 -0
  45. numorph_3dunet-0.1.0/src/numorph_3dunet.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Carolin Schwitalla
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,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: numorph-3dunet
3
+ Version: 0.1.0
4
+ Summary: Numorph segmentation of cell nuclei using a 3dunet.
5
+ Home-page: https://github.com/qbic-pipelines/numorph_3dunet
6
+ Author: Carolin Schwitalla
7
+ Author-email: Carolin Schwitalla <carolin.schwitalla@uni-tuebingen.de>
8
+ Maintainer-email: Carolin Schwitalla <carolin.schwitalla@uni-tuebingen.de>
9
+ License-Expression: MIT
10
+ Project-URL: Homepage, https://github.com/qbic-pipelines/numorph_3dunet
11
+ Project-URL: Documentation, https://github.com/qbic-pipelines/numorph_3dunet
12
+ Project-URL: Repository, https://github.com/qbic-pipelines/numorph_3dunet
13
+ Project-URL: Issues, https://github.com/qbic-pipelines/numorph_3dunet/issues
14
+ Keywords: 3dunet,segmentation,microscopy,lightsheet
15
+ Classifier: Development Status :: 2 - Pre-Alpha
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
18
+ Classifier: Programming Language :: Python :: 3.6
19
+ Requires-Python: >=3.6
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: cloudpickle==1.5.0
23
+ Requires-Dist: cycler==0.10.0
24
+ Requires-Dist: cytoolz==0.10.1
25
+ Requires-Dist: dask-core==2.24.0
26
+ Requires-Dist: decorator==4.4.2
27
+ Requires-Dist: kiwisolver==1.2.0
28
+ Requires-Dist: networkx==2.5
29
+ Requires-Dist: olefile==0.46
30
+ Requires-Dist: pillow==7.2.0
31
+ Requires-Dist: pyparsing==2.4.7
32
+ Requires-Dist: python==3.6.10
33
+ Requires-Dist: python-dateutil
34
+ Requires-Dist: pyyaml==5.3.1
35
+ Requires-Dist: readline==8.0
36
+ Requires-Dist: six==1.15.0
37
+ Requires-Dist: sqlite==3.33.0
38
+ Requires-Dist: toolz==0.10.0
39
+ Requires-Dist: tornado==6.0.4
40
+ Requires-Dist: absl-py==0.10.0
41
+ Requires-Dist: astor==0.8.1
42
+ Requires-Dist: connected-components-3d==1.8.0
43
+ Requires-Dist: gast==0.4.0
44
+ Requires-Dist: grpcio==1.31.0
45
+ Requires-Dist: h5py==2.10.0
46
+ Requires-Dist: imageio==2.9.0
47
+ Requires-Dist: importlib-metadata==1.7.0
48
+ Requires-Dist: joblib==0.16.0
49
+ Requires-Dist: keras==2.1.6
50
+ Requires-Dist: keras-applications==1.0.8
51
+ Requires-Dist: keras-preprocessing==1.1.2
52
+ Requires-Dist: markdown==3.2.2
53
+ Requires-Dist: mat73==0.46
54
+ Requires-Dist: matplotlib==3.3.1
55
+ Requires-Dist: nibabel==2.4.0
56
+ Requires-Dist: nilearn==0.6.2
57
+ Requires-Dist: numexpr==2.7.1
58
+ Requires-Dist: numpy==1.16.0
59
+ Requires-Dist: opencv-python==4.2.0.32
60
+ Requires-Dist: pydot==1.4
61
+ Requires-Dist: protobuf==3.13.0
62
+ Requires-Dist: pywavelets==1.1.1
63
+ Requires-Dist: scikit-image==0.16.2
64
+ Requires-Dist: scikit-learn==0.23.2
65
+ Requires-Dist: scipy==1.2.1
66
+ Requires-Dist: simpleitk==1.2.0
67
+ Requires-Dist: sklearn==0.0
68
+ Requires-Dist: tables==3.6.1
69
+ Requires-Dist: termcolor==1.1.0
70
+ Requires-Dist: threadpoolctl==2.1.0
71
+ Requires-Dist: werkzeug==1.0.1
72
+ Requires-Dist: zipp==3.1.0
73
+ Dynamic: author
74
+ Dynamic: home-page
75
+ Dynamic: license-file
76
+ Dynamic: requires-python
77
+
78
+ # NuMorph 3DUnet
79
+
80
+ The package performs cell nuclei segmentation on large light-sheet imaging dataset. The models that the package uses can be found [here](https://bitbucket.org/steinlabunc/numorph/downloads/) for download.
81
+
82
+ This package containes the original 3DUnet used in the NuMorph pipeline. A detailed describtion of the architecture and training procedure can be found in the [publication](https://doi.org/10.1016/j.celrep.2021.109802).
83
+
84
+
85
+ >The PyPi package is intended to be installed in a Nvidia optimized [container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorflow/tags?version=20.10-tf2-py3) with Tensorflow and used as a nextflow module in the pipeline [nf-core/lsmquant](https://github.com/nf-core/lsmquant). The container is hosted by the nf-core community repository on quay.io .
86
+
87
+ ## Installation
88
+ The package can also be used within a conda environment (not recommended).
89
+
90
+ Clone the repository to your workstation.
91
+ The `numorphunet.yml` defines the necessary dependencies for running the prediction. You need to have `conda` installed to create the environment with the following command:
92
+ ```
93
+ conda env create -f numorphunet.yml
94
+ ```
95
+ Activate the environment with:
96
+ ```
97
+ conda activate 3dunet
98
+ ```
99
+ Install the numorph 3DUnet in the `3dunet`conda env by using the following command in the directory of the `pyproject.toml` file :
100
+ ```
101
+ pip install .
102
+ ```
103
+
104
+ ## Usage
105
+
106
+ Once installed, you can run the cell segmentation tool using the command:
107
+
108
+ ```
109
+ numorph_3dunet.predict -i /path/to/input/directory -o /path/to/output/directory --n_channels 1 --sample_name TEST1 --model /path/to/model_file.h5
110
+ ```
111
+
112
+ Required arguments:
113
+ - `-i`: Input image directory
114
+ - `-o`: Output directory (will be created if it doesn't exist)
115
+ - `--n_channels`: Number of channels
116
+ - `--sample_name`: Sample name for output files
117
+ - `--model`: Model file (.h5)
118
+
119
+ Optional arguments:
120
+ - `-g`: GPU tag (default: 0)
121
+ - `--pred_threshold`: Prediction threshold (default: 0.5)
122
+ - `--int_threshold`: Minimum intensity threshold (default: 200)
123
+ - `--overlap`: Overlap between chunks [x y z] (default: 16 16 8)
124
+
125
+ See full help with `numorph_3dunet.predict --help`
126
+
127
+
128
+ # Credits
129
+
130
+ The pip package was originally developed by Carolin Schwitalla and contains the original work of Oleh Krupa who is the main developer of the 3DUnet and corresponding models used by the NuMorph toolbox.
131
+ > **NuMorph: Tools for cortical cellular phenotyping in tissue-cleared whole-brain images**
132
+ >
133
+ > Krupa O, Fragola G, Hadden-Ford E, Mory JT, Liu T, Humphrey Z, Rees BW, Krishnamurthy A, Snider WD, Zylka MJ, Wu G, Xing L, Stein JL.
134
+ >
135
+ > Cell Rep. 2021 Oct 12, doi: [10.1016/j.celrep.2021.109802](https://doi.org/10.1016%2Fj.celrep.2021.109802)
@@ -0,0 +1,58 @@
1
+ # NuMorph 3DUnet
2
+
3
+ The package performs cell nuclei segmentation on large light-sheet imaging dataset. The models that the package uses can be found [here](https://bitbucket.org/steinlabunc/numorph/downloads/) for download.
4
+
5
+ This package containes the original 3DUnet used in the NuMorph pipeline. A detailed describtion of the architecture and training procedure can be found in the [publication](https://doi.org/10.1016/j.celrep.2021.109802).
6
+
7
+
8
+ >The PyPi package is intended to be installed in a Nvidia optimized [container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorflow/tags?version=20.10-tf2-py3) with Tensorflow and used as a nextflow module in the pipeline [nf-core/lsmquant](https://github.com/nf-core/lsmquant). The container is hosted by the nf-core community repository on quay.io .
9
+
10
+ ## Installation
11
+ The package can also be used within a conda environment (not recommended).
12
+
13
+ Clone the repository to your workstation.
14
+ The `numorphunet.yml` defines the necessary dependencies for running the prediction. You need to have `conda` installed to create the environment with the following command:
15
+ ```
16
+ conda env create -f numorphunet.yml
17
+ ```
18
+ Activate the environment with:
19
+ ```
20
+ conda activate 3dunet
21
+ ```
22
+ Install the numorph 3DUnet in the `3dunet`conda env by using the following command in the directory of the `pyproject.toml` file :
23
+ ```
24
+ pip install .
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ Once installed, you can run the cell segmentation tool using the command:
30
+
31
+ ```
32
+ numorph_3dunet.predict -i /path/to/input/directory -o /path/to/output/directory --n_channels 1 --sample_name TEST1 --model /path/to/model_file.h5
33
+ ```
34
+
35
+ Required arguments:
36
+ - `-i`: Input image directory
37
+ - `-o`: Output directory (will be created if it doesn't exist)
38
+ - `--n_channels`: Number of channels
39
+ - `--sample_name`: Sample name for output files
40
+ - `--model`: Model file (.h5)
41
+
42
+ Optional arguments:
43
+ - `-g`: GPU tag (default: 0)
44
+ - `--pred_threshold`: Prediction threshold (default: 0.5)
45
+ - `--int_threshold`: Minimum intensity threshold (default: 200)
46
+ - `--overlap`: Overlap between chunks [x y z] (default: 16 16 8)
47
+
48
+ See full help with `numorph_3dunet.predict --help`
49
+
50
+
51
+ # Credits
52
+
53
+ The pip package was originally developed by Carolin Schwitalla and contains the original work of Oleh Krupa who is the main developer of the 3DUnet and corresponding models used by the NuMorph toolbox.
54
+ > **NuMorph: Tools for cortical cellular phenotyping in tissue-cleared whole-brain images**
55
+ >
56
+ > Krupa O, Fragola G, Hadden-Ford E, Mory JT, Liu T, Humphrey Z, Rees BW, Krishnamurthy A, Snider WD, Zylka MJ, Wu G, Xing L, Stein JL.
57
+ >
58
+ > Cell Rep. 2021 Oct 12, doi: [10.1016/j.celrep.2021.109802](https://doi.org/10.1016%2Fj.celrep.2021.109802)
@@ -0,0 +1,85 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 59.6.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "numorph-3dunet"
7
+ version = "0.1.0"
8
+ description = "Numorph segmentation of cell nuclei using a 3dunet."
9
+ keywords = ["3dunet", "segmentation", "microscopy", "lightsheet"]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ authors = [
13
+ {name = "Carolin Schwitalla", email = "carolin.schwitalla@uni-tuebingen.de"}
14
+ ]
15
+ maintainers = [
16
+ {name = "Carolin Schwitalla", email = "carolin.schwitalla@uni-tuebingen.de"}
17
+ ]
18
+ requires-python = ">= 3.6, <3.7"
19
+ dependencies = [
20
+ "cloudpickle==1.5.0",
21
+ "cycler==0.10.0",
22
+ "cytoolz==0.10.1",
23
+ "dask-core==2.24.0",
24
+ "decorator==4.4.2",
25
+ "kiwisolver==1.2.0",
26
+ "networkx==2.5",
27
+ "olefile==0.46",
28
+ "pillow==7.2.0",
29
+ "pyparsing==2.4.7",
30
+ "python==3.6.10",
31
+ "python-dateutil",
32
+ "pyyaml==5.3.1",
33
+ "readline==8.0",
34
+ "six==1.15.0",
35
+ "sqlite==3.33.0",
36
+ "toolz==0.10.0",
37
+ "tornado==6.0.4",
38
+ "absl-py==0.10.0",
39
+ "astor==0.8.1",
40
+ "connected-components-3d==1.8.0",
41
+ "gast==0.4.0",
42
+ "grpcio==1.31.0",
43
+ "h5py==2.10.0",
44
+ "imageio==2.9.0",
45
+ "importlib-metadata==1.7.0",
46
+ "joblib==0.16.0",
47
+ "keras==2.1.6",
48
+ "keras-applications==1.0.8",
49
+ "keras-preprocessing==1.1.2",
50
+ "markdown==3.2.2",
51
+ "mat73==0.46",
52
+ "matplotlib==3.3.1",
53
+ "nibabel==2.4.0",
54
+ "nilearn==0.6.2",
55
+ "numexpr==2.7.1",
56
+ "numpy==1.16.0",
57
+ "opencv-python==4.2.0.32",
58
+ "pydot==1.4",
59
+ "protobuf==3.13.0",
60
+ "pywavelets==1.1.1",
61
+ "scikit-image==0.16.2",
62
+ "scikit-learn==0.23.2",
63
+ "scipy==1.2.1",
64
+ "simpleitk==1.2.0",
65
+ "sklearn==0.0",
66
+ "tables==3.6.1",
67
+ "termcolor==1.1.0",
68
+ "threadpoolctl==2.1.0",
69
+ "werkzeug==1.0.1",
70
+ "zipp==3.1.0"
71
+ ]
72
+
73
+ classifiers = [
74
+ "Development Status :: 2 - Pre-Alpha",
75
+ "Intended Audience :: Science/Research",
76
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
77
+ "Programming Language :: Python :: 3.6"
78
+ ]
79
+
80
+ [project.urls]
81
+ Homepage = "https://github.com/qbic-pipelines/numorph_3dunet"
82
+ Documentation = "https://github.com/qbic-pipelines/numorph_3dunet"
83
+ Repository = "https://github.com/qbic-pipelines/numorph_3dunet"
84
+ Issues = "https://github.com/qbic-pipelines/numorph_3dunet/issues"
85
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,27 @@
1
+ from setuptools import setup, find_packages
2
+ from pathlib import Path
3
+
4
+ this_directory = Path(__file__).parent
5
+ long_description= (this_directory / "README.md").read_text()
6
+
7
+ setup(
8
+ name="numorph_3dunet",
9
+ version="0.1.0",
10
+ packages=find_packages(where="src"),
11
+ package_dir={"": "src"},
12
+ python_requires=">=3.6",
13
+ author="Carolin Schwitalla",
14
+ author_email="carolin.schwitalla@uni-tuebingen.de",
15
+ description="Numorph segmentation of cell nuclei using a 3dunet.",
16
+ this_directory = Path(__file__).parent,
17
+ long_description=long_description,
18
+ long_description_content_type='text/markdown',
19
+ license="MIT",
20
+ keywords=["3dunet", "segmentation", "microscopy", "lightsheet"],
21
+ url="https://github.com/qbic-pipelines/numorph_3dunet",
22
+ entry_points={
23
+ 'console_scripts': [
24
+ 'numorph_3dunet.predict=numorph_3dunet.cli:predict',
25
+ ],
26
+ },
27
+ )
@@ -0,0 +1,9 @@
1
+ from .version import __version__, VERSION_STRING
2
+
3
+ def get_version():
4
+ """Return the package version."""
5
+ return __version__
6
+
7
+ def show_version():
8
+ """Print full version info."""
9
+ print(VERSION_STRING)
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Command-line interface for NuMorph 3DUnet.
4
+ """
5
+
6
+ from numorph_3dunet.nuclei.generate_chunks import main
7
+
8
+ def predict():
9
+ """
10
+ Entry point for the prediction command.
11
+ This function is called when running `numorph_3dunet.predict`
12
+ """
13
+ # Call the main function from generate_chunks
14
+ main()
15
+
16
+ if __name__ == "__main__":
17
+ predict()