small-fish-gui 2.1.4__py3-none-any.whl → 2.1.5__py3-none-any.whl
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.
- small_fish_gui/__init__.py +2 -2
- small_fish_gui/batch/values.txt +65 -0
- small_fish_gui/gui/napari_visualiser.py +30 -6
- small_fish_gui/interface/settings.json +3 -3
- small_fish_gui/pipeline/detection.py +4 -3
- small_fish_gui/pipeline/testing.ipynb +3636 -0
- small_fish_gui/small_fish_gui.code-workspace +7 -0
- {small_fish_gui-2.1.4.dist-info → small_fish_gui-2.1.5.dist-info}/METADATA +1 -1
- {small_fish_gui-2.1.4.dist-info → small_fish_gui-2.1.5.dist-info}/RECORD +11 -9
- small_fish_gui/interface/testing.ipynb +0 -4354
- {small_fish_gui-2.1.4.dist-info → small_fish_gui-2.1.5.dist-info}/WHEEL +0 -0
- {small_fish_gui-2.1.4.dist-info → small_fish_gui-2.1.5.dist-info}/licenses/LICENSE +0 -0
small_fish_gui/__init__.py
CHANGED
|
@@ -37,8 +37,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
37
37
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
38
38
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
39
39
|
"""
|
|
40
|
-
__version__ = "2.1.
|
|
41
|
-
__wiki__ = "https://github.com/
|
|
40
|
+
__version__ = "2.1.5"
|
|
41
|
+
__wiki__ = "https://github.com/SmallFishGUI/small_fish_gui/wiki"
|
|
42
42
|
|
|
43
43
|
import os, platform
|
|
44
44
|
system_type = platform.system()
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
List of keys for batch 'values' dict instance :
|
|
2
|
+
|
|
3
|
+
Batch_folder
|
|
4
|
+
0
|
|
5
|
+
image_path
|
|
6
|
+
3D stack
|
|
7
|
+
multichannel
|
|
8
|
+
Dense regions deconvolution
|
|
9
|
+
do_cluster_computation
|
|
10
|
+
Segmentation
|
|
11
|
+
Napari correction
|
|
12
|
+
x
|
|
13
|
+
y
|
|
14
|
+
z
|
|
15
|
+
c
|
|
16
|
+
t
|
|
17
|
+
cyto_model_name
|
|
18
|
+
cytoplasm_channel
|
|
19
|
+
cytoplasm_diameter
|
|
20
|
+
nucleus_model_name
|
|
21
|
+
nucleus channel
|
|
22
|
+
nucleus_diameter
|
|
23
|
+
segment_only_nuclei
|
|
24
|
+
show_segmentation
|
|
25
|
+
saving path
|
|
26
|
+
filename
|
|
27
|
+
threshold
|
|
28
|
+
threshold penalty
|
|
29
|
+
channel to compute
|
|
30
|
+
voxel_size_z
|
|
31
|
+
voxel_size_y
|
|
32
|
+
voxel_size_x
|
|
33
|
+
spot_size_z
|
|
34
|
+
spot_size_y
|
|
35
|
+
spot_size_x
|
|
36
|
+
log_kernel_size_z
|
|
37
|
+
log_kernel_size_y
|
|
38
|
+
log_kernel_size_x
|
|
39
|
+
minimum_distance_z
|
|
40
|
+
minimum_distance_y
|
|
41
|
+
minimum_distance_x
|
|
42
|
+
nucleus channel signal
|
|
43
|
+
alpha
|
|
44
|
+
beta
|
|
45
|
+
gamma
|
|
46
|
+
deconvolution_kernel_z
|
|
47
|
+
deconvolution_kernel_y
|
|
48
|
+
deconvolution_kernel_x
|
|
49
|
+
cluster size
|
|
50
|
+
min number of spots
|
|
51
|
+
show_interactive_threshold_selector
|
|
52
|
+
spots_extraction_folder
|
|
53
|
+
spots_filename
|
|
54
|
+
do_spots_csv
|
|
55
|
+
do_spots_excel
|
|
56
|
+
do_spots_feather
|
|
57
|
+
output_folder
|
|
58
|
+
batch_name
|
|
59
|
+
save segmentation
|
|
60
|
+
save detection
|
|
61
|
+
extract spots
|
|
62
|
+
csv
|
|
63
|
+
xlsx
|
|
64
|
+
feather
|
|
65
|
+
2
|
|
@@ -19,6 +19,7 @@ from ..utils import compute_anisotropy_coef
|
|
|
19
19
|
def correct_spots(
|
|
20
20
|
image,
|
|
21
21
|
spots,
|
|
22
|
+
segment_only_nuclei,
|
|
22
23
|
voxel_size= (1,1,1),
|
|
23
24
|
clusters= None,
|
|
24
25
|
spot_cluster_id= None,
|
|
@@ -26,7 +27,7 @@ def correct_spots(
|
|
|
26
27
|
min_spot_number=0,
|
|
27
28
|
cell_label= None,
|
|
28
29
|
nucleus_label= None,
|
|
29
|
-
other_images =[]
|
|
30
|
+
other_images =[],
|
|
30
31
|
):
|
|
31
32
|
"""
|
|
32
33
|
Open Napari viewer for user to visualize and corrects spots, clusters.
|
|
@@ -98,12 +99,32 @@ def correct_spots(
|
|
|
98
99
|
feature_defaults= {"spot_number" : min_spot_number, "cluster_id" : -2, "end" : True} # napari features default will not work with np.nan passing -2 instead.
|
|
99
100
|
)
|
|
100
101
|
|
|
101
|
-
if type(
|
|
102
|
-
cell_label_layer = Viewer.add_labels(cell_label, scale=scale, opacity= 0.2, blending= 'additive')
|
|
103
|
-
if type(nucleus_label) != type(None) :
|
|
102
|
+
if type(nucleus_label) != type(None) :
|
|
104
103
|
nucleus_label_layer = Viewer.add_labels(nucleus_label, scale=scale, opacity= 0.2, blending= 'additive')
|
|
104
|
+
nucleus_label_layer.preserve_labels = True
|
|
105
|
+
labels_layer_list = [nucleus_label_layer]
|
|
105
106
|
|
|
107
|
+
if type(cell_label) != type(None) and not segment_only_nuclei :
|
|
108
|
+
cell_label_layer = Viewer.add_labels(cell_label, scale=scale, opacity= 0.2, blending= 'additive')
|
|
109
|
+
cell_label_layer.preserve_labels = True
|
|
110
|
+
labels_layer_list += [cell_label_layer]
|
|
111
|
+
|
|
106
112
|
#Adding widget
|
|
113
|
+
if type(nucleus_label) != type(None) :
|
|
114
|
+
label_reseter = SegmentationReseter(labels_layer_list)
|
|
115
|
+
label_eraser = CellLabelEraser(labels_layer_list)
|
|
116
|
+
label_picker = FreeLabelPicker(labels_layer_list)
|
|
117
|
+
label_reseter = SegmentationReseter(labels_layer_list)
|
|
118
|
+
changes_applier = ChangesPropagater(labels_layer_list)
|
|
119
|
+
|
|
120
|
+
buttons_container = widgets.Container(widgets=[label_picker.widget, label_reseter.widget], labels=False, layout='horizontal')
|
|
121
|
+
changes_applier = widgets.Container(widgets=[changes_applier.widget], labels=False, layout='horizontal')
|
|
122
|
+
seg_tools_container = widgets.Container(
|
|
123
|
+
widgets = [buttons_container, changes_applier, label_eraser.widget],
|
|
124
|
+
labels=False,
|
|
125
|
+
)
|
|
126
|
+
Viewer.window.add_dock_widget(seg_tools_container, name='Segmentation', area='left')
|
|
127
|
+
|
|
107
128
|
if type(clusters) != type(None) :
|
|
108
129
|
initialize_all_cluster_wizards(
|
|
109
130
|
single_layer=single_layer,
|
|
@@ -131,7 +152,8 @@ def correct_spots(
|
|
|
131
152
|
widgets = [updater_container, buttons_container],
|
|
132
153
|
labels=False,
|
|
133
154
|
)
|
|
134
|
-
|
|
155
|
+
|
|
156
|
+
Viewer.window.add_dock_widget(tools_container, name='Cluster', area='left', tabify=True)
|
|
135
157
|
|
|
136
158
|
Viewer.show(block=False)
|
|
137
159
|
napari.run()
|
|
@@ -158,8 +180,10 @@ def correct_spots(
|
|
|
158
180
|
new_min_spot_number = None
|
|
159
181
|
|
|
160
182
|
#Preparing updated segmentation masks
|
|
161
|
-
if type(cell_label) != type(None) and not
|
|
183
|
+
if type(cell_label) != type(None) and not segment_only_nuclei :
|
|
162
184
|
new_cell_label = cell_label_layer.data
|
|
185
|
+
elif type(nucleus_label) != type(None) and segment_only_nuclei :
|
|
186
|
+
new_cell_label = nucleus_label_layer.data
|
|
163
187
|
else :
|
|
164
188
|
new_cell_label = cell_label
|
|
165
189
|
if type(nucleus_label) != type(None) :
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"working_directory": "/
|
|
2
|
+
"working_directory": "/home/floric/Documents/fish_images",
|
|
3
3
|
"do_background_removal": false,
|
|
4
4
|
"background_channel": 0,
|
|
5
5
|
"multichannel_stack": true,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"do_dense_regions_deconvolution": false,
|
|
33
33
|
"do_cluster": false,
|
|
34
34
|
"show_napari_corrector": true,
|
|
35
|
-
"interactive_threshold_selector":
|
|
35
|
+
"interactive_threshold_selector": true,
|
|
36
36
|
"alpha": 0.5,
|
|
37
37
|
"beta": 1.0,
|
|
38
38
|
"gamma": 3.0,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"coloc_range": 400,
|
|
42
42
|
"do_csv": false,
|
|
43
43
|
"do_excel": false,
|
|
44
|
-
"spot_extraction_folder": "/home/floric",
|
|
44
|
+
"spot_extraction_folder": "/home/floric/my_projects/small_fish_gui",
|
|
45
45
|
"voxel_size": [
|
|
46
46
|
1,
|
|
47
47
|
2,
|
|
@@ -662,18 +662,19 @@ def launch_detection(
|
|
|
662
662
|
spots_cluster_id = None
|
|
663
663
|
|
|
664
664
|
if user_parameters['show_napari_corrector'] :
|
|
665
|
-
|
|
665
|
+
|
|
666
666
|
spots, clusters, new_cluster_radius, new_min_spot_number, nucleus_label, cell_label = correct_spots(
|
|
667
667
|
image,
|
|
668
668
|
spots,
|
|
669
|
-
user_parameters['voxel_size'],
|
|
669
|
+
voxel_size=user_parameters['voxel_size'],
|
|
670
670
|
clusters=clusters,
|
|
671
671
|
spot_cluster_id = spots_cluster_id,
|
|
672
672
|
cluster_size= user_parameters.get('cluster_size'),
|
|
673
673
|
min_spot_number= user_parameters.setdefault('min_number_of_spots', 0),
|
|
674
674
|
cell_label=cell_label,
|
|
675
675
|
nucleus_label=nucleus_label,
|
|
676
|
-
other_images=other_image
|
|
676
|
+
other_images=other_image,
|
|
677
|
+
segment_only_nuclei=user_parameters['segment_only_nuclei'],
|
|
677
678
|
)
|
|
678
679
|
|
|
679
680
|
if type(new_cluster_radius) != type(None) :
|