napari-tmidas 0.1.6__tar.gz → 0.1.7.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 (43) hide show
  1. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/PKG-INFO +48 -14
  2. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/README.md +47 -13
  3. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/__init__.py +3 -0
  4. napari_tmidas-0.1.7.1/src/napari_tmidas/_crop_anything.py +1113 -0
  5. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_file_conversion.py +488 -256
  6. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_file_selector.py +267 -101
  7. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_label_inspection.py +10 -0
  8. napari_tmidas-0.1.7.1/src/napari_tmidas/_roi_colocalization.py +1175 -0
  9. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_version.py +2 -2
  10. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/napari.yaml +10 -0
  11. napari_tmidas-0.1.7.1/src/napari_tmidas/processing_functions/basic.py +125 -0
  12. napari_tmidas-0.1.7.1/src/napari_tmidas/processing_functions/colocalization.py +242 -0
  13. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/processing_functions/skimage_filters.py +17 -32
  14. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/PKG-INFO +48 -14
  15. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/SOURCES.txt +3 -0
  16. napari_tmidas-0.1.6/src/napari_tmidas/processing_functions/basic.py +0 -42
  17. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.github/dependabot.yml +0 -0
  18. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.github/workflows/test_and_deploy.yml +0 -0
  19. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.gitignore +0 -0
  20. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.napari-hub/DESCRIPTION.md +0 -0
  21. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.napari-hub/config.yml +0 -0
  22. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/.pre-commit-config.yaml +0 -0
  23. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/LICENSE +0 -0
  24. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/MANIFEST.in +0 -0
  25. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/pyproject.toml +0 -0
  26. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/setup.cfg +0 -0
  27. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_reader.py +0 -0
  28. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_registry.py +0 -0
  29. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_sample_data.py +0 -0
  30. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_tests/__init__.py +0 -0
  31. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_tests/test_reader.py +0 -0
  32. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_tests/test_sample_data.py +0 -0
  33. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_tests/test_widget.py +0 -0
  34. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_tests/test_writer.py +0 -0
  35. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_widget.py +0 -0
  36. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/_writer.py +0 -0
  37. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/processing_functions/__init__.py +0 -0
  38. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas/processing_functions/scipy_filters.py +0 -0
  39. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/dependency_links.txt +0 -0
  40. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/entry_points.txt +0 -0
  41. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/requires.txt +0 -0
  42. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/src/napari_tmidas.egg-info/top_level.txt +0 -0
  43. {napari_tmidas-0.1.6 → napari_tmidas-0.1.7.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napari-tmidas
3
- Version: 0.1.6
3
+ Version: 0.1.7.1
4
4
  Summary: Tissue Microscopy Image Data Analysis Suite
5
5
  Author: Marco Meer
6
6
  Author-email: marco.meer@pm.me
@@ -75,11 +75,30 @@ Dynamic: license-file
75
75
  [![tests](https://github.com/macromeer/napari-tmidas/workflows/tests/badge.svg)](https://github.com/macromeer/napari-tmidas/actions)
76
76
  [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-tmidas)](https://napari-hub.org/plugins/napari-tmidas)
77
77
  <!-- [![codecov](https://codecov.io/gh/macromeer/napari-tmidas/branch/main/graph/badge.svg)](https://codecov.io/gh/macromeer/napari-tmidas) -->
78
- This Napari plugin allows you to perform batch image processing without a graphics processing unit (GPU). It will still be fast because computations will run in parallel on your central processing unit (CPU).
78
+ The `napari-tmidas` plugin consists of a growing collection of pipelines for fast batch processing of microscopy images. This is a WIP and based on the CLI version of [T-MIDAS](https://github.com/MercaderLabAnatomy/T-MIDAS).
79
79
 
80
- This plugin provides you with a growing collection of pipelines for batch image preprocessing, segmentation, regions-of-interest (ROI) analysis and other useful features.
80
+ ## Feature Overview
81
+
82
+ 1. **Image Processing**
83
+ - Process image folders with: Gamma correction, Z-projection, channel splitting, Gaussian/median filters, thresholding (Otsu/manual), and label cleaning
84
+
85
+ 2. **Label Inspection**
86
+ - Review and edit label images with auto-save
87
+
88
+ 3. **Microscopy Image Conversion**
89
+ - Convert .nd2/.lif/.ndpi/.czi/acquifer → .tif/.zarr with metadata preservation
90
+
91
+ 4. **Crop Anything**
92
+ - Interactive ROI selection via click interface
93
+
94
+ 5. **ROI Colocalization**
95
+ - Count colocalized labels across multiple channels
96
+
97
+
98
+
99
+ ### Coming Soon
100
+ New features arriving April 2025
81
101
 
82
- `napari-tmidas` is a work in progress (WIP) and an evolutionary step away from the [terminal / command-line version of T-MIDAS](https://github.com/MercaderLabAnatomy/T-MIDAS).
83
102
 
84
103
  ## Installation
85
104
 
@@ -98,29 +117,35 @@ To install the latest development version:
98
117
  pip install git+https://github.com/macromeer/napari-tmidas.git
99
118
 
100
119
  ### Dependencies
101
- For the File converter, we need some libraries to read some microscopy formats and to write ome-zarr:
120
+ To use the Batch Microscopy Image Conversion pipeline, we need some libraries to read microscopy formats and to write ome-zarr:
102
121
 
103
- pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari ome-zarr
122
+ pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari ome-zarr napari-ome-zarr
104
123
 
124
+ For the Batch Crop Anything pipeline, we need to install MobileSAM and its dependencies:
125
+
126
+ pip install git+https://github.com/ChaoningZhang/MobileSAM.git
127
+ pip install torch torchvision timm opencv-python
105
128
 
106
129
  ## Usage
107
130
 
131
+ To use the plugin, start napari in the activated virtual environment with this terminal command:
132
+
133
+ mamba run -n napari-tmidas napari
134
+
108
135
  You can find the installed plugin here:
109
136
 
110
137
  ![image](https://github.com/user-attachments/assets/504db09a-d66e-49eb-90cd-3237024d9d7a)
111
138
 
112
139
 
113
- ### File converter
140
+ ### Microscopy Image Conversion
114
141
 
115
- You might first want to batch convert microscopy image data. Currently, this plugin supports `.nd2, .lif, .ndpi, .czi` and acquifer data. After launching the file converter, you can scan a folder of your choice for microscopy image data. It will also detect series images that you can preview. Start by selecting an original image in the first column of the table. This allows you to preview or convert.
142
+ You can start this pipeline via `Plugins > T-MIDAS > Batch Microscopy Image Conversion`. Currently, this pipeline supports the conversion of `.nd2, .lif, .ndpi, .czi` and acquifer data. After scanning a folder of your choice for microscopy image data, select a file in the first column of the table and preview and export any image data it contains.
116
143
 
117
144
  ![image](https://github.com/user-attachments/assets/e377ca71-2f30-447d-825e-d2feebf7061b)
118
145
 
146
+ ### Image Processing
119
147
 
120
-
121
- ### File inspector
122
-
123
- 1. After opening `Plugins > T-MIDAS > File selector`, enter the path to the folder containing the images to be processed (currently supports TIF, later also ZARR). You can also filter for filename suffix.
148
+ 1. After opening `Plugins > T-MIDAS > Batch Image Processing`, enter the path to the folder containing the images to be processed (currently supports TIF, later also ZARR). You can also filter for filename suffix.
124
149
 
125
150
  ![image](https://github.com/user-attachments/assets/41ecb689-9abe-4371-83b5-9c5eb37069f9)
126
151
 
@@ -138,11 +163,20 @@ You might first want to batch convert microscopy image data. Currently, this plu
138
163
 
139
164
  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.
140
165
 
141
- ### Label inspector
142
- 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 > Label inspector`, which automatically saves your changes to the existing label image once you click the `Save Changes and Continue` button (bottom right).
166
+ ### Batch Label Inspection
167
+ 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).
143
168
 
144
169
  ![image](https://github.com/user-attachments/assets/0bf8c6ae-4212-449d-8183-e91b23ba740e)
145
170
 
171
+ ### Crop Anything
172
+ 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`
173
+
174
+ ![image](https://github.com/user-attachments/assets/6d72c2a2-1064-4a27-b398-a9b86fcbc443)
175
+
176
+ ### ROI Colocalization
177
+ 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.
178
+
179
+ ![napari-tmidas_coloc_pipeline](https://github.com/user-attachments/assets/2f9022a0-7b88-4588-a448-250f07a634d7)
146
180
 
147
181
 
148
182
  ## Contributing
@@ -6,11 +6,30 @@
6
6
  [![tests](https://github.com/macromeer/napari-tmidas/workflows/tests/badge.svg)](https://github.com/macromeer/napari-tmidas/actions)
7
7
  [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-tmidas)](https://napari-hub.org/plugins/napari-tmidas)
8
8
  <!-- [![codecov](https://codecov.io/gh/macromeer/napari-tmidas/branch/main/graph/badge.svg)](https://codecov.io/gh/macromeer/napari-tmidas) -->
9
- This Napari plugin allows you to perform batch image processing without a graphics processing unit (GPU). It will still be fast because computations will run in parallel on your central processing unit (CPU).
9
+ The `napari-tmidas` plugin consists of a growing collection of pipelines for fast batch processing of microscopy images. This is a WIP and based on the CLI version of [T-MIDAS](https://github.com/MercaderLabAnatomy/T-MIDAS).
10
10
 
11
- This plugin provides you with a growing collection of pipelines for batch image preprocessing, segmentation, regions-of-interest (ROI) analysis and other useful features.
11
+ ## Feature Overview
12
+
13
+ 1. **Image Processing**
14
+ - Process image folders with: Gamma correction, Z-projection, channel splitting, Gaussian/median filters, thresholding (Otsu/manual), and label cleaning
15
+
16
+ 2. **Label Inspection**
17
+ - Review and edit label images with auto-save
18
+
19
+ 3. **Microscopy Image Conversion**
20
+ - Convert .nd2/.lif/.ndpi/.czi/acquifer → .tif/.zarr with metadata preservation
21
+
22
+ 4. **Crop Anything**
23
+ - Interactive ROI selection via click interface
24
+
25
+ 5. **ROI Colocalization**
26
+ - Count colocalized labels across multiple channels
27
+
28
+
29
+
30
+ ### Coming Soon
31
+ New features arriving April 2025
12
32
 
13
- `napari-tmidas` is a work in progress (WIP) and an evolutionary step away from the [terminal / command-line version of T-MIDAS](https://github.com/MercaderLabAnatomy/T-MIDAS).
14
33
 
15
34
  ## Installation
16
35
 
@@ -29,29 +48,35 @@ To install the latest development version:
29
48
  pip install git+https://github.com/macromeer/napari-tmidas.git
30
49
 
31
50
  ### Dependencies
32
- For the File converter, we need some libraries to read some microscopy formats and to write ome-zarr:
51
+ To use the Batch Microscopy Image Conversion pipeline, we need some libraries to read microscopy formats and to write ome-zarr:
33
52
 
34
- pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari ome-zarr
53
+ pip install nd2 readlif tiffslide pylibCZIrw acquifer-napari ome-zarr napari-ome-zarr
35
54
 
55
+ For the Batch Crop Anything pipeline, we need to install MobileSAM and its dependencies:
56
+
57
+ pip install git+https://github.com/ChaoningZhang/MobileSAM.git
58
+ pip install torch torchvision timm opencv-python
36
59
 
37
60
  ## Usage
38
61
 
62
+ To use the plugin, start napari in the activated virtual environment with this terminal command:
63
+
64
+ mamba run -n napari-tmidas napari
65
+
39
66
  You can find the installed plugin here:
40
67
 
41
68
  ![image](https://github.com/user-attachments/assets/504db09a-d66e-49eb-90cd-3237024d9d7a)
42
69
 
43
70
 
44
- ### File converter
71
+ ### Microscopy Image Conversion
45
72
 
46
- You might first want to batch convert microscopy image data. Currently, this plugin supports `.nd2, .lif, .ndpi, .czi` and acquifer data. After launching the file converter, you can scan a folder of your choice for microscopy image data. It will also detect series images that you can preview. Start by selecting an original image in the first column of the table. This allows you to preview or convert.
73
+ You can start this pipeline via `Plugins > T-MIDAS > Batch Microscopy Image Conversion`. Currently, this pipeline supports the conversion of `.nd2, .lif, .ndpi, .czi` and acquifer data. After scanning a folder of your choice for microscopy image data, select a file in the first column of the table and preview and export any image data it contains.
47
74
 
48
75
  ![image](https://github.com/user-attachments/assets/e377ca71-2f30-447d-825e-d2feebf7061b)
49
76
 
77
+ ### Image Processing
50
78
 
51
-
52
- ### File inspector
53
-
54
- 1. After opening `Plugins > T-MIDAS > File selector`, enter the path to the folder containing the images to be processed (currently supports TIF, later also ZARR). You can also filter for filename suffix.
79
+ 1. After opening `Plugins > T-MIDAS > Batch Image Processing`, enter the path to the folder containing the images to be processed (currently supports TIF, later also ZARR). You can also filter for filename suffix.
55
80
 
56
81
  ![image](https://github.com/user-attachments/assets/41ecb689-9abe-4371-83b5-9c5eb37069f9)
57
82
 
@@ -69,11 +94,20 @@ You might first want to batch convert microscopy image data. Currently, this plu
69
94
 
70
95
  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.
71
96
 
72
- ### Label inspector
73
- 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 > Label inspector`, which automatically saves your changes to the existing label image once you click the `Save Changes and Continue` button (bottom right).
97
+ ### Batch Label Inspection
98
+ 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).
74
99
 
75
100
  ![image](https://github.com/user-attachments/assets/0bf8c6ae-4212-449d-8183-e91b23ba740e)
76
101
 
102
+ ### Crop Anything
103
+ 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`
104
+
105
+ ![image](https://github.com/user-attachments/assets/6d72c2a2-1064-4a27-b398-a9b86fcbc443)
106
+
107
+ ### ROI Colocalization
108
+ 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.
109
+
110
+ ![napari-tmidas_coloc_pipeline](https://github.com/user-attachments/assets/2f9022a0-7b88-4588-a448-250f07a634d7)
77
111
 
78
112
 
79
113
  ## Contributing
@@ -6,6 +6,7 @@ except ImportError:
6
6
 
7
7
  from ._label_inspection import label_inspector_widget
8
8
  from ._reader import napari_get_reader
9
+ from ._roi_colocalization import roi_colocalization_analyzer
9
10
  from ._sample_data import make_sample_data
10
11
  from ._writer import write_multiple, write_single_image
11
12
 
@@ -16,4 +17,6 @@ __all__ = (
16
17
  "make_sample_data",
17
18
  "file_selector",
18
19
  "label_inspector_widget",
20
+ "batch_crop_anything_widget",
21
+ "roi_colocalization_analyzer",
19
22
  )