small-fish-gui 1.3.5__py3-none-any.whl → 1.5.0__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.
Files changed (35) hide show
  1. small_fish_gui/.readthedocs.yaml +21 -0
  2. small_fish_gui/README.md +2 -3
  3. small_fish_gui/__init__.py +1 -1
  4. small_fish_gui/batch/__init__.py +5 -0
  5. small_fish_gui/batch/input.py +62 -0
  6. small_fish_gui/batch/integrity.py +158 -0
  7. small_fish_gui/batch/output.py +0 -0
  8. small_fish_gui/batch/pipeline.py +218 -0
  9. small_fish_gui/batch/prompt.py +428 -0
  10. small_fish_gui/batch/test.py +10 -0
  11. small_fish_gui/batch/update.py +132 -0
  12. small_fish_gui/batch/utils.py +66 -0
  13. small_fish_gui/batch/values.py +3 -0
  14. small_fish_gui/batch/values.txt +65 -0
  15. small_fish_gui/docs/conf.py +1 -0
  16. small_fish_gui/gui/animation.py +24 -15
  17. small_fish_gui/gui/layout.py +28 -7
  18. small_fish_gui/gui/prompts.py +11 -9
  19. small_fish_gui/interface/output.py +8 -4
  20. small_fish_gui/pipeline/__init__.py +21 -0
  21. small_fish_gui/pipeline/_napari_wrapper.py +63 -90
  22. small_fish_gui/pipeline/_preprocess.py +86 -28
  23. small_fish_gui/pipeline/_segmentation.py +165 -16
  24. small_fish_gui/pipeline/actions.py +6 -1
  25. small_fish_gui/pipeline/detection.py +75 -16
  26. small_fish_gui/pipeline/main.py +12 -5
  27. small_fish_gui/pipeline/utils.py +16 -0
  28. small_fish_gui/utils.py +6 -1
  29. {small_fish_gui-1.3.5.dist-info → small_fish_gui-1.5.0.dist-info}/METADATA +1 -1
  30. small_fish_gui-1.5.0.dist-info/RECORD +52 -0
  31. small_fish_gui/gui/batch.py +0 -312
  32. small_fish_gui/gui/test.py +0 -5
  33. small_fish_gui-1.3.5.dist-info/RECORD +0 -39
  34. {small_fish_gui-1.3.5.dist-info → small_fish_gui-1.5.0.dist-info}/WHEEL +0 -0
  35. {small_fish_gui-1.3.5.dist-info → small_fish_gui-1.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,12 +1,16 @@
1
- #### New version for main.py
1
+ """
2
+ This script is called when software starts; it is the main loop.
3
+ """
4
+
2
5
  import pandas as pd
3
6
  import PySimpleGUI as sg
4
7
  from ..gui import hub_prompt
5
8
  from .actions import add_detection, save_results, compute_colocalisation, delete_acquisitions
6
9
  from ._preprocess import clean_unused_parameters_cache
10
+ from ..batch import batch_promp
7
11
 
8
12
  #'Global' parameters
9
- user_parameters = dict() # Very important object containg all choice from user that will influence the behavior of the main loop.
13
+ user_parameters = dict() # Very important instance containg all choice from user that will influence the behavior of the actions loops.
10
14
  acquisition_id = -1
11
15
  result_df = pd.DataFrame()
12
16
  cell_result_df = pd.DataFrame()
@@ -24,7 +28,6 @@ while True : #Break this loop to close small_fish
24
28
 
25
29
  if event == 'Add detection' :
26
30
  user_parameters = clean_unused_parameters_cache(user_parameters)
27
-
28
31
 
29
32
  new_result_df, new_cell_result_df, acquisition_id, user_parameters, segmentation_done, cytoplasm_label, nucleus_label = add_detection(
30
33
  user_parameters=user_parameters,
@@ -74,8 +77,12 @@ while True : #Break this loop to close small_fish
74
77
  result_df, cell_result_df, coloc_df = delete_acquisitions(selected_acquisitions, result_df, cell_result_df, coloc_df)
75
78
 
76
79
  elif event == "Batch detection" :
77
- #TODO
78
- pass
80
+ result_df, cell_result_df, acquisition_id, user_parameters, segmentation_done, cytoplasm_label,nucleus_label = batch_promp(
81
+ result_df,
82
+ cell_result_df,
83
+ acquisition_id=acquisition_id,
84
+ preset=user_parameters,
85
+ )
79
86
 
80
87
  else :
81
88
  break
@@ -0,0 +1,16 @@
1
+ import numpy as np
2
+
3
+ from math import ceil
4
+ from itertools import zip_longest
5
+ from skimage.measure import regionprops_table
6
+
7
+
8
+ def from_label_get_centeroidscoords(label: np.ndarray):
9
+ """
10
+ Returns
11
+ --------
12
+ centroid : dict{"label": list, "centroid-n": list}
13
+ n should be replace with 1,2.. according to the axe you wish to access."""
14
+
15
+ centroid = regionprops_table(label, properties= ["label","centroid"])
16
+ return centroid
small_fish_gui/utils.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import inspect
2
+ import datetime as dt
2
3
 
3
4
  def check_parameter(**kwargs):
4
5
  """Check dtype of the function's parameters.
@@ -52,4 +53,8 @@ def compute_anisotropy_coef(voxel_size) :
52
53
  return (z_anisotropy, xy_anisotropy, 1)
53
54
 
54
55
  else :
55
- return (voxel_size[0] / voxel_size[1], 1)
56
+ return (voxel_size[0] / voxel_size[1], 1)
57
+
58
+
59
+ def get_datetime():
60
+ return dt.datetime.now().strftime("%Y%m%d %H-%M-%S")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: small_fish_gui
3
- Version: 1.3.5
3
+ Version: 1.5.0
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
@@ -0,0 +1,52 @@
1
+ small_fish_gui/.readthedocs.yaml,sha256=r2T0e_In8X8l0_ZwgPvuoWQ9c0PE9bSpFzV2W6EzW3g,409
2
+ small_fish_gui/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
3
+ small_fish_gui/README.md,sha256=4RpEXKZW5vH6sUWeZb88yr1TLLPi20PqOk7KdA9O9Hk,4234
4
+ small_fish_gui/Segmentation example.jpg,sha256=opfiSbjmfF6z8kBs08sg_FNR2Om0AcMPU5sSwSLHdoQ,215038
5
+ small_fish_gui/__init__.py,sha256=odndmnYjkNSVx0dzWpIehR8-0L2wqayHUx20vUHm-kg,1941
6
+ small_fish_gui/__main__.py,sha256=EzSCoJ7jpSdK-QbzUwQLGZeQWjybNeq8VnCBucA8MZw,1372
7
+ small_fish_gui/napari_detection_example.png,sha256=l5EZlrbXemLiGqb5inSVsD6Kko1Opz528-go-fBfrw8,977350
8
+ small_fish_gui/requirements.txt,sha256=9OMfUAnLdHevq6w_fVoDmVmkSMJeFofkOK_86_fu9C0,321
9
+ small_fish_gui/utils.py,sha256=LM6QW2ono_LIRv7JXIIq7ZxxbDXqBtZ5uR9gjKJfwM8,1903
10
+ small_fish_gui/.github/workflows/python-publish.yml,sha256=5Ltnuhw9TevhzndlBmdUgYMnS73xEAxSyd1u8DHdn5s,1084
11
+ small_fish_gui/batch/__init__.py,sha256=ku2_Yate-UG89Q0BmE2B9kFV4kOz-u9Lf2lj6VsdFXs,127
12
+ small_fish_gui/batch/input.py,sha256=mqnP8LBhyNbtlcqjVlUiVeuHw4YxOX3GgzJbq03isKE,1477
13
+ small_fish_gui/batch/integrity.py,sha256=yzVWBwm4Mxftd1sDziQwKc7d3ALdgWOhkqQrU5-p430,4849
14
+ small_fish_gui/batch/output.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ small_fish_gui/batch/pipeline.py,sha256=uZCwkoiSnTHWAf7C4XPNXg4ldIjbpRiULpzZWq7R1i0,8798
16
+ small_fish_gui/batch/prompt.py,sha256=ZfOyWjmG2AZeB_wwbmqchEp6JM1duXM4GXj12r_eDZk,18788
17
+ small_fish_gui/batch/test.py,sha256=q04a1YstnDsxy2Bi5563BfcOU-O3VPE9c5WSJjvFjMg,211
18
+ small_fish_gui/batch/update.py,sha256=hR4kZ7tP2tvn1tmDa4oJb2e7-SUqN1Lf8JR6OCIOMS8,5037
19
+ small_fish_gui/batch/utils.py,sha256=HgfPwfhqWXOGtCny_nTdGs8csWB1BQp7-hYgrNVLB70,1774
20
+ small_fish_gui/batch/values.py,sha256=C1hRlCpTIDsg89DMKIIW5NUxeK876ODRUuJ2D-mJv6o,1519
21
+ small_fish_gui/batch/values.txt,sha256=PVxzIaaF6DGFRx_CMaStXZI6OrbjNub1-jR3pklXVjc,991
22
+ small_fish_gui/docs/conf.py,sha256=6YU8UEpTenKGMiz7H4aG42Of72_n4uLadDfHJvziqRk,16
23
+ small_fish_gui/gui/__init__.py,sha256=xQ_BfYcnQmKZtx_0leO4OmbkLNLv49ZPqEu_UXMgmDc,867
24
+ small_fish_gui/gui/animation.py,sha256=rnNP5FPp06Hu-R33c4AVTCknALBbxT2YlsKFCXHAp9k,981
25
+ small_fish_gui/gui/general_help_screenshot.png,sha256=X4E6Td5f04K-pBUPDaBJRAE3D5b8fuEdiAUKhkIDr-0,54210
26
+ small_fish_gui/gui/help_module.py,sha256=PmgkkDs7bZ2-po83A_PK9uldQcHjehYmqre21nYb6DQ,9600
27
+ small_fish_gui/gui/layout.py,sha256=oB8Kg6s0rCA8yB4WM8JQY8BpjoPiBqTGb6YoOKDqEA8,13855
28
+ small_fish_gui/gui/mapping_help_screenshot.png,sha256=HcuRh5TYciUogUasza5vZ_QSshaiHsskQK23mh9vQS8,34735
29
+ small_fish_gui/gui/prompts.py,sha256=4QeYIqENmfffLv7255wVhG3N1tsOvRk33_r0prY11uY,13352
30
+ small_fish_gui/gui/segmentation_help_screenshot.png,sha256=rbSgIydT0gZtfMh1qk4mdMbEIyCaakvHmxa2eOrLwO0,118944
31
+ small_fish_gui/interface/__init__.py,sha256=PB86R4Y9kV80aGZ-vP0ZW2KeaCwGbBbCtFCmbN2yl28,275
32
+ small_fish_gui/interface/image.py,sha256=X1L7S5svxUwdoDcI3QM1PbN-c4Nz5w30hixq3IgqSn8,1130
33
+ small_fish_gui/interface/output.py,sha256=5jC37tobgXgsiVJYx3RWaES09I-YFmbXKk65lHflTHc,1867
34
+ small_fish_gui/interface/parameters.py,sha256=lUugD-4W2TZyJF3TH1q70TlktEYhhPtcPCrvxm5Dk50,36
35
+ small_fish_gui/interface/testing.py,sha256=MY5-GcPOUHagcrwR8A7QOjAmjZIDVC8Wz3NibLe3KQw,321
36
+ small_fish_gui/pipeline/__init__.py,sha256=_Ey20GG8fJtqZvixbXNNYX6wTWMnCUArmARPqsNEhuQ,743
37
+ small_fish_gui/pipeline/_colocalisation.py,sha256=peBw2Qz5m6wSejDkDz240UgvWl8ohNelrnmEgznbEsw,9635
38
+ small_fish_gui/pipeline/_custom_errors.py,sha256=tQ-AUhgzIFpK30AZiQQrtHCHyGVRDdAoIjzL0Fk-1pA,43
39
+ small_fish_gui/pipeline/_napari_wrapper.py,sha256=42c_PvKF8D_NW_CWysS4nZ2_Qp5vP9voaAH0bFJjJpc,8099
40
+ small_fish_gui/pipeline/_preprocess.py,sha256=ddocTXwc0vYq2VGUbWYaN9eUiHPyfiCuBpYQ2p6rQ8g,13084
41
+ small_fish_gui/pipeline/_segmentation.py,sha256=gcanidUOC9nULF6UffWLFmfIup-EOMxeckBz7Xldp3I,18852
42
+ small_fish_gui/pipeline/_signaltonoise.py,sha256=7A9t7xu7zghI6cr201Ldm-LjJ5NOuP56VSeJ8KIzcUo,8497
43
+ small_fish_gui/pipeline/actions.py,sha256=_egZlClWAeq6z2sEp2o031dL80ecmmGVDKwnouKTxkU,8185
44
+ small_fish_gui/pipeline/detection.py,sha256=JpT6IDiwyzbMzi2CcBu96RWWwdNbwlXgkVWI4fSr_Mw,34429
45
+ small_fish_gui/pipeline/main.py,sha256=igBR8cQ2H5xmpI2Q0w3DcAHt92wZSYxA0m217a7OG2c,3484
46
+ small_fish_gui/pipeline/spots.py,sha256=yHvqf1eD25UltELpzcouYXhLkxiXI_mOL1ANSzXK5pw,1907
47
+ small_fish_gui/pipeline/test.py,sha256=w4ZMGDmUDXxVgWTlZ2TKw19W8q5gcE9gLMKe0SWnRrw,2827
48
+ small_fish_gui/pipeline/utils.py,sha256=run6qtqCAe_mFnE3o1CnmF1xBBmK3ydgc8-jOV9P-_w,448
49
+ small_fish_gui-1.5.0.dist-info/METADATA,sha256=TdTS-eCK_0wDVkBxz7RPNSUp2F9eYzoGwDIJpWawugY,2567
50
+ small_fish_gui-1.5.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
51
+ small_fish_gui-1.5.0.dist-info/licenses/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
52
+ small_fish_gui-1.5.0.dist-info/RECORD,,
@@ -1,312 +0,0 @@
1
- import os
2
- import numpy as np
3
- import PySimpleGUI as sg
4
- import bigfish.stack as stack
5
- import czifile as czi
6
-
7
- from .layout import _segmentation_layout, _detection_layout, _input_parameters_layout, _ask_channel_map_layout
8
-
9
-
10
- from time import sleep
11
-
12
- def get_images(filename:str) :
13
- """returns filename if is image else return None"""
14
-
15
- supported_types = ('.tiff', '.tif', '.png', '.czi')
16
- if filename.endswith(supported_types) :
17
- return [filename]
18
- else :
19
- return None
20
-
21
-
22
- def get_files(path) :
23
-
24
- filelist = os.listdir(path)
25
- filelist = list(map(get_images,filelist))
26
-
27
- while None in filelist : filelist.remove(None)
28
-
29
- return filelist
30
-
31
- def extract_files(filenames: list) :
32
- return sum(filenames,[])
33
-
34
- def check_file(filename:str) :
35
-
36
- if filename.endswith('.czi') :
37
- image = czi.imread(filename)
38
- else :
39
- image = stack.read_image(filename)
40
-
41
- image = np.squeeze(image)
42
-
43
- return image.shape
44
-
45
- def sanity_check(
46
- filename_list: list,
47
- batch_folder : str,
48
- window : sg.Window,
49
- progress_bar: sg.ProgressBar,
50
- ) :
51
-
52
- filenumber = len(filename_list)
53
- if filenumber == 0 :
54
- print("No file to check")
55
- progress_bar.update(current_count= 0, bar_color=('gray','gray'))
56
- return None
57
- else :
58
- print("{0} files to check".format(filenumber))
59
- progress_bar.update(current_count=0, max= filenumber)
60
- ref_shape = check_file(batch_folder + '/' + filename_list[0])
61
-
62
- print("Starting sanity check. This could take some time...")
63
- for i, file in enumerate(filename_list) :
64
- progress_bar.update(current_count= i+1, bar_color=('green','gray'))
65
- shape = check_file(batch_folder + '/' + file)
66
-
67
- if len(shape) != len(ref_shape) : #then dimension missmatch
68
- print("Different number of dimensions found : {0}, {1}".format(len(ref_shape), len(shape)))
69
- progress_bar.update(current_count=filenumber, bar_color=('red','black'))
70
- window= window.refresh()
71
- break
72
-
73
- window= window.refresh()
74
-
75
- print("Sanity check completed.")
76
- return None if len(shape) != len(ref_shape) else shape
77
-
78
-
79
- def get_elmt_from_key(Tab_elmt:sg.Tab, key) -> sg.Element:
80
- elmt_list = sum(Tab_elmt.Rows,[])
81
- for elmt in elmt_list :
82
- if elmt.Key == key : return elmt
83
- raise KeyError("{0} key not found amongst {1}.".format(key, [elmt.Key for elmt in elmt_list]))
84
-
85
- def update_detection_tab(
86
- tab_elmt:sg.Tab,
87
- is_multichannel,
88
- is_3D,
89
- do_dense_region_deconvolution,
90
- do_clustering
91
- ) :
92
-
93
- #Acess elements
94
- ##Detection
95
- channel_to_compute = get_elmt_from_key(tab_elmt, key= 'channel to compute')
96
- voxel_size_z = get_elmt_from_key(tab_elmt, key= 'voxel_size_z')
97
- spot_size_z = get_elmt_from_key(tab_elmt, key= 'spot_size_z')
98
- log_kernel_size_z = get_elmt_from_key(tab_elmt, key= 'log_kernel_size_z')
99
- minimum_distance_z = get_elmt_from_key(tab_elmt, key= 'minimum_distance_z')
100
-
101
- ##Dense regions deconvolution
102
- alpha = get_elmt_from_key(tab_elmt, key= 'alpha')
103
- beta = get_elmt_from_key(tab_elmt, key= 'beta')
104
- gamma = get_elmt_from_key(tab_elmt, key= 'gamma')
105
- deconvolution_kernel_z = get_elmt_from_key(tab_elmt, key= 'deconvolution_kernel_z')
106
- cluster_size = get_elmt_from_key(tab_elmt, key= 'cluster size')
107
- min_number_of_spot = get_elmt_from_key(tab_elmt, key= 'min number of spots')
108
- nucleus_channel_signal = get_elmt_from_key(tab_elmt, key= 'nucleus channel signal')
109
- interactive_threshold_selector = get_elmt_from_key(tab_elmt, key= 'Interactive threshold selector')
110
-
111
- update_dict={
112
- 'is_3D' : is_3D,
113
- 'is_multichannel' : is_multichannel,
114
- 'do_dense_region_deconvolution' : do_dense_region_deconvolution,
115
- 'do_clustering' : do_clustering,
116
- 'always_hidden' : False
117
- }
118
-
119
- list_dict={
120
- 'is_3D' : [voxel_size_z, spot_size_z, log_kernel_size_z, minimum_distance_z, deconvolution_kernel_z],
121
- 'is_multichannel' : [channel_to_compute, nucleus_channel_signal],
122
- 'do_dense_region_deconvolution' : [alpha,beta,gamma],
123
- 'do_clustering' : [cluster_size, min_number_of_spot],
124
- 'always_hidden' : [interactive_threshold_selector]
125
-
126
- }
127
-
128
- for key, enabled in update_dict.items() :
129
- for elmt in list_dict.get(key) :
130
- elmt.update(disabled=not enabled)
131
-
132
-
133
-
134
- def update_segmentation_tab(tab_elmt : sg.Tab, do_segmentation, is_multichannel) : #TODO
135
-
136
- #Access elements
137
- cytoplasm_channel_elmt = get_elmt_from_key(tab_elmt, key= 'cytoplasm channel')
138
- nucleus_channel_elmt = get_elmt_from_key(tab_elmt, key= 'nucleus channel')
139
-
140
- #Update values
141
- tab_elmt.update(visible=do_segmentation)
142
- cytoplasm_channel_elmt.update(disabled = not is_multichannel)
143
- nucleus_channel_elmt.update(disabled = not is_multichannel)
144
-
145
- def update_map_tab() :
146
- #TODO
147
- pass
148
-
149
- def batch_promp() :
150
-
151
- files_values = [[]]
152
-
153
-
154
- #LOAD FILES
155
- files_table = sg.Table(values=files_values, headings=['Filenames'], col_widths=100, max_col_width= 200, def_col_width=100, num_rows= 10, auto_size_columns=False)
156
-
157
- #Start&Stop
158
- start_button =sg.Button('Start', button_color= 'green', disabled= True)
159
- stop_button = sg.Button('Cancel', button_color= 'red')
160
-
161
- #DIMENSION SANITY
162
- sanity_progress = sg.ProgressBar(10, size_px=(500,10))
163
- sanity_check_button = sg.Button(
164
- 'Check',
165
- tooltip= "Will check that all files loaded have the same dimension number and that small fish is able to open them.",
166
- pad=(10,0))
167
- sanity_header = sg.Text("Dimension sanity", font=('bold',15), pad=(0,10))
168
- dimension_number_text = sg.Text("Dimension number : unknown")
169
-
170
- #Input tab
171
- input_layout = _input_parameters_layout(
172
- ask_for_segmentation=True,
173
- is_3D_stack_preset=False,
174
- time_stack_preset=False,
175
- multichannel_preset=False,
176
- do_dense_regions_deconvolution_preset=False,
177
- do_clustering_preset=False,
178
- do_Napari_correction=False,
179
- do_segmentation_preset=False,
180
- )
181
- input_layout += [[sg.Button('Ok')]]
182
- input_tab = sg.Tab("Input", input_layout)
183
-
184
- #Maptab
185
- map_layout = _ask_channel_map_layout(
186
- shape=(0,1,2,3,4),
187
- is_3D_stack=True,
188
- is_time_stack=True,
189
- multichannel=True,
190
- )
191
- last_shape_read = sg.Text("Last shape read : None")
192
- auto_map = sg.Button("auto-map", disabled=True, pad=(10,0))
193
- map_layout += [[last_shape_read, auto_map]]
194
- map_tab = sg.Tab("Map", map_layout)
195
-
196
- #Segmentation tab
197
- segmentation_layout = _segmentation_layout(multichannel=True, cytoplasm_model_preset='cyto3')
198
- segmentation_tab = sg.Tab("Segmentation", segmentation_layout, visible=False)
199
-
200
- #Detection tab
201
- detection_layout = _detection_layout(
202
- is_3D_stack=True,
203
- is_multichannel=True,
204
- do_clustering=True,
205
- do_dense_region_deconvolution=True,
206
- do_segmentation=True,
207
- )
208
-
209
-
210
- detection_tab = sg.Tab("Detection", detection_layout)
211
-
212
-
213
-
214
- #TABS
215
- _tab_group = sg.TabGroup([[input_tab, map_tab, segmentation_tab, detection_tab]], enable_events=True)
216
- tab_group = sg.Column( #Allow the tab to be scrollable
217
- [[_tab_group]],
218
- scrollable=True,
219
- vertical_scroll_only=True,
220
- pad=(150,5)
221
- )
222
- tab_dict= {
223
- "Input" : input_tab,
224
- "Segmentation" : segmentation_tab,
225
- "Detection" : detection_tab,
226
- "Map" : map_tab,
227
- }
228
-
229
- layout = [
230
- [sg.Text("Batch Processing", font=('bold',20), pad=((300,0),(0,2)))],
231
- [sg.Text("Select a folder : "), sg.FolderBrowse(initial_folder=os.getcwd(), key='Batch_folder'), sg.Button('Load')],
232
- [files_table],
233
- [sanity_header, sanity_check_button, sanity_progress],
234
- [dimension_number_text],
235
- [tab_group],
236
- [sg.Output(size=(100,10), pad=(30,10))],
237
- [start_button, stop_button],
238
- ]
239
-
240
- window = sg.Window("small fish", layout=layout, size= (800,800), auto_size_buttons=True, auto_size_text=True)
241
- loop = 0
242
- timeout = 1
243
- while True :
244
- loop +=1
245
- window = window.refresh()
246
- event, values = window.read(timeout=timeout)
247
-
248
- #Welcome message
249
- if loop == 1 :
250
- timeout = None
251
- print("Welcome to small fish batch analysis. Please start by loading some files and setting parameters.")
252
-
253
- batch_folder = values.get('Batch_folder')
254
- is_multichanel = values.get('multichannel')
255
- is_3D = values.get('3D stack')
256
- do_segmentation = values.get('Segmentation')
257
- do_dense_regions_deconvolution = values.get('Dense regions deconvolution')
258
- do_clustering = values.get('Cluster computation')
259
-
260
- if type(batch_folder) != type(None) and event == 'Load':
261
- if not os.path.isdir(batch_folder) :
262
- print("Can't open {0}".format(batch_folder))
263
- else :
264
- files_values = get_files(batch_folder)
265
- files_table.update(values=files_values)
266
-
267
- elif event == 'Check' :
268
- filename_list = extract_files(files_values)
269
- last_shape = sanity_check(
270
- filename_list=filename_list,
271
- batch_folder=batch_folder,
272
- window=window,
273
- progress_bar=sanity_progress
274
- )
275
- if isinstance(last_shape,(tuple,list)) :
276
- dim_number = len(last_shape)
277
- dimension_number_text.update("Dimension number : {0}".format(dim_number))
278
- auto_map.update(disabled=False)
279
- else :
280
- dimension_number_text.update("Dimension number : unknown")
281
- auto_map.update(disabled=True)
282
-
283
- last_shape_read.update("Last shape read : {0}".format(last_shape))
284
-
285
-
286
- elif event == _tab_group.key or event == 'Ok': #Tab switch in parameters
287
- update_segmentation_tab(
288
- tab_elmt=tab_dict.get("Segmentation"),
289
- do_segmentation=do_segmentation,
290
- is_multichannel=is_multichanel,
291
- )
292
-
293
- update_detection_tab(
294
- tab_elmt=tab_dict.get("Detection"),
295
- is_multichannel=is_multichanel,
296
- is_3D=is_3D,
297
- do_dense_region_deconvolution=do_dense_regions_deconvolution,
298
- do_clustering=do_clustering,
299
- )
300
-
301
- elif event == 'auto-map' :
302
- #TODO
303
- pass
304
-
305
- # elif event == 'apply' (map) #TODO
306
-
307
- # elif event == 'check parameters' -> un/lock start #TODO
308
-
309
- elif event == "Cancel" :
310
- print(values)
311
- elif event == None :
312
- quit()
@@ -1,5 +0,0 @@
1
- import PySimpleGUI as sg
2
- import small_fish_gui.gui.batch as prompt
3
-
4
- prompt.batch_promp()
5
- print('end')
@@ -1,39 +0,0 @@
1
- small_fish_gui/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
2
- small_fish_gui/README.md,sha256=2c_homYDJXX6VsBiEs5obhBh3HpcTSMdyjLo-35WzE4,4062
3
- small_fish_gui/Segmentation example.jpg,sha256=opfiSbjmfF6z8kBs08sg_FNR2Om0AcMPU5sSwSLHdoQ,215038
4
- small_fish_gui/__init__.py,sha256=EnnsjHc4PvOZYdCT6JvKMiKDF_I6MMyBvj9TIDeOWco,1941
5
- small_fish_gui/__main__.py,sha256=EzSCoJ7jpSdK-QbzUwQLGZeQWjybNeq8VnCBucA8MZw,1372
6
- small_fish_gui/napari_detection_example.png,sha256=l5EZlrbXemLiGqb5inSVsD6Kko1Opz528-go-fBfrw8,977350
7
- small_fish_gui/requirements.txt,sha256=9OMfUAnLdHevq6w_fVoDmVmkSMJeFofkOK_86_fu9C0,321
8
- small_fish_gui/utils.py,sha256=tSoMb8N69WdKTtMItPb1DYZiIAz1mjI26BCKJAi6vuc,1798
9
- small_fish_gui/.github/workflows/python-publish.yml,sha256=5Ltnuhw9TevhzndlBmdUgYMnS73xEAxSyd1u8DHdn5s,1084
10
- small_fish_gui/gui/__init__.py,sha256=xQ_BfYcnQmKZtx_0leO4OmbkLNLv49ZPqEu_UXMgmDc,867
11
- small_fish_gui/gui/animation.py,sha256=6_Y15_NzJ_TYBYseu3sSKaVkYRp2UCsVClAWOk3dESY,714
12
- small_fish_gui/gui/batch.py,sha256=aCd3UvzH6ljaWMdjQzOHA_D6QttWYIuv9iDK8iISSdg,10831
13
- small_fish_gui/gui/general_help_screenshot.png,sha256=X4E6Td5f04K-pBUPDaBJRAE3D5b8fuEdiAUKhkIDr-0,54210
14
- small_fish_gui/gui/help_module.py,sha256=PmgkkDs7bZ2-po83A_PK9uldQcHjehYmqre21nYb6DQ,9600
15
- small_fish_gui/gui/layout.py,sha256=iLlSW40yBKoi4oW0TaWqbMV6ykr3P0Ar2ybf6X7VW3g,13139
16
- small_fish_gui/gui/mapping_help_screenshot.png,sha256=HcuRh5TYciUogUasza5vZ_QSshaiHsskQK23mh9vQS8,34735
17
- small_fish_gui/gui/prompts.py,sha256=KKDeinZ2qOD-zNDTUndmnff5hDrcwt0B4blkzozr1Wc,13319
18
- small_fish_gui/gui/segmentation_help_screenshot.png,sha256=rbSgIydT0gZtfMh1qk4mdMbEIyCaakvHmxa2eOrLwO0,118944
19
- small_fish_gui/gui/test.py,sha256=6P8tnND4wHOE1bF7BGx26wWgE-WjaSCH9Mej7ZzauSg,101
20
- small_fish_gui/interface/__init__.py,sha256=PB86R4Y9kV80aGZ-vP0ZW2KeaCwGbBbCtFCmbN2yl28,275
21
- small_fish_gui/interface/image.py,sha256=X1L7S5svxUwdoDcI3QM1PbN-c4Nz5w30hixq3IgqSn8,1130
22
- small_fish_gui/interface/output.py,sha256=dyhpO1YrRCIbQYpqU_52E1DTNPf0wdktd--CB15iT3k,1712
23
- small_fish_gui/interface/parameters.py,sha256=lUugD-4W2TZyJF3TH1q70TlktEYhhPtcPCrvxm5Dk50,36
24
- small_fish_gui/interface/testing.py,sha256=MY5-GcPOUHagcrwR8A7QOjAmjZIDVC8Wz3NibLe3KQw,321
25
- small_fish_gui/pipeline/_colocalisation.py,sha256=peBw2Qz5m6wSejDkDz240UgvWl8ohNelrnmEgznbEsw,9635
26
- small_fish_gui/pipeline/_custom_errors.py,sha256=tQ-AUhgzIFpK30AZiQQrtHCHyGVRDdAoIjzL0Fk-1pA,43
27
- small_fish_gui/pipeline/_napari_wrapper.py,sha256=_FkkY7IBKn1QgNvyea-x6XPjw_AwsLEVzdRKzg65oCE,9290
28
- small_fish_gui/pipeline/_preprocess.py,sha256=cbgXUx8yn3Wi_R7hFy64VuEXbbTbYw9p0qKG9cigyaM,10760
29
- small_fish_gui/pipeline/_segmentation.py,sha256=abltW2dKHarpDvM45TgkSJ4OzQV-b63VnA1PK4w1C_g,12998
30
- small_fish_gui/pipeline/_signaltonoise.py,sha256=7A9t7xu7zghI6cr201Ldm-LjJ5NOuP56VSeJ8KIzcUo,8497
31
- small_fish_gui/pipeline/actions.py,sha256=EIGIOlwJ_DADX1NcLWwrTP_AidDX-4f4ggZV0gkIb58,7988
32
- small_fish_gui/pipeline/detection.py,sha256=yMD9PGLJHH96PpXQRWbB5gv1EwQhtMWQ1a95g_0WU0E,32075
33
- small_fish_gui/pipeline/main.py,sha256=AAW-zK3b7Ece9cdHn9y6QG8lTa1HXG-8JtnvJ3m0HwA,3149
34
- small_fish_gui/pipeline/spots.py,sha256=yHvqf1eD25UltELpzcouYXhLkxiXI_mOL1ANSzXK5pw,1907
35
- small_fish_gui/pipeline/test.py,sha256=w4ZMGDmUDXxVgWTlZ2TKw19W8q5gcE9gLMKe0SWnRrw,2827
36
- small_fish_gui-1.3.5.dist-info/METADATA,sha256=K4HY1GO44LtO6PXUZmK3_jNNFmDXMsS9LpWa3l8WDB8,2567
37
- small_fish_gui-1.3.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
38
- small_fish_gui-1.3.5.dist-info/licenses/LICENSE,sha256=-iFy8VGBYs5VsHglKpk4D-hxqQ2jMJaqmfq_ulIzDks,1303
39
- small_fish_gui-1.3.5.dist-info/RECORD,,