celldetective 1.3.3.post1__py3-none-any.whl → 1.3.4.post1__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.
- celldetective/__main__.py +30 -4
- celldetective/_version.py +1 -1
- celldetective/extra_properties.py +21 -0
- celldetective/filters.py +15 -2
- celldetective/gui/InitWindow.py +28 -34
- celldetective/gui/analyze_block.py +3 -498
- celldetective/gui/classifier_widget.py +1 -1
- celldetective/gui/control_panel.py +98 -27
- celldetective/gui/generic_signal_plot.py +35 -18
- celldetective/gui/gui_utils.py +143 -2
- celldetective/gui/layouts.py +7 -6
- celldetective/gui/measurement_options.py +3 -11
- celldetective/gui/plot_measurements.py +5 -13
- celldetective/gui/plot_signals_ui.py +30 -30
- celldetective/gui/process_block.py +61 -103
- celldetective/gui/signal_annotator.py +50 -32
- celldetective/gui/signal_annotator2.py +7 -4
- celldetective/gui/styles.py +13 -0
- celldetective/gui/survival_ui.py +8 -21
- celldetective/gui/tableUI.py +1 -2
- celldetective/gui/thresholds_gui.py +0 -6
- celldetective/gui/viewers.py +1 -5
- celldetective/io.py +31 -4
- celldetective/measure.py +8 -5
- celldetective/neighborhood.py +0 -2
- celldetective/scripts/measure_cells.py +21 -9
- celldetective/signals.py +78 -66
- celldetective/tracking.py +19 -13
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/METADATA +2 -1
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/RECORD +35 -35
- tests/test_qt.py +5 -3
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/LICENSE +0 -0
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/WHEEL +0 -0
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/entry_points.txt +0 -0
- {celldetective-1.3.3.post1.dist-info → celldetective-1.3.4.post1.dist-info}/top_level.txt +0 -0
|
@@ -61,15 +61,6 @@ class AnalysisPanel(QFrame, Styles):
|
|
|
61
61
|
self.plot_signal_btn.clicked.connect(self.configure_plot_signals)
|
|
62
62
|
self.grid.addWidget(self.plot_signal_btn)
|
|
63
63
|
|
|
64
|
-
# self.plot_measurements_btn = QPushButton("plot measurements")
|
|
65
|
-
# self.plot_measurements_btn.setIcon(icon(MDI6.chart_waterfall, color='black'))
|
|
66
|
-
# #self.plot_measurements_btn.setIcon(QIcon(QIcon(os.sep.join([self.soft_path,'celldetective','icons','signals_icon.png']))))
|
|
67
|
-
# self.plot_measurements_btn.setStyleSheet(self.button_style_sheet_2)
|
|
68
|
-
# self.plot_measurements_btn.setIconSize(QSize(35, 35))
|
|
69
|
-
# self.plot_measurements_btn.clicked.connect(self.configure_plot_measurements)
|
|
70
|
-
# self.grid.addWidget(self.plot_measurements_btn)
|
|
71
|
-
|
|
72
|
-
|
|
73
64
|
verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
|
74
65
|
self.grid.addItem(verticalSpacer)
|
|
75
66
|
|
|
@@ -84,493 +75,7 @@ class AnalysisPanel(QFrame, Styles):
|
|
|
84
75
|
self.ConfigSignalPlot.show()
|
|
85
76
|
|
|
86
77
|
def configure_plot_measurements(self):
|
|
87
|
-
print('plot measurements analysis starting!!!')
|
|
88
|
-
self.ConfigMeasurementsPLot = ConfigMeasurementsPlot(self)
|
|
89
|
-
self.ConfigMeasurementsPLot.show()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# self.select_all_btn = QPushButton()
|
|
93
|
-
# self.select_all_btn.setIcon(icon(MDI6.checkbox_blank_outline,color="black"))
|
|
94
|
-
# self.select_all_btn.setIconSize(QSize(20, 20))
|
|
95
|
-
# self.all_ticked = False
|
|
96
|
-
# self.select_all_btn.clicked.connect(self.tick_all_actions)
|
|
97
|
-
# self.select_all_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
98
|
-
# self.grid.addWidget(self.select_all_btn, 0, 0, 1, 4, alignment=Qt.AlignLeft)
|
|
99
|
-
# #self.to_disable.append(self.all_tc_actions)
|
|
100
|
-
|
|
101
|
-
# self.collapse_btn = QPushButton()
|
|
102
|
-
# self.collapse_btn.setIcon(icon(MDI6.chevron_down,color="black"))
|
|
103
|
-
# self.collapse_btn.setIconSize(QSize(25, 25))
|
|
104
|
-
# self.collapse_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
105
|
-
# self.grid.addWidget(self.collapse_btn, 0, 0, 1, 4, alignment=Qt.AlignRight)
|
|
106
|
-
|
|
107
|
-
# self.populate_contents()
|
|
108
|
-
# self.grid.addWidget(self.ContentsFrame, 1, 0, 1, 4, alignment=Qt.AlignTop)
|
|
109
|
-
# self.collapse_btn.clicked.connect(lambda: self.ContentsFrame.setHidden(not self.ContentsFrame.isHidden()))
|
|
110
|
-
# self.collapse_btn.clicked.connect(self.collapse_advanced)
|
|
111
|
-
# self.ContentsFrame.hide()
|
|
112
|
-
|
|
113
|
-
# def collapse_advanced(self):
|
|
114
|
-
# if self.ContentsFrame.isHidden():
|
|
115
|
-
# self.collapse_btn.setIcon(icon(MDI6.chevron_down,color="black"))
|
|
116
|
-
# self.collapse_btn.setIconSize(QSize(20, 20))
|
|
117
|
-
# self.parent.w.adjustSize()
|
|
118
|
-
# self.parent.adjustSize()
|
|
119
|
-
# else:
|
|
120
|
-
# self.collapse_btn.setIcon(icon(MDI6.chevron_up,color="black"))
|
|
121
|
-
# self.collapse_btn.setIconSize(QSize(20, 20))
|
|
122
|
-
# self.parent.w.adjustSize()
|
|
123
|
-
# self.parent.adjustSize()
|
|
124
|
-
|
|
125
|
-
# def populate_contents(self):
|
|
126
|
-
|
|
127
|
-
# self.ContentsFrame = QFrame()
|
|
128
|
-
# self.grid_contents = QGridLayout(self.ContentsFrame)
|
|
129
|
-
# self.grid_contents.setContentsMargins(0,0,0,0)
|
|
130
|
-
# self.generate_segmentation_options()
|
|
131
|
-
# self.generate_tracking_options()
|
|
132
|
-
# self.generate_measure_options()
|
|
133
|
-
# self.generate_signal_analysis_options()
|
|
134
|
-
|
|
135
|
-
# self.grid_contents.addWidget(QHSeperationLine(), 9, 0, 1, 4)
|
|
136
|
-
# self.view_tab_btn = QPushButton("View table")
|
|
137
|
-
# self.view_tab_btn.setStyleSheet(self.parent.parent.button_style_sheet_2)
|
|
138
|
-
# self.view_tab_btn.clicked.connect(self.view_table_ui)
|
|
139
|
-
# self.view_tab_btn.setToolTip('poop twice a day for a healthy gut')
|
|
140
|
-
# self.view_tab_btn.setIcon(icon(MDI6.table,color="#1565c0"))
|
|
141
|
-
# self.view_tab_btn.setIconSize(QSize(20, 20))
|
|
142
|
-
# self.view_tab_btn.setEnabled(False)
|
|
143
|
-
# self.grid_contents.addWidget(self.view_tab_btn, 10, 0, 1, 4)
|
|
144
|
-
|
|
145
|
-
# self.grid_contents.addWidget(QHSeperationLine(), 9, 0, 1, 4)
|
|
146
|
-
# self.submit_btn = QPushButton("Submit")
|
|
147
|
-
# self.submit_btn.setStyleSheet(self.parent.parent.button_style_sheet_2)
|
|
148
|
-
# self.submit_btn.clicked.connect(self.process_population)
|
|
149
|
-
# self.grid_contents.addWidget(self.submit_btn, 11, 0, 1, 4)
|
|
150
|
-
|
|
151
|
-
# def generate_measure_options(self):
|
|
152
|
-
|
|
153
|
-
# measure_layout = QHBoxLayout()
|
|
154
|
-
|
|
155
|
-
# self.measure_action = QCheckBox("MEASURE")
|
|
156
|
-
# self.measure_action.setStyleSheet("""
|
|
157
|
-
# font-size: 10px;
|
|
158
|
-
# padding-left: 10px;
|
|
159
|
-
# padding-top: 5px;
|
|
160
|
-
# """)
|
|
161
|
-
# self.measure_action.setIcon(icon(MDI6.eyedropper,color="black"))
|
|
162
|
-
# self.measure_action.setIconSize(QSize(20, 20))
|
|
163
|
-
# self.measure_action.setToolTip("Measure the intensity of the cells, \ndetect death events using the selected pre-trained model, \nformat the data for visualization, \nremove cells that are already dead and \nsave the result in a table.")
|
|
164
|
-
# measure_layout.addWidget(self.measure_action, 90)
|
|
165
|
-
# #self.to_disable.append(self.measure_action_tc)
|
|
166
|
-
|
|
167
|
-
# self.measurements_config_btn = QPushButton()
|
|
168
|
-
# self.measurements_config_btn.setIcon(icon(MDI6.cog_outline,color="black"))
|
|
169
|
-
# self.measurements_config_btn.setIconSize(QSize(20, 20))
|
|
170
|
-
# self.measurements_config_btn.setToolTip("Configure measurements.")
|
|
171
|
-
# self.measurements_config_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
172
|
-
# self.measurements_config_btn.clicked.connect(self.open_measurement_configuration_ui)
|
|
173
|
-
# measure_layout.addWidget(self.measurements_config_btn, 6) #4,2,1,1, alignment=Qt.AlignRight
|
|
174
|
-
|
|
175
|
-
# self.grid_contents.addLayout(measure_layout,5,0,1,4)
|
|
176
|
-
|
|
177
|
-
# def generate_signal_analysis_options(self):
|
|
178
|
-
|
|
179
|
-
# signal_layout = QVBoxLayout()
|
|
180
|
-
# signal_hlayout = QHBoxLayout()
|
|
181
|
-
# self.signal_analysis_action = QCheckBox("SIGNAL ANALYSIS")
|
|
182
|
-
# self.signal_analysis_action.setStyleSheet("""
|
|
183
|
-
# font-size: 10px;
|
|
184
|
-
# padding-left: 10px;
|
|
185
|
-
# padding-top: 5px;
|
|
186
|
-
# """)
|
|
187
|
-
# self.signal_analysis_action.setIcon(icon(MDI6.chart_bell_curve_cumulative,color="black"))
|
|
188
|
-
# self.signal_analysis_action.setIconSize(QSize(20, 20))
|
|
189
|
-
# self.signal_analysis_action.setToolTip("Analyze cell signals using deep learning or a fit procedure.")
|
|
190
|
-
# self.signal_analysis_action.toggled.connect(self.enable_signal_model_list)
|
|
191
|
-
# signal_hlayout.addWidget(self.signal_analysis_action, 90)
|
|
192
|
-
|
|
193
|
-
# self.check_signals_btn = QPushButton()
|
|
194
|
-
# self.check_signals_btn.setIcon(icon(MDI6.eye_check_outline,color="black"))
|
|
195
|
-
# self.check_signals_btn.setIconSize(QSize(20, 20))
|
|
196
|
-
# self.check_signals_btn.clicked.connect(self.check_signals)
|
|
197
|
-
# self.check_signals_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
198
|
-
# signal_hlayout.addWidget(self.check_signals_btn, 6)
|
|
199
|
-
|
|
200
|
-
# self.config_signal_annotator_btn = QPushButton()
|
|
201
|
-
# self.config_signal_annotator_btn.setIcon(icon(MDI6.cog_outline,color="black"))
|
|
202
|
-
# self.config_signal_annotator_btn.setIconSize(QSize(20, 20))
|
|
203
|
-
# self.config_signal_annotator_btn.setToolTip("Configure the animation of the annotation tool.")
|
|
204
|
-
# self.config_signal_annotator_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
205
|
-
# self.config_signal_annotator_btn.clicked.connect(self.open_signal_annotator_configuration_ui)
|
|
206
|
-
# signal_hlayout.addWidget(self.config_signal_annotator_btn, 6)
|
|
207
|
-
|
|
208
|
-
# #self.to_disable.append(self.measure_action_tc)
|
|
209
|
-
# signal_layout.addLayout(signal_hlayout)
|
|
210
|
-
|
|
211
|
-
# model_zoo_layout = QHBoxLayout()
|
|
212
|
-
# model_zoo_layout.addWidget(QLabel("Model zoo:"),90)
|
|
213
|
-
|
|
214
|
-
# self.signal_models_list = QComboBox()
|
|
215
|
-
# self.signal_models_list.setEnabled(False)
|
|
216
|
-
# self.refresh_signal_models()
|
|
217
|
-
# #self.to_disable.append(self.cell_models_list)
|
|
218
|
-
|
|
219
|
-
# self.train_signal_model_btn = QPushButton("TRAIN")
|
|
220
|
-
# self.train_signal_model_btn.setToolTip("Open a dialog box to create a new target segmentation model.")
|
|
221
|
-
# self.train_signal_model_btn.setIcon(icon(MDI6.redo_variant,color='black'))
|
|
222
|
-
# self.train_signal_model_btn.setIconSize(QSize(20, 20))
|
|
223
|
-
# self.train_signal_model_btn.setStyleSheet(self.parent.parent.button_style_sheet_3)
|
|
224
|
-
# model_zoo_layout.addWidget(self.train_signal_model_btn, 5)
|
|
225
|
-
# self.train_signal_model_btn.clicked.connect(self.open_signal_model_config_ui)
|
|
226
|
-
# signal_layout.addLayout(model_zoo_layout)
|
|
227
|
-
# signal_layout.addWidget(self.signal_models_list)
|
|
228
|
-
|
|
229
|
-
# self.grid_contents.addLayout(signal_layout,6,0,1,4)
|
|
230
|
-
|
|
231
|
-
# def refresh_signal_models(self):
|
|
232
|
-
# signal_models = get_signal_models_list()
|
|
233
|
-
# self.signal_models_list.clear()
|
|
234
|
-
# self.signal_models_list.addItems(signal_models)
|
|
235
|
-
|
|
236
|
-
# def generate_tracking_options(self):
|
|
237
|
-
# grid_track = QHBoxLayout()
|
|
238
|
-
|
|
239
|
-
# self.track_action = QCheckBox("TRACK")
|
|
240
|
-
# self.track_action.setIcon(icon(MDI6.chart_timeline_variant,color="black"))
|
|
241
|
-
# self.track_action.setIconSize(QSize(20, 20))
|
|
242
|
-
# self.track_action.setToolTip("Track the target cells using bTrack.")
|
|
243
|
-
# self.track_action.setStyleSheet("""
|
|
244
|
-
# font-size: 10px;
|
|
245
|
-
# padding-left: 10px;
|
|
246
|
-
# padding-top: 5px;
|
|
247
|
-
# """)
|
|
248
|
-
# grid_track.addWidget(self.track_action, 80)
|
|
249
|
-
# #self.to_disable.append(self.track_action_tc)
|
|
250
|
-
|
|
251
|
-
# # self.show_track_table_btn = QPushButton()
|
|
252
|
-
# # self.show_track_table_btn.setIcon(icon(MDI6.table,color="black"))
|
|
253
|
-
# # self.show_track_table_btn.setIconSize(QSize(20, 20))
|
|
254
|
-
# # self.show_track_table_btn.setToolTip("Show trajectories table.")
|
|
255
|
-
# # self.show_track_table_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
256
|
-
# # #self.show_track_table_btn.clicked.connect(self.display_trajectory_table)
|
|
257
|
-
# # self.show_track_table_btn.setEnabled(False)
|
|
258
|
-
# # grid_track.addWidget(self.show_track_table_btn, 6) #4,3,1,1, alignment=Qt.AlignLeft
|
|
259
|
-
|
|
260
|
-
# self.check_tracking_result_btn = QPushButton()
|
|
261
|
-
# self.check_tracking_result_btn.setIcon(icon(MDI6.eye_check_outline,color="black"))
|
|
262
|
-
# self.check_tracking_result_btn.setIconSize(QSize(20, 20))
|
|
263
|
-
# self.check_tracking_result_btn.setToolTip("Control dynamically the trajectories.")
|
|
264
|
-
# self.check_tracking_result_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
265
|
-
# self.check_tracking_result_btn.clicked.connect(self.open_napari_tracking)
|
|
266
|
-
# self.check_tracking_result_btn.setEnabled(False)
|
|
267
|
-
# grid_track.addWidget(self.check_tracking_result_btn, 6) #4,3,1,1, alignment=Qt.AlignLeft
|
|
268
|
-
|
|
269
|
-
# self.track_config_btn = QPushButton()
|
|
270
|
-
# self.track_config_btn.setIcon(icon(MDI6.cog_outline,color="black"))
|
|
271
|
-
# self.track_config_btn.setIconSize(QSize(20, 20))
|
|
272
|
-
# self.track_config_btn.setToolTip("Configure tracking.")
|
|
273
|
-
# self.track_config_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
274
|
-
# self.track_config_btn.clicked.connect(self.open_tracking_configuration_ui)
|
|
275
|
-
# grid_track.addWidget(self.track_config_btn, 6) #4,2,1,1, alignment=Qt.AlignRight
|
|
276
|
-
|
|
277
|
-
# self.grid_contents.addLayout(grid_track, 4, 0, 1,4)
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
# def generate_segmentation_options(self):
|
|
281
|
-
|
|
282
|
-
# grid_segment = QHBoxLayout()
|
|
283
|
-
# grid_segment.setContentsMargins(0,0,0,0)
|
|
284
|
-
# grid_segment.setSpacing(0)
|
|
285
|
-
|
|
286
|
-
# self.segment_action = QCheckBox("SEGMENT")
|
|
287
|
-
# self.segment_action.setStyleSheet("""
|
|
288
|
-
# font-size: 10px;
|
|
289
|
-
# padding-left: 10px;
|
|
290
|
-
# """)
|
|
291
|
-
# self.segment_action.setIcon(icon(MDI6.bacteria, color='black'))
|
|
292
|
-
# self.segment_action.setToolTip("Segment the cells in the movie\nusing the selected pre-trained model and save\nthe labeled output in a sub-directory.")
|
|
293
|
-
# self.segment_action.toggled.connect(self.enable_segmentation_model_list)
|
|
294
|
-
# #self.to_disable.append(self.segment_action)
|
|
295
|
-
# grid_segment.addWidget(self.segment_action, 90)
|
|
296
|
-
|
|
297
|
-
# self.check_seg_btn = QPushButton()
|
|
298
|
-
# self.check_seg_btn.setIcon(icon(MDI6.eye_check_outline,color="black"))
|
|
299
|
-
# self.check_seg_btn.setIconSize(QSize(20, 20))
|
|
300
|
-
# self.check_seg_btn.clicked.connect(self.check_segmentation)
|
|
301
|
-
# self.check_seg_btn.setStyleSheet(self.parent.parent.button_select_all)
|
|
302
|
-
# self.check_seg_btn.setEnabled(False)
|
|
303
|
-
# #self.to_disable.append(self.control_target_seg)
|
|
304
|
-
# grid_segment.addWidget(self.check_seg_btn, 10)
|
|
305
|
-
# self.grid_contents.addLayout(grid_segment, 0,0,1,4)
|
|
306
|
-
|
|
307
|
-
# model_zoo_layout = QHBoxLayout()
|
|
308
|
-
# model_zoo_layout.addWidget(QLabel("Model zoo:"),90)
|
|
309
|
-
# self.seg_model_list = QComboBox()
|
|
310
|
-
# #self.to_disable.append(self.tc_seg_model_list)
|
|
311
|
-
# self.seg_model_list.setGeometry(50, 50, 200, 30)
|
|
312
|
-
# self.init_seg_model_list()
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
# self.upload_model_btn = QPushButton("UPLOAD")
|
|
316
|
-
# self.upload_model_btn.setIcon(icon(MDI6.upload,color="black"))
|
|
317
|
-
# self.upload_model_btn.setIconSize(QSize(20, 20))
|
|
318
|
-
# self.upload_model_btn.setStyleSheet(self.parent.parent.button_style_sheet_3)
|
|
319
|
-
# self.upload_model_btn.setToolTip("Upload a new segmentation model (Deep learning or threshold-based).")
|
|
320
|
-
# model_zoo_layout.addWidget(self.upload_model_btn, 5)
|
|
321
|
-
# self.upload_model_btn.clicked.connect(self.upload_segmentation_model)
|
|
322
|
-
# # self.to_disable.append(self.upload_tc_model)
|
|
323
|
-
|
|
324
|
-
# self.train_btn = QPushButton("TRAIN")
|
|
325
|
-
# self.train_btn.setToolTip("Train or retrain a segmentation model on newly annotated data.")
|
|
326
|
-
# self.train_btn.setIcon(icon(MDI6.redo_variant,color='black'))
|
|
327
|
-
# self.train_btn.setIconSize(QSize(20, 20))
|
|
328
|
-
# self.train_btn.setStyleSheet(self.parent.parent.button_style_sheet_3)
|
|
329
|
-
# model_zoo_layout.addWidget(self.train_btn, 5)
|
|
330
|
-
# # self.train_button_tc.clicked.connect(self.train_stardist_model_tc)
|
|
331
|
-
# # self.to_disable.append(self.train_button_tc)
|
|
332
|
-
|
|
333
|
-
# self.grid_contents.addLayout(model_zoo_layout, 2, 0, 1,4)
|
|
334
|
-
# self.seg_model_list.setEnabled(False)
|
|
335
|
-
# self.grid_contents.addWidget(self.seg_model_list, 3, 0, 1, 4)
|
|
336
|
-
|
|
337
|
-
# def check_segmentation(self):
|
|
338
|
-
|
|
339
|
-
# #self.freeze()
|
|
340
|
-
# #QApplication.setOverrideCursor(Qt.WaitCursor)
|
|
341
|
-
# test = self.parent.locate_selected_position()
|
|
342
|
-
# if test:
|
|
343
|
-
# control_segmentation_napari(self.parent.pos, prefix=self.parent.movie_prefix, population=self.mode,flush_memory=True)
|
|
344
|
-
# gc.collect()
|
|
345
78
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
# if test:
|
|
350
|
-
# self.SignalAnnotator = SignalAnnotator(self)
|
|
351
|
-
# self.SignalAnnotator.show()
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
# def enable_segmentation_model_list(self):
|
|
355
|
-
# if self.segment_action.isChecked():
|
|
356
|
-
# self.seg_model_list.setEnabled(True)
|
|
357
|
-
# else:
|
|
358
|
-
# self.seg_model_list.setEnabled(False)
|
|
359
|
-
|
|
360
|
-
# def enable_signal_model_list(self):
|
|
361
|
-
# if self.signal_analysis_action.isChecked():
|
|
362
|
-
# self.signal_models_list.setEnabled(True)
|
|
363
|
-
# else:
|
|
364
|
-
# self.signal_models_list.setEnabled(False)
|
|
365
|
-
|
|
366
|
-
# def init_seg_model_list(self):
|
|
367
|
-
|
|
368
|
-
# self.seg_model_list.clear()
|
|
369
|
-
# self.seg_models = get_segmentation_models_list(mode=self.mode, return_path=False)
|
|
370
|
-
# self.seg_models.insert(0,'Threshold')
|
|
371
|
-
# thresh = 40
|
|
372
|
-
# models_truncated = [m[:thresh - 3]+'...' if len(m)>thresh else m for m in self.seg_models]
|
|
373
|
-
# self.seg_model_list.addItems(models_truncated)
|
|
374
|
-
# for i in range(len(self.seg_models)):
|
|
375
|
-
# self.seg_model_list.setItemData(i, self.seg_models[i], Qt.ToolTipRole)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
# #if ("live_nuclei_channel" in self.exp_channels)*("dead_nuclei_channel" in self.exp_channels):
|
|
379
|
-
# # print("both channels found")
|
|
380
|
-
# # index = self.tc_seg_model_list.findText("MCF7_Hoescht_PI_w_primary_NK", Qt.MatchFixedString)
|
|
381
|
-
# # if index >= 0:
|
|
382
|
-
# # self.tc_seg_model_list.setCurrentIndex(index)
|
|
383
|
-
# # elif ("live_nuclei_channel" in self.exp_channels)*("dead_nuclei_channel" not in self.exp_channels):
|
|
384
|
-
# # index = self.tc_seg_model_list.findText("MCF7_Hoescht_w_primary_NK", Qt.MatchFixedString)
|
|
385
|
-
# # if index >= 0:
|
|
386
|
-
# # self.tc_seg_model_list.setCurrentIndex(index)
|
|
387
|
-
# # elif ("live_nuclei_channel" not in self.exp_channels)*("dead_nuclei_channel" in self.exp_channels):
|
|
388
|
-
# # index = self.tc_seg_model_list.findText("MCF7_PI_w_primary_NK", Qt.MatchFixedString)
|
|
389
|
-
# # if index >= 0:
|
|
390
|
-
# # self.tc_seg_model_list.setCurrentIndex(index)
|
|
391
|
-
# # elif ("live_nuclei_channel" not in self.exp_channels)*("dead_nuclei_channel" not in self.exp_channels)*("adhesion_channel" in self.exp_channels):
|
|
392
|
-
# # index = self.tc_seg_model_list.findText("RICM", Qt.MatchFixedString)
|
|
393
|
-
# # if index >= 0:
|
|
394
|
-
# # self.tc_seg_model_list.setCurrentIndex(index)
|
|
395
|
-
|
|
396
|
-
# def tick_all_actions(self):
|
|
397
|
-
# self.switch_all_ticks_option()
|
|
398
|
-
# if self.all_ticked:
|
|
399
|
-
# self.select_all_btn.setIcon(icon(MDI6.checkbox_outline,color="black"))
|
|
400
|
-
# self.select_all_btn.setIconSize(QSize(20, 20))
|
|
401
|
-
# self.segment_action.setChecked(True)
|
|
402
|
-
# else:
|
|
403
|
-
# self.select_all_btn.setIcon(icon(MDI6.checkbox_blank_outline,color="black"))
|
|
404
|
-
# self.select_all_btn.setIconSize(QSize(20, 20))
|
|
405
|
-
# self.segment_action.setChecked(False)
|
|
406
|
-
|
|
407
|
-
# def switch_all_ticks_option(self):
|
|
408
|
-
# if self.all_ticked == True:
|
|
409
|
-
# self.all_ticked = False
|
|
410
|
-
# else:
|
|
411
|
-
# self.all_ticked = True
|
|
412
|
-
|
|
413
|
-
# def upload_segmentation_model(self):
|
|
414
|
-
|
|
415
|
-
# self.SegModelLoader = SegmentationModelLoader(self)
|
|
416
|
-
# self.SegModelLoader.show()
|
|
417
|
-
|
|
418
|
-
# def open_tracking_configuration_ui(self):
|
|
419
|
-
|
|
420
|
-
# self.ConfigTracking = ConfigTracking(self)
|
|
421
|
-
# self.ConfigTracking.show()
|
|
422
|
-
|
|
423
|
-
# def open_signal_model_config_ui(self):
|
|
424
|
-
|
|
425
|
-
# self.ConfigSignalTrain = ConfigSignalModelTraining(self)
|
|
426
|
-
# self.ConfigSignalTrain.show()
|
|
427
|
-
|
|
428
|
-
# def open_measurement_configuration_ui(self):
|
|
429
|
-
|
|
430
|
-
# self.ConfigMeasurements = ConfigMeasurements(self)
|
|
431
|
-
# self.ConfigMeasurements.show()
|
|
432
|
-
|
|
433
|
-
# def open_signal_annotator_configuration_ui(self):
|
|
434
|
-
# self.ConfigSignalAnnotator = ConfigSignalAnnotator(self)
|
|
435
|
-
# self.ConfigSignalAnnotator.show()
|
|
436
|
-
|
|
437
|
-
# def process_population(self):
|
|
438
|
-
|
|
439
|
-
# if self.parent.well_list.currentText()=="*":
|
|
440
|
-
# self.well_index = np.linspace(0,len(self.wells)-1,len(self.wells),dtype=int)
|
|
441
|
-
# else:
|
|
442
|
-
# self.well_index = [self.parent.well_list.currentIndex()]
|
|
443
|
-
# print(f"Processing well {self.parent.well_list.currentText()}...")
|
|
444
|
-
|
|
445
|
-
# # self.freeze()
|
|
446
|
-
# # QApplication.setOverrideCursor(Qt.WaitCursor)
|
|
447
|
-
|
|
448
|
-
# if self.mode=="targets":
|
|
449
|
-
# self.threshold_config = self.threshold_config_targets
|
|
450
|
-
# elif self.mode=="effectors":
|
|
451
|
-
# self.threshold_config = self.threshold_config_effectors
|
|
452
|
-
|
|
453
|
-
# loop_iter=0
|
|
454
|
-
|
|
455
|
-
# if self.parent.position_list.currentText()=="*":
|
|
456
|
-
# msgBox = QMessageBox()
|
|
457
|
-
# msgBox.setIcon(QMessageBox.Question)
|
|
458
|
-
# msgBox.setText("If you continue, all positions will be processed.\nDo you want to proceed?")
|
|
459
|
-
# msgBox.setWindowTitle("Info")
|
|
460
|
-
# msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
461
|
-
# returnValue = msgBox.exec()
|
|
462
|
-
# if returnValue == QMessageBox.No:
|
|
463
|
-
# return None
|
|
464
|
-
|
|
465
|
-
# for w_idx in self.well_index:
|
|
466
|
-
|
|
467
|
-
# pos = self.parent.positions[w_idx]
|
|
468
|
-
# if self.parent.position_list.currentText()=="*":
|
|
469
|
-
# pos_indices = np.linspace(0,len(pos)-1,len(pos),dtype=int)
|
|
470
|
-
# print("Processing all positions...")
|
|
471
|
-
# else:
|
|
472
|
-
# pos_indices = natsorted([pos.index(self.parent.position_list.currentText())])
|
|
473
|
-
# print(f"Processing position {self.parent.position_list.currentText()}...")
|
|
474
|
-
|
|
475
|
-
# well = self.parent.wells[w_idx]
|
|
476
|
-
|
|
477
|
-
# for pos_idx in pos_indices:
|
|
478
|
-
|
|
479
|
-
# self.pos = natsorted(glob(well+f"{well[-2]}*/"))[pos_idx]
|
|
480
|
-
# print(f"Position {self.pos}...\nLoading stack movie...")
|
|
481
|
-
# model_name = self.seg_models[self.seg_model_list.currentIndex()]
|
|
482
|
-
|
|
483
|
-
# if not os.path.exists(self.pos + 'output/'):
|
|
484
|
-
# os.mkdir(self.pos + 'output/')
|
|
485
|
-
# if not os.path.exists(self.pos + 'output/tables/'):
|
|
486
|
-
# os.mkdir(self.pos + 'output/tables/')
|
|
487
|
-
|
|
488
|
-
# if self.segment_action.isChecked():
|
|
489
|
-
|
|
490
|
-
# if len(glob(os.sep.join([self.pos, f'labels_{self.mode}','*.tif'])))>0 and self.parent.position_list.currentText()!="*":
|
|
491
|
-
# msgBox = QMessageBox()
|
|
492
|
-
# msgBox.setIcon(QMessageBox.Question)
|
|
493
|
-
# msgBox.setText("Labels have already been produced for this position. Do you want to segment again?")
|
|
494
|
-
# msgBox.setWindowTitle("Info")
|
|
495
|
-
# msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
496
|
-
# returnValue = msgBox.exec()
|
|
497
|
-
# if returnValue == QMessageBox.No:
|
|
498
|
-
# return None
|
|
499
|
-
|
|
500
|
-
# if (self.seg_model_list.currentText()=="Threshold"):
|
|
501
|
-
# if self.threshold_config is None:
|
|
502
|
-
# msgBox = QMessageBox()
|
|
503
|
-
# msgBox.setIcon(QMessageBox.Warning)
|
|
504
|
-
# msgBox.setText("Please set a threshold configuration from the upload menu first. Abort.")
|
|
505
|
-
# msgBox.setWindowTitle("Warning")
|
|
506
|
-
# msgBox.setStandardButtons(QMessageBox.Ok)
|
|
507
|
-
# returnValue = msgBox.exec()
|
|
508
|
-
# if returnValue == QMessageBox.Ok:
|
|
509
|
-
# return None
|
|
510
|
-
# else:
|
|
511
|
-
# print(f"Segmentation from threshold config: {self.threshold_config}")
|
|
512
|
-
# segment_from_threshold_at_position(self.pos, self.mode, self.threshold_config)
|
|
513
|
-
# else:
|
|
514
|
-
# segment_at_position(self.pos, self.mode, model_name, stack_prefix=self.parent.movie_prefix, use_gpu=True)
|
|
515
|
-
|
|
516
|
-
# if self.track_action.isChecked():
|
|
517
|
-
# if os.path.exists(os.sep.join([self.pos, 'output', 'tables', f'trajectories_{self.mode}.csv'])) and self.parent.position_list.currentText()!="*":
|
|
518
|
-
# msgBox = QMessageBox()
|
|
519
|
-
# msgBox.setIcon(QMessageBox.Question)
|
|
520
|
-
# msgBox.setText("A trajectory set already exists. Previously annotated data for\nthis position will be lost. Do you want to proceed?")
|
|
521
|
-
# msgBox.setWindowTitle("Info")
|
|
522
|
-
# msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
523
|
-
# returnValue = msgBox.exec()
|
|
524
|
-
# if returnValue == QMessageBox.No:
|
|
525
|
-
# return None
|
|
526
|
-
# track_at_position(self.pos, self.mode)
|
|
527
|
-
|
|
528
|
-
# if self.measure_action.isChecked():
|
|
529
|
-
# measure_at_position(self.pos, self.mode)
|
|
530
|
-
|
|
531
|
-
# table = os.sep.join([self.pos, 'output', 'tables', f'trajectories_{self.mode}.csv'])
|
|
532
|
-
# if self.signal_analysis_action.isChecked() and os.path.exists(table):
|
|
533
|
-
# print('table exists')
|
|
534
|
-
# table = pd.read_csv(table)
|
|
535
|
-
# cols = list(table.columns)
|
|
536
|
-
# print(table, cols)
|
|
537
|
-
# if 'class_color' in cols:
|
|
538
|
-
# print(cols, 'class_color in cols')
|
|
539
|
-
# colors = list(table['class_color'].to_numpy())
|
|
540
|
-
# if 'tab:orange' in colors or 'tab:cyan' in colors:
|
|
541
|
-
# if self.parent.position_list.currentText()!="*":
|
|
542
|
-
# msgBox = QMessageBox()
|
|
543
|
-
# msgBox.setIcon(QMessageBox.Question)
|
|
544
|
-
# msgBox.setText("The signals of the cells in the position appear to have been annotated... Do you want to proceed?")
|
|
545
|
-
# msgBox.setWindowTitle("Info")
|
|
546
|
-
# msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
547
|
-
# returnValue = msgBox.exec()
|
|
548
|
-
# if returnValue == QMessageBox.No:
|
|
549
|
-
# return None
|
|
550
|
-
# analyze_signals_at_position(self.pos, self.signal_models_list.currentText(), self.mode)
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
# # self.stack = None
|
|
554
|
-
# self.parent.update_position_options()
|
|
555
|
-
# if self.segment_action.isChecked():
|
|
556
|
-
# self.segment_action.setChecked(False)
|
|
557
|
-
|
|
558
|
-
# # QApplication.restoreOverrideCursor()
|
|
559
|
-
# # self.unfreeze()
|
|
560
|
-
|
|
561
|
-
# def open_napari_tracking(self):
|
|
562
|
-
# control_tracking_btrack(self.parent.pos, prefix=self.parent.movie_prefix, population=self.mode)
|
|
563
|
-
|
|
564
|
-
# def view_table_ui(self):
|
|
565
|
-
# print('view table')
|
|
566
|
-
|
|
567
|
-
# test = self.parent.locate_selected_position()
|
|
568
|
-
# if test:
|
|
569
|
-
# tab_path = os.sep.join([self.parent.pos,"output","tables",f"trajectories_{self.mode}.csv"])
|
|
570
|
-
# print(tab_path)
|
|
571
|
-
# if os.path.exists(tab_path):
|
|
572
|
-
# trajectories = pd.read_csv(tab_path)
|
|
573
|
-
# self.tab_ui = TableUI(trajectories, f"Tracks {self.parent.position_list.currentText()}")
|
|
574
|
-
# self.tab_ui.show()
|
|
575
|
-
# else:
|
|
576
|
-
# print(test, 'test failed')
|
|
79
|
+
print('plot measurements analysis starting!!!')
|
|
80
|
+
self.ConfigMeasurementsPlot_wg = ConfigMeasurementsPlot(self)
|
|
81
|
+
self.ConfigMeasurementsPlot_wg.show()
|
|
@@ -10,7 +10,7 @@ import numpy as np
|
|
|
10
10
|
import matplotlib.pyplot as plt
|
|
11
11
|
import json
|
|
12
12
|
|
|
13
|
-
from celldetective.gui.gui_utils import FigureCanvas, center_window, color_from_status, help_generic
|
|
13
|
+
from celldetective.gui.gui_utils import FigureCanvas, center_window, color_from_status, help_generic
|
|
14
14
|
from celldetective.gui import Styles
|
|
15
15
|
from celldetective.utils import get_software_location
|
|
16
16
|
from celldetective.measure import classify_cells_from_query, interpret_track_classification
|