small-fish-gui 1.9.0__py3-none-any.whl → 1.9.2__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 +1 -1
- small_fish_gui/batch/pipeline.py +4 -2
- small_fish_gui/gui/napari_visualiser.py +3 -5
- small_fish_gui/pipeline/detection.py +14 -7
- {small_fish_gui-1.9.0.dist-info → small_fish_gui-1.9.2.dist-info}/METADATA +1 -1
- {small_fish_gui-1.9.0.dist-info → small_fish_gui-1.9.2.dist-info}/RECORD +8 -8
- {small_fish_gui-1.9.0.dist-info → small_fish_gui-1.9.2.dist-info}/WHEEL +0 -0
- {small_fish_gui-1.9.0.dist-info → small_fish_gui-1.9.2.dist-info}/licenses/LICENSE +0 -0
small_fish_gui/__init__.py
CHANGED
small_fish_gui/batch/pipeline.py
CHANGED
|
@@ -120,7 +120,7 @@ def batch_pipeline(
|
|
|
120
120
|
image, other_image = prepare_image_detection(map_, parameters)
|
|
121
121
|
nucleus_signal = get_nucleus_signal(image, other_image, parameters)
|
|
122
122
|
try : # Catch error raised if user enter a spot size too small compare to voxel size
|
|
123
|
-
parameters, frame_result, spots, clusters = launch_detection(
|
|
123
|
+
parameters, frame_result, spots, clusters, spot_cluster_id = launch_detection(
|
|
124
124
|
image,
|
|
125
125
|
other_image,
|
|
126
126
|
parameters,
|
|
@@ -139,7 +139,7 @@ def batch_pipeline(
|
|
|
139
139
|
if parameters['save detection'] :
|
|
140
140
|
if parameters['do_cluster_computation'] :
|
|
141
141
|
if len(clusters) > 0 :
|
|
142
|
-
spots_list = [spots, clusters[
|
|
142
|
+
spots_list = [spots, clusters[:,:-2]]
|
|
143
143
|
else : spots_list = [spots]
|
|
144
144
|
else : spots_list = [spots]
|
|
145
145
|
output_spot_tiffvisual(
|
|
@@ -166,6 +166,7 @@ def batch_pipeline(
|
|
|
166
166
|
user_parameters=parameters,
|
|
167
167
|
image=image,
|
|
168
168
|
spots=spots,
|
|
169
|
+
cluster_id=spot_cluster_id,
|
|
169
170
|
nucleus_label= nucleus_label,
|
|
170
171
|
cell_label= cytoplasm_label,
|
|
171
172
|
)
|
|
@@ -178,6 +179,7 @@ def batch_pipeline(
|
|
|
178
179
|
nucleus_signal = nucleus_signal,
|
|
179
180
|
spots=spots,
|
|
180
181
|
clusters=clusters,
|
|
182
|
+
spots_cluster_id=spot_cluster_id,
|
|
181
183
|
nucleus_label = nucleus_label,
|
|
182
184
|
cell_label= cytoplasm_label,
|
|
183
185
|
user_parameters=parameters,
|
|
@@ -123,7 +123,7 @@ def __update_clusters(new_clusters: np.ndarray, spots: np.ndarray, voxel_size, c
|
|
|
123
123
|
Outdated. previous behaviour.
|
|
124
124
|
"""
|
|
125
125
|
if len(new_clusters) == 0 : return new_clusters
|
|
126
|
-
if len(spots) == 0 : return np.empty(shape=(0,2+len(voxel_size)))
|
|
126
|
+
if len(spots) == 0 : return np.empty(shape=(0,2+len(voxel_size)), dtype=int)
|
|
127
127
|
|
|
128
128
|
if len(new_clusters[0]) in [2,3] :
|
|
129
129
|
new_clusters = np.concatenate([
|
|
@@ -198,7 +198,7 @@ def correct_spots(
|
|
|
198
198
|
if len(clusters) > 0 :
|
|
199
199
|
clusters_coordinates = clusters[:, :dim]
|
|
200
200
|
else :
|
|
201
|
-
clusters_coordinates = np.empty(shape=(0,3))
|
|
201
|
+
clusters_coordinates = np.empty(shape=(0,3), dtype=int)
|
|
202
202
|
Viewer.add_points( # cluster; this layer can be update by user.
|
|
203
203
|
clusters_coordinates,
|
|
204
204
|
size = 10,
|
|
@@ -222,14 +222,13 @@ def correct_spots(
|
|
|
222
222
|
if type(clusters) != type(None) :
|
|
223
223
|
new_clusters = np.round(Viewer.layers['foci'].data).astype(int)
|
|
224
224
|
if len(new_clusters) == 0 :
|
|
225
|
-
new_clusters = np.empty(shape=(0,5))
|
|
225
|
+
new_clusters = np.empty(shape=(0,5), dtype=int)
|
|
226
226
|
new_cluster_id = -1 * np.ones(len(new_spots))
|
|
227
227
|
new_spots = np.concatenate([new_spots, new_cluster_id], axis=1)
|
|
228
228
|
else :
|
|
229
229
|
new_cluster_id = Viewer.layers['foci'].features.to_numpy()
|
|
230
230
|
new_clusters = np.concatenate([new_clusters, new_cluster_id], axis=1)
|
|
231
231
|
|
|
232
|
-
print("After concatenate new clusters shape = {0}".format(new_clusters.shape))
|
|
233
232
|
|
|
234
233
|
new_spots, new_clusters = _update_clusters(
|
|
235
234
|
old_spots =spots,
|
|
@@ -243,7 +242,6 @@ def correct_spots(
|
|
|
243
242
|
null_value= -2
|
|
244
243
|
)
|
|
245
244
|
|
|
246
|
-
print("After _update_cluster\nnew_clusters shape = {0}\nnew_spots shape = {1}".format(new_clusters.shape, new_spots.shape))
|
|
247
245
|
|
|
248
246
|
else : new_clusters = None
|
|
249
247
|
|
|
@@ -183,7 +183,7 @@ def cluster_detection(spots, voxel_size, radius = 350, nb_min_spots = 4, keys_to
|
|
|
183
183
|
elif isinstance(keys_to_compute, list) : pass
|
|
184
184
|
else : raise TypeError("Wrong type for keys_to_compute. Should be list[str] or str. It is {0}".format(type(keys_to_compute)))
|
|
185
185
|
if len(spots) == 0 :
|
|
186
|
-
res = {'clustered_spots' :
|
|
186
|
+
res = {'clustered_spots' : np.empty(shape=(0,len(voxel_size) + 1), dtype=int), 'clusters' : np.empty(shape=(0,len(voxel_size) + 2), dtype=int), 'clustered_spots_dataframe' : pd.DataFrame(columns= ["id", "cluster_id", "z", "y", "x"]), 'clusters_dataframe' : pd.DataFrame(columns= ["id", "z", "y", "x", "spot_number"])}
|
|
187
187
|
return {key : res[key] for key in keys_to_compute}
|
|
188
188
|
else : res = {}
|
|
189
189
|
voxel_size = tuple([int(d) for d in voxel_size])
|
|
@@ -192,7 +192,7 @@ def cluster_detection(spots, voxel_size, radius = 350, nb_min_spots = 4, keys_to
|
|
|
192
192
|
|
|
193
193
|
if 'clustered_spots' in keys_to_compute :
|
|
194
194
|
res['clustered_spots'] = clustered_spots
|
|
195
|
-
|
|
195
|
+
voxel_size
|
|
196
196
|
if 'clusters' in keys_to_compute :
|
|
197
197
|
res['clusters'] = clusters
|
|
198
198
|
|
|
@@ -407,9 +407,8 @@ def launch_cell_extraction(
|
|
|
407
407
|
|
|
408
408
|
if do_clustering :
|
|
409
409
|
if len(clusters) > 0 :
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
clustered_spots = spots[spots_cluster_id != -1]
|
|
410
|
+
free_spots = spots[spots_cluster_id == -1].astype(int)
|
|
411
|
+
clustered_spots = spots[spots_cluster_id != -1].astype(int)
|
|
413
412
|
|
|
414
413
|
other_coords = {
|
|
415
414
|
'clusters_coords' : clusters,
|
|
@@ -471,6 +470,13 @@ def launch_cell_extraction(
|
|
|
471
470
|
free_spots_coords = cell.get('free_spots')
|
|
472
471
|
signal = cell['image']
|
|
473
472
|
|
|
473
|
+
if do_clustering :
|
|
474
|
+
if len(clusters) > 0 :
|
|
475
|
+
compute_foci = True
|
|
476
|
+
else :
|
|
477
|
+
compute_foci = False
|
|
478
|
+
else : compute_foci = False
|
|
479
|
+
|
|
474
480
|
with np.errstate(divide= 'ignore', invalid= 'ignore') :
|
|
475
481
|
features = classification.compute_features(
|
|
476
482
|
cell_mask=cell_mask,
|
|
@@ -485,7 +491,7 @@ def launch_cell_extraction(
|
|
|
485
491
|
compute_area=True,
|
|
486
492
|
compute_dispersion=True,
|
|
487
493
|
compute_distance=True,
|
|
488
|
-
compute_foci=
|
|
494
|
+
compute_foci= compute_foci,
|
|
489
495
|
compute_intranuclear=True,
|
|
490
496
|
compute_protrusion=False,
|
|
491
497
|
compute_topography=True
|
|
@@ -535,7 +541,8 @@ def launch_cell_extraction(
|
|
|
535
541
|
|
|
536
542
|
features = [acquisition_id, cell_id, cell_bbox] + features
|
|
537
543
|
features += [rna_coords, foci_coords, clustered_spots_coords, free_spots_coords]
|
|
538
|
-
features += [len(clustered_spots_coords)
|
|
544
|
+
features += [len(clustered_spots_coords) if type(clustered_spots_coords) != type(None) else None]
|
|
545
|
+
features += [len(free_spots_coords) if type(free_spots_coords) != type(None) else None]
|
|
539
546
|
|
|
540
547
|
result_frame = pd.concat([
|
|
541
548
|
result_frame,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: small_fish_gui
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2
|
|
4
4
|
Summary: Small Fish is a python application for the analysis of smFish images. It provides a ready to use graphical interface to combine famous python packages for cell analysis without any need for coding.
|
|
5
5
|
Project-URL: Homepage, https://github.com/2Echoes/small_fish
|
|
6
6
|
Project-URL: Issues, https://github.com/2Echoes/small_fish/issues
|
|
@@ -2,7 +2,7 @@ small_fish_gui/.readthedocs.yaml,sha256=r2T0e_In8X8l0_ZwgPvuoWQ9c0PE9bSpFzV2W6Ez
|
|
|
2
2
|
small_fish_gui/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
|
|
3
3
|
small_fish_gui/README.md,sha256=4RpEXKZW5vH6sUWeZb88yr1TLLPi20PqOk7KdA9O9Hk,4234
|
|
4
4
|
small_fish_gui/Segmentation example.jpg,sha256=opfiSbjmfF6z8kBs08sg_FNR2Om0AcMPU5sSwSLHdoQ,215038
|
|
5
|
-
small_fish_gui/__init__.py,sha256=
|
|
5
|
+
small_fish_gui/__init__.py,sha256=CweT7xLrnaM2nluNztpNf3JaNncL7gHLFz2SvVG1iZs,1941
|
|
6
6
|
small_fish_gui/__main__.py,sha256=jjFNnf-l4jCJI16epq2KOaKmgtUAe9lSNdPj5fpxrDk,1143
|
|
7
7
|
small_fish_gui/hints.py,sha256=_AhC-Th36ELxinjMyGtjIqJfZkISPr1YwhQ9ifD9Kj4,1926
|
|
8
8
|
small_fish_gui/napari_detection_example.png,sha256=l5EZlrbXemLiGqb5inSVsD6Kko1Opz528-go-fBfrw8,977350
|
|
@@ -12,7 +12,7 @@ small_fish_gui/.github/workflows/python-publish.yml,sha256=5Ltnuhw9TevhzndlBmdUg
|
|
|
12
12
|
small_fish_gui/batch/__init__.py,sha256=ku2_Yate-UG89Q0BmE2B9kFV4kOz-u9Lf2lj6VsdFXs,127
|
|
13
13
|
small_fish_gui/batch/input.py,sha256=mqnP8LBhyNbtlcqjVlUiVeuHw4YxOX3GgzJbq03isKE,1477
|
|
14
14
|
small_fish_gui/batch/integrity.py,sha256=jIJH0c_M_7gSET32iKWEznHIad0OwPNvJurA9rivTJ0,4851
|
|
15
|
-
small_fish_gui/batch/pipeline.py,sha256=
|
|
15
|
+
small_fish_gui/batch/pipeline.py,sha256=EUUY0L6JvUYyF1SqJ1KdQHKKR1jhxsHSCyBm7nnB7mU,9157
|
|
16
16
|
small_fish_gui/batch/prompt.py,sha256=Ob6Cml3IJTInMJ_9kSwLOKzwna7igbk91D2eaA7I1bo,18849
|
|
17
17
|
small_fish_gui/batch/test.py,sha256=q04a1YstnDsxy2Bi5563BfcOU-O3VPE9c5WSJjvFjMg,211
|
|
18
18
|
small_fish_gui/batch/update.py,sha256=AFG2oW5zfbNPJbb1jqbkMexPB8NoR4ZoftqpO3cAsok,5042
|
|
@@ -23,7 +23,7 @@ small_fish_gui/gui/_napari_widgets.py,sha256=8IMppaPZU37ANdZwTZOhwqCEly0hokzYL7U
|
|
|
23
23
|
small_fish_gui/gui/animation.py,sha256=rnNP5FPp06Hu-R33c4AVTCknALBbxT2YlsKFCXHAp9k,981
|
|
24
24
|
small_fish_gui/gui/help_module.py,sha256=XvGCNIcEGRG8ESJ55poCPhBM60Bl4w_ZxoVp-Ev6lTo,9612
|
|
25
25
|
small_fish_gui/gui/layout.py,sha256=cA8ddzwbxVqTl5-VOoKvYKP0Fki17x2dczidSdW3ayA,14186
|
|
26
|
-
small_fish_gui/gui/napari_visualiser.py,sha256=
|
|
26
|
+
small_fish_gui/gui/napari_visualiser.py,sha256=BSoLZtBBdbL407xrio3ZzaU_ZdP7I2T34-zQFntxwEs,14539
|
|
27
27
|
small_fish_gui/gui/prompts.py,sha256=akphsDghaUngmqz3yBpyMPeTrRfye-Flkyixc9JSs74,15406
|
|
28
28
|
small_fish_gui/gui/testing.ipynb,sha256=5xoMDR2a3aa4q8KoEoJ22HrcWDyHkCF4arVeVVm7ovs,71500
|
|
29
29
|
small_fish_gui/gui/screenshot/general_help_screenshot.png,sha256=X4E6Td5f04K-pBUPDaBJRAE3D5b8fuEdiAUKhkIDr-0,54210
|
|
@@ -39,14 +39,14 @@ small_fish_gui/pipeline/_custom_errors.py,sha256=tQ-AUhgzIFpK30AZiQQrtHCHyGVRDdA
|
|
|
39
39
|
small_fish_gui/pipeline/_preprocess.py,sha256=IrkQp_YCVFPrwElCEn-alpVChfLbR_0KAdb0WV2BfKI,15089
|
|
40
40
|
small_fish_gui/pipeline/_signaltonoise.py,sha256=7A9t7xu7zghI6cr201Ldm-LjJ5NOuP56VSeJ8KIzcUo,8497
|
|
41
41
|
small_fish_gui/pipeline/actions.py,sha256=7DmChUin3Zct7utVKj4zRpSMu4i5m2ctheOevbNCxa8,15745
|
|
42
|
-
small_fish_gui/pipeline/detection.py,sha256=
|
|
42
|
+
small_fish_gui/pipeline/detection.py,sha256=X2SmfHTnb2322PimxkXJ9gEco2cCZQ3eCKhfCRzk6hg,34953
|
|
43
43
|
small_fish_gui/pipeline/main.py,sha256=2Oi6wz9jG9LA2gclTkIeFolJ4AON5AN6fFldOQsaXGw,4829
|
|
44
44
|
small_fish_gui/pipeline/segmentation.py,sha256=MtGOcGWJPaJo7oa0YG2qB7LwDLIogJHCioSQxFecUqc,19911
|
|
45
45
|
small_fish_gui/pipeline/spots.py,sha256=9hNOGnOZhrtrIORt8UGBcI-SGCh1XftcUGerkBwN-QY,2201
|
|
46
46
|
small_fish_gui/pipeline/test.py,sha256=w4ZMGDmUDXxVgWTlZ2TKw19W8q5gcE9gLMKe0SWnRrw,2827
|
|
47
47
|
small_fish_gui/pipeline/testing.ipynb,sha256=eMynROxPIa5uW6E2nb_CwA4X4Peiqa4QS68JcADrAnM,76479
|
|
48
48
|
small_fish_gui/pipeline/utils.py,sha256=run6qtqCAe_mFnE3o1CnmF1xBBmK3ydgc8-jOV9P-_w,448
|
|
49
|
-
small_fish_gui-1.9.
|
|
50
|
-
small_fish_gui-1.9.
|
|
51
|
-
small_fish_gui-1.9.
|
|
52
|
-
small_fish_gui-1.9.
|
|
49
|
+
small_fish_gui-1.9.2.dist-info/METADATA,sha256=Bq71I80yaGJukLnxynPExQGh5i8hwxHKMfi2sreR0YQ,2567
|
|
50
|
+
small_fish_gui-1.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
51
|
+
small_fish_gui-1.9.2.dist-info/licenses/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
|
|
52
|
+
small_fish_gui-1.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|