napari-tmidas 0.2.0__tar.gz → 0.2.2__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 (55) hide show
  1. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.github/workflows/test_and_deploy.yml +1 -1
  2. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/PKG-INFO +37 -17
  3. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/README.md +27 -15
  4. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/pyproject.toml +9 -1
  5. napari_tmidas-0.2.2/src/napari_tmidas/_crop_anything.py +2580 -0
  6. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_file_selector.py +99 -16
  7. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_registry.py +15 -14
  8. napari_tmidas-0.2.2/src/napari_tmidas/_tests/test_file_selector.py +90 -0
  9. napari_tmidas-0.2.2/src/napari_tmidas/_tests/test_registry.py +67 -0
  10. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_version.py +2 -2
  11. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/basic.py +760 -0
  12. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/careamics_denoising.py +324 -0
  13. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/careamics_env_manager.py +339 -0
  14. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/cellpose_env_manager.py +55 -20
  15. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/cellpose_segmentation.py +105 -218
  16. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/sam2_mp4.py +283 -0
  17. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/skimage_filters.py +31 -1
  18. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/timepoint_merger.py +490 -0
  19. napari_tmidas-0.2.2/src/napari_tmidas/processing_functions/trackastra_tracking.py +322 -0
  20. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/PKG-INFO +37 -17
  21. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/SOURCES.txt +8 -1
  22. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/requires.txt +9 -0
  23. napari_tmidas-0.2.0/src/napari_tmidas/_crop_anything.py +0 -1245
  24. napari_tmidas-0.2.0/src/napari_tmidas/processing_functions/basic.py +0 -289
  25. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.github/dependabot.yml +0 -0
  26. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.gitignore +0 -0
  27. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.napari-hub/DESCRIPTION.md +0 -0
  28. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.napari-hub/config.yml +0 -0
  29. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/.pre-commit-config.yaml +0 -0
  30. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/LICENSE +0 -0
  31. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/MANIFEST.in +0 -0
  32. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/setup.cfg +0 -0
  33. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/__init__.py +0 -0
  34. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_file_conversion.py +0 -0
  35. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_label_inspection.py +0 -0
  36. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_reader.py +0 -0
  37. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_roi_colocalization.py +0 -0
  38. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_sample_data.py +0 -0
  39. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_tests/__init__.py +0 -0
  40. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_tests/test_reader.py +0 -0
  41. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_tests/test_sample_data.py +0 -0
  42. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_tests/test_widget.py +0 -0
  43. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_tests/test_writer.py +0 -0
  44. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_widget.py +0 -0
  45. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/_writer.py +0 -0
  46. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/napari.yaml +0 -0
  47. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/__init__.py +0 -0
  48. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/colocalization.py +0 -0
  49. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/file_compression.py +0 -0
  50. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/sam2_env_manager.py +0 -0
  51. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas/processing_functions/scipy_filters.py +0 -0
  52. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/dependency_links.txt +0 -0
  53. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/entry_points.txt +0 -0
  54. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/src/napari_tmidas.egg-info/top_level.txt +0 -0
  55. {napari_tmidas-0.2.0 → napari_tmidas-0.2.2}/tox.ini +0 -0
@@ -24,7 +24,7 @@ jobs:
24
24
  strategy:
25
25
  matrix:
26
26
  platform: [ubuntu-latest, windows-latest, macos-latest]
27
- python-version: ["3.9", "3.10", "3.11", "3.12"]
27
+ python-version: ["3.9", "3.10", "3.11"]
28
28
 
29
29
  steps:
30
30
  - uses: actions/checkout@v4
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napari-tmidas
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A plugin for batch processing of confocal and whole-slide microscopy images of biological tissues
5
5
  Author: Marco Meer
6
6
  Author-email: marco.meer@pm.me
@@ -48,13 +48,13 @@ Classifier: Programming Language :: Python :: 3 :: Only
48
48
  Classifier: Programming Language :: Python :: 3.9
49
49
  Classifier: Programming Language :: Python :: 3.10
50
50
  Classifier: Programming Language :: Python :: 3.11
51
- Classifier: Programming Language :: Python :: 3.12
52
51
  Classifier: Topic :: Scientific/Engineering :: Image Processing
53
52
  Requires-Python: >=3.9
54
53
  Description-Content-Type: text/markdown
55
54
  License-File: LICENSE
56
55
  Requires-Dist: numpy
57
56
  Requires-Dist: magicgui
57
+ Requires-Dist: tqdm
58
58
  Requires-Dist: qtpy
59
59
  Requires-Dist: scikit-image
60
60
  Requires-Dist: pyqt5
@@ -66,6 +66,14 @@ Requires-Dist: torch
66
66
  Requires-Dist: torchvision
67
67
  Requires-Dist: timm
68
68
  Requires-Dist: opencv-python
69
+ Requires-Dist: cmake
70
+ Requires-Dist: nd2
71
+ Requires-Dist: pylibCZIrw
72
+ Requires-Dist: readlif
73
+ Requires-Dist: tiffslide
74
+ Requires-Dist: hydra-core
75
+ Requires-Dist: eva-decord
76
+ Requires-Dist: acquifer-napari
69
77
  Provides-Extra: testing
70
78
  Requires-Dist: tox; extra == "testing"
71
79
  Requires-Dist: pytest; extra == "testing"
@@ -90,9 +98,11 @@ Currently, napari-tmidas provides pipelines as widgets for batch image conversio
90
98
 
91
99
  ## Installation
92
100
 
101
+ (Video installation guides: https://www.youtube.com/@macromeer/videos)
102
+
93
103
  First, install Napari in a virtual environment:
94
104
 
95
- mamba create -y -n napari-tmidas -c conda-forge python=3.11 tqdm
105
+ mamba create -y -n napari-tmidas -c conda-forge python=3.11
96
106
  mamba activate napari-tmidas
97
107
  python -m pip install "napari[all]"
98
108
 
@@ -100,27 +110,28 @@ Now you can install `napari-tmidas` via [pip]:
100
110
 
101
111
  pip install napari-tmidas
102
112
 
103
- It is recommended to install the latest development version:
113
+ It is recommended though to install the **latest development version**. Please also execute this command from time to time in the activated environment to benefit from newly added features:
104
114
 
105
115
  pip install git+https://github.com/macromeer/napari-tmidas.git
106
116
 
107
- ### Dependencies
108
-
109
- To use the Batch Microscopy Image Conversion pipeline, we need some libraries to read microscopy formats:
117
+ To use the Batch Crop Anything pipeline, we need to install **Segment Anything 2** (2D/3D):
110
118
 
111
- pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari
119
+ cd /opt # if the folder does not exist: mkdir /opt && cd /opt
120
+ git clone https://github.com/facebookresearch/sam2.git && cd sam2
121
+ pip install -e .
122
+ curl -L https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt -o checkpoints/sam2.1_hiera_large.pt
123
+ mamba install -c conda-forge ffmpeg # we also need ffmpeg
112
124
 
113
- For the Batch Crop Anything pipeline, we need to install MobileSAM and its dependencies:
125
+ If you want to batch compress image data using [Zstandard](https://github.com/facebook/zstd), use the package manager of your operating system to install it:
114
126
 
115
- pip install git+https://github.com/ChaoningZhang/MobileSAM.git
127
+ ~~sudo apt-get install zstd~~ # Pre-installed on Linux :man_shrugging:
116
128
 
129
+ brew install zstd # for macOS (requires [Homebrew](https://brew.sh/)
130
+ pip install zstandard # Windows with Python >= 3.7
117
131
 
118
- If you want to batch compress images using [Zstandard](https://github.com/facebook/zstd), use the package manager of your operating system to install it:
119
132
 
120
- sudo apt-get install zstd # for Linux
121
- brew install zstd # for macOS
122
- choco install zstandard # for Windows
123
133
 
134
+ And you are done!
124
135
 
125
136
  ## Usage
126
137
 
@@ -153,24 +164,33 @@ You can start this pipeline via `Plugins > T-MIDAS > Batch Microscopy Image Conv
153
164
  ![image](https://github.com/user-attachments/assets/05929660-6672-4f76-89da-4f17749ccfad)
154
165
 
155
166
  4. You can click on the images in the table to show them in the viewer. For example first click on one of the `Original Files`, and then the corresponding `Processed File` to see an overlay.
156
-
167
+
157
168
  <img src="https://github.com/user-attachments/assets/cfe84828-c1cc-4196-9a53-5dfb82d5bfce" alt="Image Processing Widget" style="width:75%; height:auto;">
158
169
 
159
170
 
160
171
  Note that whenever you click on an `Original File` or `Processed File` in the table, it will replace the one that is currently shown in the viewer. So naturally, you'd first select the original image, and then the processed image to correctly see the image pair that you want to inspect.
161
172
 
173
+
174
+ #### Processing Function Credits
175
+
176
+ The image processing capabilities are powered by several excellent open-source tools:
177
+ - [Cellpose 4](https://github.com/MouseLand/cellpose): Advanced cell segmentation
178
+ - [Trackastra](https://github.com/weigertlab/trackastra): Cell tracking and analysis
179
+ - [CAREamics](https://github.com/CAREamics/careamics): Content-aware image restoration and enhancement
180
+
162
181
  ### Batch Label Inspection
163
182
  If you have already segmented a folder full of images and now you want to maybe inspect and edit each label image, you can use the `Plugins > T-MIDAS > Batch Label Inspection`, which automatically saves your changes to the existing label image once you click the `Save Changes and Continue` button (bottom right).
164
183
 
165
184
  <img src="https://github.com/user-attachments/assets/0bf8c6ae-4212-449d-8183-e91b23ba740e" alt="Batch Label Inspection Widget" style="width:75%; height:auto;">
166
185
 
167
-
168
186
  ### Crop Anything
169
- This pipeline combines the Segment Anything Model (SAM) for automatic object detection with an interactive interface for selecting and cropping multiple objects from images. To launch the widget, open `Plugins > T-MIDAS > Batch Crop Anything`. Click the image below to see a video demo.
187
+ This pipeline combines the Segment Anything Model (SAM) for automatic object detection with an interactive interface for selecting and cropping multiple objects from images. To launch the widget, open `Plugins > T-MIDAS > Batch Crop Anything`. Cropping works like this: Enter 2D view and go to the first z slice where the object to be cropped is appearing. Activate/select the points layer and click on the object. Terminal shows progress. You can then proceed to select another object (always do this in 2D mode)
170
188
 
171
189
  <img src="https://github.com/user-attachments/assets/6d72c2a2-1064-4a27-b398-a9b86fcbc443" alt="Crop Anything Widget" style="width:75%; height:auto;">
172
190
 
173
191
 
192
+
193
+
174
194
  ### ROI Colocalization
175
195
  This pipeline quantifies colocalization between labeled regions of interest (ROIs) across multiple image channels. It determines the extent of overlap between ROIs in a reference channel and those in one or two other channels. The output is a table of colocalization counts. Optionally, the size of reference channel ROIs, as well as the total or median size of colocalizing ROIs in the other channels, can be included. Colocalization is determined using Boolean masking. The number of colocalizing instances is determined by counting unique label IDs within the overlapping regions. Typically, the reference channel contains larger structures, while other channels contain smaller, potentially nested, structures. For example, the reference channel might contain cell bodies, with the second and third channels containing nuclei and sub-nuclear objects, respectively.
176
196
 
@@ -13,9 +13,11 @@ Currently, napari-tmidas provides pipelines as widgets for batch image conversio
13
13
 
14
14
  ## Installation
15
15
 
16
+ (Video installation guides: https://www.youtube.com/@macromeer/videos)
17
+
16
18
  First, install Napari in a virtual environment:
17
19
 
18
- mamba create -y -n napari-tmidas -c conda-forge python=3.11 tqdm
20
+ mamba create -y -n napari-tmidas -c conda-forge python=3.11
19
21
  mamba activate napari-tmidas
20
22
  python -m pip install "napari[all]"
21
23
 
@@ -23,27 +25,28 @@ Now you can install `napari-tmidas` via [pip]:
23
25
 
24
26
  pip install napari-tmidas
25
27
 
26
- It is recommended to install the latest development version:
28
+ It is recommended though to install the **latest development version**. Please also execute this command from time to time in the activated environment to benefit from newly added features:
27
29
 
28
30
  pip install git+https://github.com/macromeer/napari-tmidas.git
29
31
 
30
- ### Dependencies
31
-
32
- To use the Batch Microscopy Image Conversion pipeline, we need some libraries to read microscopy formats:
32
+ To use the Batch Crop Anything pipeline, we need to install **Segment Anything 2** (2D/3D):
33
33
 
34
- pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari
34
+ cd /opt # if the folder does not exist: mkdir /opt && cd /opt
35
+ git clone https://github.com/facebookresearch/sam2.git && cd sam2
36
+ pip install -e .
37
+ curl -L https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt -o checkpoints/sam2.1_hiera_large.pt
38
+ mamba install -c conda-forge ffmpeg # we also need ffmpeg
35
39
 
36
- For the Batch Crop Anything pipeline, we need to install MobileSAM and its dependencies:
40
+ If you want to batch compress image data using [Zstandard](https://github.com/facebook/zstd), use the package manager of your operating system to install it:
37
41
 
38
- pip install git+https://github.com/ChaoningZhang/MobileSAM.git
42
+ ~~sudo apt-get install zstd~~ # Pre-installed on Linux :man_shrugging:
39
43
 
44
+ brew install zstd # for macOS (requires [Homebrew](https://brew.sh/)
45
+ pip install zstandard # Windows with Python >= 3.7
40
46
 
41
- If you want to batch compress images using [Zstandard](https://github.com/facebook/zstd), use the package manager of your operating system to install it:
42
47
 
43
- sudo apt-get install zstd # for Linux
44
- brew install zstd # for macOS
45
- choco install zstandard # for Windows
46
48
 
49
+ And you are done!
47
50
 
48
51
  ## Usage
49
52
 
@@ -76,24 +79,33 @@ You can start this pipeline via `Plugins > T-MIDAS > Batch Microscopy Image Conv
76
79
  ![image](https://github.com/user-attachments/assets/05929660-6672-4f76-89da-4f17749ccfad)
77
80
 
78
81
  4. You can click on the images in the table to show them in the viewer. For example first click on one of the `Original Files`, and then the corresponding `Processed File` to see an overlay.
79
-
82
+
80
83
  <img src="https://github.com/user-attachments/assets/cfe84828-c1cc-4196-9a53-5dfb82d5bfce" alt="Image Processing Widget" style="width:75%; height:auto;">
81
84
 
82
85
 
83
86
  Note that whenever you click on an `Original File` or `Processed File` in the table, it will replace the one that is currently shown in the viewer. So naturally, you'd first select the original image, and then the processed image to correctly see the image pair that you want to inspect.
84
87
 
88
+
89
+ #### Processing Function Credits
90
+
91
+ The image processing capabilities are powered by several excellent open-source tools:
92
+ - [Cellpose 4](https://github.com/MouseLand/cellpose): Advanced cell segmentation
93
+ - [Trackastra](https://github.com/weigertlab/trackastra): Cell tracking and analysis
94
+ - [CAREamics](https://github.com/CAREamics/careamics): Content-aware image restoration and enhancement
95
+
85
96
  ### Batch Label Inspection
86
97
  If you have already segmented a folder full of images and now you want to maybe inspect and edit each label image, you can use the `Plugins > T-MIDAS > Batch Label Inspection`, which automatically saves your changes to the existing label image once you click the `Save Changes and Continue` button (bottom right).
87
98
 
88
99
  <img src="https://github.com/user-attachments/assets/0bf8c6ae-4212-449d-8183-e91b23ba740e" alt="Batch Label Inspection Widget" style="width:75%; height:auto;">
89
100
 
90
-
91
101
  ### Crop Anything
92
- This pipeline combines the Segment Anything Model (SAM) for automatic object detection with an interactive interface for selecting and cropping multiple objects from images. To launch the widget, open `Plugins > T-MIDAS > Batch Crop Anything`. Click the image below to see a video demo.
102
+ This pipeline combines the Segment Anything Model (SAM) for automatic object detection with an interactive interface for selecting and cropping multiple objects from images. To launch the widget, open `Plugins > T-MIDAS > Batch Crop Anything`. Cropping works like this: Enter 2D view and go to the first z slice where the object to be cropped is appearing. Activate/select the points layer and click on the object. Terminal shows progress. You can then proceed to select another object (always do this in 2D mode)
93
103
 
94
104
  <img src="https://github.com/user-attachments/assets/6d72c2a2-1064-4a27-b398-a9b86fcbc443" alt="Crop Anything Widget" style="width:75%; height:auto;">
95
105
 
96
106
 
107
+
108
+
97
109
  ### ROI Colocalization
98
110
  This pipeline quantifies colocalization between labeled regions of interest (ROIs) across multiple image channels. It determines the extent of overlap between ROIs in a reference channel and those in one or two other channels. The output is a table of colocalization counts. Optionally, the size of reference channel ROIs, as well as the total or median size of colocalizing ROIs in the other channels, can be included. Colocalization is determined using Boolean masking. The number of colocalizing instances is determined by counting unique label IDs within the overlapping regions. Typically, the reference channel contains larger structures, while other channels contain smaller, potentially nested, structures. For example, the reference channel might contain cell bodies, with the second and third channels containing nuclei and sub-nuclear objects, respectively.
99
111
 
@@ -20,13 +20,13 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.9",
21
21
  "Programming Language :: Python :: 3.10",
22
22
  "Programming Language :: Python :: 3.11",
23
- "Programming Language :: Python :: 3.12",
24
23
  "Topic :: Scientific/Engineering :: Image Processing",
25
24
  ]
26
25
  requires-python = ">=3.9"
27
26
  dependencies = [
28
27
  "numpy",
29
28
  "magicgui",
29
+ "tqdm",
30
30
  "qtpy",
31
31
  "scikit-image",
32
32
  "pyqt5",
@@ -38,6 +38,14 @@ dependencies = [
38
38
  "torchvision",
39
39
  "timm",
40
40
  "opencv-python",
41
+ "cmake",
42
+ "nd2",
43
+ "pylibCZIrw",
44
+ "readlif",
45
+ "tiffslide",
46
+ "hydra-core",
47
+ "eva-decord",
48
+ "acquifer-napari",
41
49
  ]
42
50
 
43
51
  [project.optional-dependencies]