celldetective 1.0.2.post1__py3-none-any.whl → 1.1.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.
- celldetective/__main__.py +2 -2
- celldetective/events.py +2 -44
- celldetective/filters.py +4 -5
- celldetective/gui/__init__.py +1 -1
- celldetective/gui/analyze_block.py +37 -10
- celldetective/gui/btrack_options.py +24 -23
- celldetective/gui/classifier_widget.py +62 -19
- celldetective/gui/configure_new_exp.py +32 -35
- celldetective/gui/control_panel.py +115 -81
- celldetective/gui/gui_utils.py +674 -396
- celldetective/gui/json_readers.py +7 -6
- celldetective/gui/layouts.py +755 -0
- celldetective/gui/measurement_options.py +168 -487
- celldetective/gui/neighborhood_options.py +322 -270
- celldetective/gui/plot_measurements.py +1114 -0
- celldetective/gui/plot_signals_ui.py +20 -20
- celldetective/gui/process_block.py +449 -169
- celldetective/gui/retrain_segmentation_model_options.py +27 -26
- celldetective/gui/retrain_signal_model_options.py +25 -24
- celldetective/gui/seg_model_loader.py +31 -27
- celldetective/gui/signal_annotator.py +2326 -2295
- celldetective/gui/signal_annotator_options.py +18 -16
- celldetective/gui/styles.py +16 -1
- celldetective/gui/survival_ui.py +61 -39
- celldetective/gui/tableUI.py +60 -23
- celldetective/gui/thresholds_gui.py +68 -66
- celldetective/gui/viewers.py +596 -0
- celldetective/io.py +234 -23
- celldetective/measure.py +37 -32
- celldetective/neighborhood.py +495 -27
- celldetective/preprocessing.py +683 -0
- celldetective/scripts/analyze_signals.py +7 -0
- celldetective/scripts/measure_cells.py +12 -0
- celldetective/scripts/segment_cells.py +5 -0
- celldetective/scripts/track_cells.py +11 -0
- celldetective/signals.py +221 -98
- celldetective/tracking.py +0 -1
- celldetective/utils.py +178 -36
- celldetective-1.1.0.dist-info/METADATA +305 -0
- celldetective-1.1.0.dist-info/RECORD +80 -0
- {celldetective-1.0.2.post1.dist-info → celldetective-1.1.0.dist-info}/top_level.txt +1 -0
- tests/__init__.py +0 -0
- tests/test_events.py +28 -0
- tests/test_filters.py +24 -0
- tests/test_io.py +70 -0
- tests/test_measure.py +141 -0
- tests/test_neighborhood.py +70 -0
- tests/test_segmentation.py +93 -0
- tests/test_signals.py +135 -0
- tests/test_tracking.py +164 -0
- tests/test_utils.py +71 -0
- celldetective-1.0.2.post1.dist-info/METADATA +0 -221
- celldetective-1.0.2.post1.dist-info/RECORD +0 -66
- {celldetective-1.0.2.post1.dist-info → celldetective-1.1.0.dist-info}/LICENSE +0 -0
- {celldetective-1.0.2.post1.dist-info → celldetective-1.1.0.dist-info}/WHEEL +0 -0
- {celldetective-1.0.2.post1.dist-info → celldetective-1.1.0.dist-info}/entry_points.txt +0 -0
|
@@ -31,28 +31,29 @@ from tqdm import tqdm
|
|
|
31
31
|
from lifelines import KaplanMeierFitter
|
|
32
32
|
from matplotlib.cm import viridis, tab10
|
|
33
33
|
import math
|
|
34
|
+
from celldetective.gui import Styles
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
class ConfigSignalPlot(QWidget):
|
|
38
|
+
class ConfigSignalPlot(QWidget, Styles):
|
|
38
39
|
|
|
39
40
|
"""
|
|
40
41
|
UI to set survival instructions.
|
|
41
42
|
|
|
42
43
|
"""
|
|
43
44
|
|
|
44
|
-
def __init__(self,
|
|
45
|
+
def __init__(self, parent_window=None):
|
|
45
46
|
|
|
46
47
|
super().__init__()
|
|
47
|
-
self.
|
|
48
|
+
self.parent_window = parent_window
|
|
48
49
|
self.setWindowTitle("Configure signal plot")
|
|
49
50
|
self.setWindowIcon(QIcon(os.sep.join(['celldetective','icons','mexican-hat.png'])))
|
|
50
|
-
self.exp_dir = self.
|
|
51
|
+
self.exp_dir = self.parent_window.exp_dir
|
|
51
52
|
self.soft_path = get_software_location()
|
|
52
53
|
self.exp_config = self.exp_dir +"config.ini"
|
|
53
|
-
self.wells = np.array(self.
|
|
54
|
+
self.wells = np.array(self.parent_window.parent_window.wells,dtype=str)
|
|
54
55
|
self.well_labels = _extract_labels_from_config(self.exp_config,len(self.wells))
|
|
55
|
-
self.FrameToMin = self.
|
|
56
|
+
self.FrameToMin = self.parent_window.parent_window.FrameToMin
|
|
56
57
|
self.float_validator = QDoubleValidator()
|
|
57
58
|
self.target_class = [0,1]
|
|
58
59
|
self.show_ci = True
|
|
@@ -64,13 +65,13 @@ class ConfigSignalPlot(QWidget):
|
|
|
64
65
|
print('Parent wells: ', self.wells)
|
|
65
66
|
|
|
66
67
|
|
|
67
|
-
self.well_option = self.
|
|
68
|
-
self.position_option = self.
|
|
68
|
+
self.well_option = self.parent_window.parent_window.well_list.currentIndex()
|
|
69
|
+
self.position_option = self.parent_window.parent_window.position_list.currentIndex()
|
|
69
70
|
self.interpret_pos_location()
|
|
70
71
|
#self.load_available_tables()
|
|
71
72
|
#self.config_path = self.exp_dir + self.config_name
|
|
72
73
|
|
|
73
|
-
self.screen_height = self.
|
|
74
|
+
self.screen_height = self.parent_window.parent_window.parent_window.screen_height
|
|
74
75
|
center_window(self)
|
|
75
76
|
#self.setMinimumHeight(int(0.8*self.screen_height))
|
|
76
77
|
#self.setMaximumHeight(int(0.8*self.screen_height))
|
|
@@ -97,7 +98,6 @@ class ConfigSignalPlot(QWidget):
|
|
|
97
98
|
else:
|
|
98
99
|
self.position_indices = np.array([self.position_option],dtype=int)
|
|
99
100
|
|
|
100
|
-
|
|
101
101
|
def populate_widget(self):
|
|
102
102
|
|
|
103
103
|
"""
|
|
@@ -117,7 +117,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
117
117
|
main_layout.addWidget(panel_title, alignment=Qt.AlignCenter)
|
|
118
118
|
|
|
119
119
|
labels = [QLabel('population: '), QLabel('class: '), QLabel('time of\ninterest: ')]
|
|
120
|
-
self.cb_options = [['targets','effectors'],['class'], ['t0'
|
|
120
|
+
self.cb_options = [['targets','effectors'],['class'], ['t0']]
|
|
121
121
|
self.cbs = [QComboBox() for i in range(len(labels))]
|
|
122
122
|
self.cbs[0].currentIndexChanged.connect(self.set_classes_and_times)
|
|
123
123
|
|
|
@@ -138,7 +138,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
138
138
|
self.frame_slider = QLabeledSlider()
|
|
139
139
|
self.frame_slider.setSingleStep(1)
|
|
140
140
|
self.frame_slider.setOrientation(1)
|
|
141
|
-
self.frame_slider.setRange(0,self.
|
|
141
|
+
self.frame_slider.setRange(0,self.parent_window.parent_window.len_movie)
|
|
142
142
|
self.frame_slider.setValue(0)
|
|
143
143
|
self.frame_slider.setEnabled(False)
|
|
144
144
|
slider_hbox = QHBoxLayout()
|
|
@@ -160,7 +160,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
160
160
|
main_layout.addLayout(time_calib_layout)
|
|
161
161
|
|
|
162
162
|
self.submit_btn = QPushButton('Submit')
|
|
163
|
-
self.submit_btn.setStyleSheet(self.
|
|
163
|
+
self.submit_btn.setStyleSheet(self.button_style_sheet)
|
|
164
164
|
self.submit_btn.clicked.connect(self.process_signal)
|
|
165
165
|
main_layout.addWidget(self.submit_btn)
|
|
166
166
|
|
|
@@ -173,7 +173,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
173
173
|
def set_classes_and_times(self):
|
|
174
174
|
|
|
175
175
|
# Look for all classes and times
|
|
176
|
-
tables = glob(self.exp_dir+os.sep.join(['W*','*','output','tables',f'trajectories_
|
|
176
|
+
tables = natsorted(glob(self.exp_dir+os.sep.join(['W*','*','output','tables',f'trajectories_*.csv'])))
|
|
177
177
|
self.all_columns = []
|
|
178
178
|
for tab in tables:
|
|
179
179
|
cols = pd.read_csv(tab, nrows=1).columns.tolist()
|
|
@@ -295,7 +295,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
295
295
|
|
|
296
296
|
self.legend_btn = QPushButton('')
|
|
297
297
|
self.legend_btn.setIcon(icon(MDI6.text_box,color="black"))
|
|
298
|
-
self.legend_btn.setStyleSheet(self.
|
|
298
|
+
self.legend_btn.setStyleSheet(self.button_select_all)
|
|
299
299
|
self.legend_btn.setToolTip('Show or hide the legend')
|
|
300
300
|
self.legend_visible = True
|
|
301
301
|
self.legend_btn.clicked.connect(self.show_hide_legend)
|
|
@@ -304,7 +304,7 @@ class ConfigSignalPlot(QWidget):
|
|
|
304
304
|
|
|
305
305
|
self.log_btn = QPushButton('')
|
|
306
306
|
self.log_btn.setIcon(icon(MDI6.math_log,color="black"))
|
|
307
|
-
self.log_btn.setStyleSheet(self.
|
|
307
|
+
self.log_btn.setStyleSheet(self.button_select_all)
|
|
308
308
|
self.log_btn.clicked.connect(self.switch_to_log)
|
|
309
309
|
self.log_btn.setToolTip('Enable or disable log scale')
|
|
310
310
|
plot_buttons_hbox.addWidget(self.log_btn, 5, alignment=Qt.AlignRight)
|
|
@@ -312,14 +312,14 @@ class ConfigSignalPlot(QWidget):
|
|
|
312
312
|
|
|
313
313
|
self.ci_btn = QPushButton('')
|
|
314
314
|
self.ci_btn.setIcon(icon(MDI6.arrow_expand_horizontal,color="blue"))
|
|
315
|
-
self.ci_btn.setStyleSheet(self.
|
|
315
|
+
self.ci_btn.setStyleSheet(self.button_select_all)
|
|
316
316
|
self.ci_btn.clicked.connect(self.switch_ci)
|
|
317
317
|
self.ci_btn.setToolTip('Show or hide confidence intervals.')
|
|
318
318
|
plot_buttons_hbox.addWidget(self.ci_btn, 5, alignment=Qt.AlignRight)
|
|
319
319
|
|
|
320
320
|
self.cell_lines_btn = QPushButton('')
|
|
321
321
|
self.cell_lines_btn.setIcon(icon(MDI6.view_headline,color="black"))
|
|
322
|
-
self.cell_lines_btn.setStyleSheet(self.
|
|
322
|
+
self.cell_lines_btn.setStyleSheet(self.button_select_all)
|
|
323
323
|
self.cell_lines_btn.clicked.connect(self.switch_cell_lines)
|
|
324
324
|
self.cell_lines_btn.setToolTip('Show or hide individual cell signals.')
|
|
325
325
|
plot_buttons_hbox.addWidget(self.cell_lines_btn, 5, alignment=Qt.AlignRight)
|
|
@@ -513,12 +513,12 @@ class ConfigSignalPlot(QWidget):
|
|
|
513
513
|
|
|
514
514
|
"""
|
|
515
515
|
|
|
516
|
-
self.well_option = self.
|
|
516
|
+
self.well_option = self.parent_window.parent_window.well_list.currentIndex()
|
|
517
517
|
if self.well_option==len(self.wells):
|
|
518
518
|
wo = '*'
|
|
519
519
|
else:
|
|
520
520
|
wo = self.well_option
|
|
521
|
-
self.position_option = self.
|
|
521
|
+
self.position_option = self.parent_window.parent_window.position_list.currentIndex()
|
|
522
522
|
if self.position_option==0:
|
|
523
523
|
po = '*'
|
|
524
524
|
else:
|