napari-bootstrapper 0.1.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.
Files changed (42) hide show
  1. napari_bootstrapper-0.1.1/LICENSE +28 -0
  2. napari_bootstrapper-0.1.1/MANIFEST.in +5 -0
  3. napari_bootstrapper-0.1.1/PKG-INFO +175 -0
  4. napari_bootstrapper-0.1.1/README.md +102 -0
  5. napari_bootstrapper-0.1.1/pyproject.toml +122 -0
  6. napari_bootstrapper-0.1.1/setup.cfg +4 -0
  7. napari_bootstrapper-0.1.1/src/napari_bootstrapper/__init__.py +11 -0
  8. napari_bootstrapper-0.1.1/src/napari_bootstrapper/_sample_data.py +42 -0
  9. napari_bootstrapper-0.1.1/src/napari_bootstrapper/_widget.py +1831 -0
  10. napari_bootstrapper-0.1.1/src/napari_bootstrapper/datasets/__init__.py +0 -0
  11. napari_bootstrapper-0.1.1/src/napari_bootstrapper/datasets/napari_2d_dataset.py +232 -0
  12. napari_bootstrapper-0.1.1/src/napari_bootstrapper/datasets/napari_3d_dataset.py +189 -0
  13. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/add_2d_lsds.py +136 -0
  14. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/add_obfuscated_2d_lsds.py +63 -0
  15. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/calc_max_padding.py +32 -0
  16. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/create_labels.py +161 -0
  17. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/custom_grow_boundary.py +114 -0
  18. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/custom_intensity_augment.py +131 -0
  19. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/napari_image_source.py +37 -0
  20. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/napari_labels_source.py +36 -0
  21. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/np_source.py +35 -0
  22. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/obfuscate_affs.py +98 -0
  23. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/smooth_augment.py +73 -0
  24. napari_bootstrapper-0.1.1/src/napari_bootstrapper/gp/torch_predict.py +177 -0
  25. napari_bootstrapper-0.1.1/src/napari_bootstrapper/models/__init__.py +136 -0
  26. napari_bootstrapper-0.1.1/src/napari_bootstrapper/models/model_2d.py +75 -0
  27. napari_bootstrapper-0.1.1/src/napari_bootstrapper/models/model_3d.py +66 -0
  28. napari_bootstrapper-0.1.1/src/napari_bootstrapper/models/unet.py +513 -0
  29. napari_bootstrapper-0.1.1/src/napari_bootstrapper/napari.yaml +46 -0
  30. napari_bootstrapper-0.1.1/src/napari_bootstrapper/post/__init__.py +60 -0
  31. napari_bootstrapper-0.1.1/src/napari_bootstrapper/post/_merge_split_widget.py +789 -0
  32. napari_bootstrapper-0.1.1/src/napari_bootstrapper/post/cc.py +108 -0
  33. napari_bootstrapper-0.1.1/src/napari_bootstrapper/post/mws.py +59 -0
  34. napari_bootstrapper-0.1.1/src/napari_bootstrapper/post/ws.py +159 -0
  35. napari_bootstrapper-0.1.1/src/napari_bootstrapper/sample_data/image.npy +0 -0
  36. napari_bootstrapper-0.1.1/src/napari_bootstrapper/sample_data/labels.npy +0 -0
  37. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/PKG-INFO +175 -0
  38. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/SOURCES.txt +40 -0
  39. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/dependency_links.txt +1 -0
  40. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/entry_points.txt +2 -0
  41. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/requires.txt +22 -0
  42. napari_bootstrapper-0.1.1/src/napari_bootstrapper.egg-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+
2
+ Copyright (c) 2025, Vijay Venu Thiyagarajan
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * Neither the name of copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include README.md
3
+
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: napari-bootstrapper
3
+ Version: 0.1.1
4
+ Summary: A plugin to quickly generate dense ground truth with sparse labels
5
+ Author: Vijay Venu Thiyagarajan
6
+ Author-email: vvenu@utexas.edu
7
+ License:
8
+ Copyright (c) 2025, Vijay Venu Thiyagarajan
9
+ All rights reserved.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ * Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ * Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ * Neither the name of copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Classifier: Development Status :: 2 - Pre-Alpha
37
+ Classifier: Framework :: napari
38
+ Classifier: Intended Audience :: Developers
39
+ Classifier: License :: OSI Approved :: BSD License
40
+ Classifier: Operating System :: OS Independent
41
+ Classifier: Programming Language :: Python
42
+ Classifier: Programming Language :: Python :: 3
43
+ Classifier: Programming Language :: Python :: 3 :: Only
44
+ Classifier: Programming Language :: Python :: 3.11
45
+ Classifier: Programming Language :: Python :: 3.12
46
+ Classifier: Programming Language :: Python :: 3.13
47
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
48
+ Requires-Python: >=3.11
49
+ Description-Content-Type: text/markdown
50
+ License-File: LICENSE
51
+ Requires-Dist: numpy
52
+ Requires-Dist: scipy
53
+ Requires-Dist: scikit-image
54
+ Requires-Dist: torch
55
+ Requires-Dist: numba
56
+ Requires-Dist: gunpowder
57
+ Requires-Dist: magicgui
58
+ Requires-Dist: qtpy
59
+ Requires-Dist: pyqtgraph
60
+ Requires-Dist: matplotlib
61
+ Requires-Dist: napari
62
+ Requires-Dist: tqdm
63
+ Requires-Dist: lsds
64
+ Requires-Dist: mwatershed
65
+ Provides-Extra: testing
66
+ Requires-Dist: tox; extra == "testing"
67
+ Requires-Dist: pytest; extra == "testing"
68
+ Requires-Dist: pytest-cov; extra == "testing"
69
+ Requires-Dist: pytest-qt; extra == "testing"
70
+ Requires-Dist: napari; extra == "testing"
71
+ Requires-Dist: pyqt5; extra == "testing"
72
+ Dynamic: license-file
73
+
74
+ # napari-bootstrapper
75
+
76
+ [![License BSD-3](https://img.shields.io/pypi/l/napari-bootstrapper.svg?color=green)](https://github.com/ucsdmanorlab/napari-bootstrapper/raw/main/LICENSE)
77
+ [![PyPI](https://img.shields.io/pypi/v/napari-bootstrapper.svg?color=green)](https://pypi.org/project/napari-bootstrapper)
78
+ [![Python Version](https://img.shields.io/pypi/pyversions/napari-bootstrapper.svg?color=green)](https://python.org)
79
+ [![tests](https://github.com/ucsdmanorlab/napari-bootstrapper/workflows/tests/badge.svg)](https://github.com/ucsdmanorlab/napari-bootstrapper/actions)
80
+ [![codecov](https://codecov.io/gh/ucsdmanorlab/napari-bootstrapper/branch/main/graph/badge.svg)](https://codecov.io/gh/ucsdmanorlab/napari-bootstrapper)
81
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-bootstrapper)](https://napari-hub.org/plugins/napari-bootstrapper)
82
+ [![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
83
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
84
+
85
+ - [Introduction](#introduction)
86
+ - [Installation](#installation)
87
+ - [Getting Started](#getting-started)
88
+ - [Citation](#citation)
89
+ - [Issues](#issues)
90
+ - [Funding](#funding)
91
+
92
+ ## Introduction
93
+
94
+ `napari-bootstrapper` is a tool to quickly generate dense 3D labels using sparse 2D labels within napari.
95
+
96
+ Dense 3D segmentations are generated using the 2D->3D method described in the preprint titled [_Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation_](https://www.biorxiv.org/content/10.1101/2024.06.14.599135v2). In the preprint, we show sparse 2D annotations made in ~10 minutes on a single section can generate dense 3D segmentations that are reasonably good starting points for refining or bootstrapping.
97
+
98
+ This plugin is limited to the 2D->3D method and is intended for small volumes that can fit in memory. For more complex bootstrapping workflows, dedicated 3D models, and block-wise processing of large volumes, we recommend using the [_Bootstrapper_](https://github.com/ucsdmanorlab/bootstrapper) CLI tool.
99
+
100
+ ## Installation
101
+
102
+ We recommend installing `napari-bootstrapper` via conda and [pip]:
103
+
104
+ 1. Create a new environment called `napari-bootstrapper`:
105
+
106
+ ```bash
107
+ conda create -n napari-bootstrapper -c conda-forge python==3.11 napari pyqt
108
+ ```
109
+
110
+ 2. Activate the newly-created environment:
111
+
112
+ ```
113
+ conda activate napari-bootstrapper
114
+ ```
115
+
116
+ 3. You can install `napari-bootstrapper` via [pip]:
117
+
118
+ ```bash
119
+ pip install napari-bootstrapper
120
+ ```
121
+ - Or you can install the latest development version from github:
122
+
123
+ ```bash
124
+ pip install git+https://github.com/ucsdmanorlab/napari-bootstrapper.git
125
+ ```
126
+
127
+
128
+ ## Getting Started
129
+ Run the following in your terminal:
130
+ ```bash
131
+ conda activate napari-bootstrapper
132
+ napari
133
+ ```
134
+
135
+ ## Citation
136
+
137
+ If you find Bootstrapper useful in your research, please consider citing our **[preprint](https://www.biorxiv.org/content/10.1101/2024.06.14.599135v1)**:
138
+ ```
139
+ @article {Thiyagarajan2024.06.14.599135,
140
+ author = {Thiyagarajan, Vijay Venu and Sheridan, Arlo and Harris, Kristen M. and Manor, Uri},
141
+ title = {Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation},
142
+ year = {2024},
143
+ doi = {10.1101/2024.06.14.599135},
144
+ URL = {https://www.biorxiv.org/content/10.1101/2024.06.14.599135v2},
145
+ }
146
+ ```
147
+
148
+
149
+ ## Issues
150
+
151
+ If you encounter any problems, please [file an issue](https://github.com/ucsdmanorlab/napari-bootstrapper/issues) along with a detailed description.
152
+
153
+ [napari]: https://github.com/napari/napari
154
+ [copier]: https://copier.readthedocs.io/en/stable/
155
+ [@napari]: https://github.com/napari
156
+ [MIT]: http://opensource.org/licenses/MIT
157
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
158
+ [GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
159
+ [GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
160
+ [Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
161
+ [Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
162
+ [napari-plugin-template]: https://github.com/napari/napari-plugin-template
163
+
164
+ [napari]: https://github.com/napari/napari
165
+ [tox]: https://tox.readthedocs.io/en/latest/
166
+ [pip]: https://pypi.org/project/pip/
167
+ [PyPI]: https://pypi.org/
168
+
169
+
170
+ ## Funding
171
+ Chan-Zuckerberg Imaging Scientist Award DOI https://doi.org/10.37921/694870itnyzk from the Chan Zuckerberg Initiative DAF, an advised fund of Silicon Valley Community Foundation (funder DOI 10.13039/100014989).
172
+
173
+ NSF NeuroNex Technology Hub Award (1707356), NSF NeuroNex2 Award (2014862)
174
+
175
+ ![image](https://github.com/ucsdmanorlab/bootstrapper/assets/64760651/4b4a6029-e1ba-42bb-ab8b-d9357cc46239)
@@ -0,0 +1,102 @@
1
+ # napari-bootstrapper
2
+
3
+ [![License BSD-3](https://img.shields.io/pypi/l/napari-bootstrapper.svg?color=green)](https://github.com/ucsdmanorlab/napari-bootstrapper/raw/main/LICENSE)
4
+ [![PyPI](https://img.shields.io/pypi/v/napari-bootstrapper.svg?color=green)](https://pypi.org/project/napari-bootstrapper)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/napari-bootstrapper.svg?color=green)](https://python.org)
6
+ [![tests](https://github.com/ucsdmanorlab/napari-bootstrapper/workflows/tests/badge.svg)](https://github.com/ucsdmanorlab/napari-bootstrapper/actions)
7
+ [![codecov](https://codecov.io/gh/ucsdmanorlab/napari-bootstrapper/branch/main/graph/badge.svg)](https://codecov.io/gh/ucsdmanorlab/napari-bootstrapper)
8
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-bootstrapper)](https://napari-hub.org/plugins/napari-bootstrapper)
9
+ [![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
10
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
11
+
12
+ - [Introduction](#introduction)
13
+ - [Installation](#installation)
14
+ - [Getting Started](#getting-started)
15
+ - [Citation](#citation)
16
+ - [Issues](#issues)
17
+ - [Funding](#funding)
18
+
19
+ ## Introduction
20
+
21
+ `napari-bootstrapper` is a tool to quickly generate dense 3D labels using sparse 2D labels within napari.
22
+
23
+ Dense 3D segmentations are generated using the 2D->3D method described in the preprint titled [_Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation_](https://www.biorxiv.org/content/10.1101/2024.06.14.599135v2). In the preprint, we show sparse 2D annotations made in ~10 minutes on a single section can generate dense 3D segmentations that are reasonably good starting points for refining or bootstrapping.
24
+
25
+ This plugin is limited to the 2D->3D method and is intended for small volumes that can fit in memory. For more complex bootstrapping workflows, dedicated 3D models, and block-wise processing of large volumes, we recommend using the [_Bootstrapper_](https://github.com/ucsdmanorlab/bootstrapper) CLI tool.
26
+
27
+ ## Installation
28
+
29
+ We recommend installing `napari-bootstrapper` via conda and [pip]:
30
+
31
+ 1. Create a new environment called `napari-bootstrapper`:
32
+
33
+ ```bash
34
+ conda create -n napari-bootstrapper -c conda-forge python==3.11 napari pyqt
35
+ ```
36
+
37
+ 2. Activate the newly-created environment:
38
+
39
+ ```
40
+ conda activate napari-bootstrapper
41
+ ```
42
+
43
+ 3. You can install `napari-bootstrapper` via [pip]:
44
+
45
+ ```bash
46
+ pip install napari-bootstrapper
47
+ ```
48
+ - Or you can install the latest development version from github:
49
+
50
+ ```bash
51
+ pip install git+https://github.com/ucsdmanorlab/napari-bootstrapper.git
52
+ ```
53
+
54
+
55
+ ## Getting Started
56
+ Run the following in your terminal:
57
+ ```bash
58
+ conda activate napari-bootstrapper
59
+ napari
60
+ ```
61
+
62
+ ## Citation
63
+
64
+ If you find Bootstrapper useful in your research, please consider citing our **[preprint](https://www.biorxiv.org/content/10.1101/2024.06.14.599135v1)**:
65
+ ```
66
+ @article {Thiyagarajan2024.06.14.599135,
67
+ author = {Thiyagarajan, Vijay Venu and Sheridan, Arlo and Harris, Kristen M. and Manor, Uri},
68
+ title = {Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation},
69
+ year = {2024},
70
+ doi = {10.1101/2024.06.14.599135},
71
+ URL = {https://www.biorxiv.org/content/10.1101/2024.06.14.599135v2},
72
+ }
73
+ ```
74
+
75
+
76
+ ## Issues
77
+
78
+ If you encounter any problems, please [file an issue](https://github.com/ucsdmanorlab/napari-bootstrapper/issues) along with a detailed description.
79
+
80
+ [napari]: https://github.com/napari/napari
81
+ [copier]: https://copier.readthedocs.io/en/stable/
82
+ [@napari]: https://github.com/napari
83
+ [MIT]: http://opensource.org/licenses/MIT
84
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
85
+ [GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
86
+ [GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
87
+ [Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
88
+ [Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
89
+ [napari-plugin-template]: https://github.com/napari/napari-plugin-template
90
+
91
+ [napari]: https://github.com/napari/napari
92
+ [tox]: https://tox.readthedocs.io/en/latest/
93
+ [pip]: https://pypi.org/project/pip/
94
+ [PyPI]: https://pypi.org/
95
+
96
+
97
+ ## Funding
98
+ Chan-Zuckerberg Imaging Scientist Award DOI https://doi.org/10.37921/694870itnyzk from the Chan Zuckerberg Initiative DAF, an advised fund of Silicon Valley Community Foundation (funder DOI 10.13039/100014989).
99
+
100
+ NSF NeuroNex Technology Hub Award (1707356), NSF NeuroNex2 Award (2014862)
101
+
102
+ ![image](https://github.com/ucsdmanorlab/bootstrapper/assets/64760651/4b4a6029-e1ba-42bb-ab8b-d9357cc46239)
@@ -0,0 +1,122 @@
1
+ [project]
2
+ name = "napari-bootstrapper"
3
+ dynamic = ["version"]
4
+ description = "A plugin to quickly generate dense ground truth with sparse labels"
5
+ readme = "README.md"
6
+ license = {file = "LICENSE"}
7
+ authors = [
8
+ {name = "Vijay Venu Thiyagarajan"},
9
+ {email = "vvenu@utexas.edu"},
10
+ ]
11
+ classifiers = [
12
+ "Development Status :: 2 - Pre-Alpha",
13
+ "Framework :: napari",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: BSD License",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Scientific/Engineering :: Image Processing",
24
+ ]
25
+ requires-python = ">=3.11"
26
+ dependencies = [
27
+ "numpy",
28
+ "scipy",
29
+ "scikit-image",
30
+ "torch",
31
+ "numba",
32
+ "gunpowder",
33
+ "magicgui",
34
+ "qtpy",
35
+ "pyqtgraph",
36
+ "matplotlib",
37
+ "napari",
38
+ "tqdm",
39
+ "lsds",
40
+ "mwatershed",
41
+ ]
42
+
43
+ [project.optional-dependencies]
44
+ testing = [
45
+ "tox",
46
+ "pytest", # https://docs.pytest.org/en/latest/contents.html
47
+ "pytest-cov", # https://pytest-cov.readthedocs.io/en/latest/
48
+ "pytest-qt", # https://pytest-qt.readthedocs.io/en/latest/
49
+ "napari",
50
+ "pyqt5",
51
+ ]
52
+
53
+ [project.entry-points."napari.manifest"]
54
+ napari-bootstrapper = "napari_bootstrapper:napari.yaml"
55
+
56
+ [build-system]
57
+ requires = ["setuptools>=42.0.0", "wheel"]
58
+ build-backend = "setuptools.build_meta"
59
+
60
+ [tool.setuptools]
61
+ include-package-data = true
62
+
63
+ [tool.setuptools.packages.find]
64
+ where = ["src"]
65
+
66
+ [tool.setuptools.package-data]
67
+ "*" = ["*.yaml"]
68
+ "napari_bootstrapper" = ["sample_data/*.npy"]
69
+
70
+
71
+ [tool.setuptools.dynamic]
72
+ version = {attr = "napari_bootstrapper.__init__.__version__"}
73
+
74
+ [tool.black]
75
+ line-length = 79
76
+ target-version = ['py311', 'py312', 'py313']
77
+
78
+ [tool.ruff]
79
+ line-length = 79
80
+ lint.select = [
81
+ "E", "F", "W", #flake8
82
+ "UP", # pyupgrade
83
+ "I", # isort
84
+ "BLE", # flake8-blind-exception
85
+ "B", # flake8-bugbear
86
+ "A", # flake8-builtins
87
+ "C4", # flake8-comprehensions
88
+ "ISC", # flake8-implicit-str-concat
89
+ "G", # flake8-logging-format
90
+ "PIE", # flake8-pie
91
+ "SIM", # flake8-simplify
92
+ ]
93
+ lint.ignore = [
94
+ "E501", # line too long. let black handle this
95
+ "UP006", "UP007", # type annotation. As using magicgui require runtime type annotation then we disable this.
96
+ "SIM117", # flake8-simplify - some of merged with statements are not looking great with black, reanble after drop python 3.9
97
+ ]
98
+
99
+ exclude = [
100
+ ".bzr",
101
+ ".direnv",
102
+ ".eggs",
103
+ ".git",
104
+ ".mypy_cache",
105
+ ".pants.d",
106
+ ".ruff_cache",
107
+ ".svn",
108
+ ".tox",
109
+ ".venv",
110
+ "__pypackages__",
111
+ "_build",
112
+ "buck-out",
113
+ "build",
114
+ "dist",
115
+ "node_modules",
116
+ "venv",
117
+ "*vendored*",
118
+ "*_vendor*",
119
+ ]
120
+
121
+ target-version = "py311"
122
+ fix = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ __version__ = "0.1.1"
2
+
3
+ from ._sample_data import make_sample_data
4
+ from ._widget import (
5
+ Widget,
6
+ )
7
+
8
+ __all__ = (
9
+ "make_sample_data",
10
+ "Widget",
11
+ )
@@ -0,0 +1,42 @@
1
+ """
2
+ This module is an example of a barebones sample data provider for napari.
3
+
4
+ It implements the "sample data" specification.
5
+ see: https://napari.org/stable/plugins/building_a_plugin/guides.html#sample-data
6
+
7
+ Replace code below according to your needs.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from pathlib import Path
13
+
14
+ import numpy as np
15
+
16
+ CREMI_IMAGE_SAMPLE = Path(__file__).parent / "sample_data" / "image.npy"
17
+ CREMI_LABELS_SAMPLE = Path(__file__).parent / "sample_data" / "labels.npy"
18
+
19
+
20
+ def make_sample_data():
21
+ raw = np.load(CREMI_IMAGE_SAMPLE, "r")
22
+ painting = np.load(CREMI_LABELS_SAMPLE, "r")
23
+ raw = raw.astype(np.uint8)
24
+ painting = painting.astype(np.uint32)
25
+ return [
26
+ (
27
+ raw,
28
+ {
29
+ "name": "Raw",
30
+ "metadata": {"axes": ["z", "y", "x"]},
31
+ },
32
+ "image",
33
+ ),
34
+ (
35
+ painting,
36
+ {
37
+ "name": "Sparse Labels",
38
+ "metadata": {"axes": ["z", "y", "x"]},
39
+ },
40
+ "Labels",
41
+ ),
42
+ ]