celldetective 1.3.9.post5__py3-none-any.whl → 1.4.1__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 (94) hide show
  1. celldetective/__init__.py +0 -3
  2. celldetective/_version.py +1 -1
  3. celldetective/events.py +2 -4
  4. celldetective/exceptions.py +11 -0
  5. celldetective/extra_properties.py +132 -0
  6. celldetective/filters.py +7 -1
  7. celldetective/gui/InitWindow.py +37 -46
  8. celldetective/gui/__init__.py +3 -9
  9. celldetective/gui/about.py +19 -15
  10. celldetective/gui/analyze_block.py +34 -19
  11. celldetective/gui/base_annotator.py +786 -0
  12. celldetective/gui/base_components.py +23 -0
  13. celldetective/gui/classifier_widget.py +86 -94
  14. celldetective/gui/configure_new_exp.py +163 -46
  15. celldetective/gui/control_panel.py +76 -146
  16. celldetective/gui/{signal_annotator.py → event_annotator.py} +533 -1438
  17. celldetective/gui/generic_signal_plot.py +11 -13
  18. celldetective/gui/gui_utils.py +54 -23
  19. celldetective/gui/help/neighborhood.json +2 -2
  20. celldetective/gui/json_readers.py +5 -4
  21. celldetective/gui/layouts.py +265 -31
  22. celldetective/gui/{signal_annotator2.py → pair_event_annotator.py} +433 -635
  23. celldetective/gui/plot_measurements.py +21 -17
  24. celldetective/gui/plot_signals_ui.py +125 -72
  25. celldetective/gui/process_block.py +283 -188
  26. celldetective/gui/processes/compute_neighborhood.py +594 -0
  27. celldetective/gui/processes/downloader.py +37 -34
  28. celldetective/gui/processes/measure_cells.py +19 -8
  29. celldetective/gui/processes/segment_cells.py +47 -11
  30. celldetective/gui/processes/track_cells.py +18 -13
  31. celldetective/gui/seg_model_loader.py +21 -62
  32. celldetective/gui/settings/__init__.py +7 -0
  33. celldetective/gui/settings/_settings_base.py +70 -0
  34. celldetective/gui/{retrain_signal_model_options.py → settings/_settings_event_model_training.py} +54 -109
  35. celldetective/gui/{measurement_options.py → settings/_settings_measurements.py} +54 -92
  36. celldetective/gui/{neighborhood_options.py → settings/_settings_neighborhood.py} +10 -13
  37. celldetective/gui/settings/_settings_segmentation.py +49 -0
  38. celldetective/gui/{retrain_segmentation_model_options.py → settings/_settings_segmentation_model_training.py} +38 -92
  39. celldetective/gui/{signal_annotator_options.py → settings/_settings_signal_annotator.py} +78 -103
  40. celldetective/gui/{btrack_options.py → settings/_settings_tracking.py} +85 -116
  41. celldetective/gui/styles.py +2 -1
  42. celldetective/gui/survival_ui.py +49 -95
  43. celldetective/gui/tableUI.py +53 -25
  44. celldetective/gui/table_ops/__init__.py +0 -0
  45. celldetective/gui/table_ops/merge_groups.py +118 -0
  46. celldetective/gui/thresholds_gui.py +617 -1221
  47. celldetective/gui/viewers.py +107 -42
  48. celldetective/gui/workers.py +8 -4
  49. celldetective/io.py +137 -57
  50. celldetective/links/zenodo.json +145 -144
  51. celldetective/measure.py +94 -53
  52. celldetective/neighborhood.py +342 -268
  53. celldetective/preprocessing.py +56 -35
  54. celldetective/regionprops/_regionprops.py +16 -5
  55. celldetective/relative_measurements.py +50 -29
  56. celldetective/scripts/analyze_signals.py +4 -1
  57. celldetective/scripts/measure_cells.py +5 -5
  58. celldetective/scripts/measure_relative.py +20 -12
  59. celldetective/scripts/segment_cells.py +4 -10
  60. celldetective/scripts/segment_cells_thresholds.py +3 -3
  61. celldetective/scripts/track_cells.py +10 -8
  62. celldetective/scripts/train_segmentation_model.py +18 -6
  63. celldetective/signals.py +29 -14
  64. celldetective/tracking.py +14 -3
  65. celldetective/utils.py +91 -62
  66. {celldetective-1.3.9.post5.dist-info → celldetective-1.4.1.dist-info}/METADATA +24 -16
  67. celldetective-1.4.1.dist-info/RECORD +123 -0
  68. {celldetective-1.3.9.post5.dist-info → celldetective-1.4.1.dist-info}/WHEEL +1 -1
  69. tests/gui/__init__.py +0 -0
  70. tests/gui/test_new_project.py +228 -0
  71. tests/gui/test_project.py +99 -0
  72. tests/test_preprocessing.py +2 -2
  73. celldetective/models/segmentation_effectors/ricm_bf_all_last/config_input.json +0 -79
  74. celldetective/models/segmentation_effectors/ricm_bf_all_last/ricm_bf_all_last +0 -0
  75. celldetective/models/segmentation_effectors/ricm_bf_all_last/training_instructions.json +0 -37
  76. celldetective/models/segmentation_effectors/test-transfer/config_input.json +0 -39
  77. celldetective/models/segmentation_effectors/test-transfer/test-transfer +0 -0
  78. celldetective/models/signal_detection/NucCond/classification_loss.png +0 -0
  79. celldetective/models/signal_detection/NucCond/classifier.h5 +0 -0
  80. celldetective/models/signal_detection/NucCond/config_input.json +0 -1
  81. celldetective/models/signal_detection/NucCond/log_classifier.csv +0 -126
  82. celldetective/models/signal_detection/NucCond/log_regressor.csv +0 -282
  83. celldetective/models/signal_detection/NucCond/regression_loss.png +0 -0
  84. celldetective/models/signal_detection/NucCond/regressor.h5 +0 -0
  85. celldetective/models/signal_detection/NucCond/scores.npy +0 -0
  86. celldetective/models/signal_detection/NucCond/test_confusion_matrix.png +0 -0
  87. celldetective/models/signal_detection/NucCond/test_regression.png +0 -0
  88. celldetective/models/signal_detection/NucCond/validation_confusion_matrix.png +0 -0
  89. celldetective/models/signal_detection/NucCond/validation_regression.png +0 -0
  90. celldetective-1.3.9.post5.dist-info/RECORD +0 -129
  91. tests/test_qt.py +0 -103
  92. {celldetective-1.3.9.post5.dist-info → celldetective-1.4.1.dist-info}/entry_points.txt +0 -0
  93. {celldetective-1.3.9.post5.dist-info → celldetective-1.4.1.dist-info/licenses}/LICENSE +0 -0
  94. {celldetective-1.3.9.post5.dist-info → celldetective-1.4.1.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,13 @@
1
- from PyQt5.QtWidgets import QRadioButton, QButtonGroup, QMainWindow, QApplication, QMessageBox, QScrollArea, QComboBox, QFrame, QCheckBox, QFileDialog, QGridLayout, QTextEdit, QLineEdit, QVBoxLayout, QWidget, QLabel, QHBoxLayout, QPushButton
1
+ """
2
+ Copyright © 2023 Laboratoire Adhesion et Inflammation, Authored by Remy Torro.
3
+ """
4
+
5
+
6
+ from PyQt5.QtWidgets import QRadioButton, QButtonGroup, QMessageBox, QComboBox, QFrame, QCheckBox, QFileDialog, QGridLayout, QTextEdit, QLineEdit, QVBoxLayout, QLabel, QHBoxLayout, QPushButton
2
7
  from PyQt5.QtCore import Qt, QSize
3
- from PyQt5.QtGui import QDoubleValidator
4
8
 
5
- from celldetective.gui.gui_utils import center_window, FeatureChoice, ListWidget, QHSeperationLine, FigureCanvas, help_generic
6
- from superqt import QLabeledDoubleSlider,QLabeledSlider
9
+ from celldetective.gui.gui_utils import FeatureChoice, ListWidget, QHSeperationLine, FigureCanvas, help_generic
10
+ from superqt import QLabeledDoubleSlider, QLabeledSlider
7
11
  from superqt.fonticon import icon
8
12
  from fonticon_mdi6 import MDI6
9
13
  from celldetective.utils import extract_experiment_channels, get_software_location
@@ -16,9 +20,10 @@ import os
16
20
  import matplotlib.pyplot as plt
17
21
  from mpl_toolkits.axes_grid1 import make_axes_locatable
18
22
  from glob import glob
19
- from celldetective.gui import Styles
23
+ from celldetective.gui.settings._settings_base import CelldetectiveSettingsPanel
24
+
20
25
 
21
- class ConfigTracking(QMainWindow, Styles):
26
+ class SettingsTracking(CelldetectiveSettingsPanel):
22
27
 
23
28
  """
24
29
  UI to set tracking parameters for bTrack.
@@ -27,51 +32,51 @@ class ConfigTracking(QMainWindow, Styles):
27
32
 
28
33
  def __init__(self, parent_window=None):
29
34
 
30
- super().__init__()
31
35
  self.parent_window = parent_window
32
- self.setWindowTitle("Configure tracking")
33
36
  self.mode = self.parent_window.mode
34
37
  self.exp_dir = self.parent_window.exp_dir
35
- self.floatValidator = QDoubleValidator()
36
-
37
- if self.mode=="targets":
38
- self.config_name = os.sep.join(["configs", "btrack_config_targets.json"])
39
- self.track_instructions_write_path = self.parent_window.exp_dir + os.sep.join(["configs","tracking_instructions_targets.json"])
40
- elif self.mode=="effectors":
41
- self.config_name = os.sep.join(["configs","btrack_config_effectors.json"])
42
- self.track_instructions_write_path = self.parent_window.exp_dir + os.sep.join(["configs", "tracking_instructions_effectors.json"])
43
- self.soft_path = get_software_location()
38
+
39
+ self.config_name = os.sep.join(["configs", f"btrack_config_{self.mode}.json"])
40
+ self.track_instructions_write_path = self.parent_window.exp_dir + os.sep.join(["configs", f"tracking_instructions_{self.mode}.json"])
44
41
 
45
- exp_config = self.exp_dir +"config.ini"
46
42
  self.config_path = self.exp_dir + self.config_name
47
43
  self.channel_names, self.channels = extract_experiment_channels(self.exp_dir)
48
44
  self.channel_names = np.array(self.channel_names)
49
45
  self.channels = np.array(self.channels)
50
- self.screen_height = self.parent_window.parent_window.parent_window.screen_height
51
-
52
- center_window(self)
53
- self.setMinimumWidth(540)
54
46
  self.minimum_height = 300
55
- # self.setMinimumHeight(int(0.3*self.screen_height))
56
- # self.setMaximumHeight(int(0.8*self.screen_height))
57
- self.populate_widget()
58
- self.load_previous_tracking_instructions()
59
47
 
60
- def populate_widget(self):
48
+ super().__init__(title="Configure tracking")
49
+
50
+ self._add_to_layout()
51
+ self._load_previous_instructions()
52
+
53
+ self._widget.setMinimumWidth(500)
54
+ self._adjustSize()
55
+ self.resize(int(self.width()*1.5), int(self._screen_height * 0.8))
56
+
57
+ def _add_to_layout(self):
58
+
59
+ tracker_hbox = QHBoxLayout()
60
+ tracker_hbox.setContentsMargins(15, 15, 15, 15)
61
+ tracker_hbox.addWidget(self.btrack_option, 50, alignment=Qt.AlignCenter)
62
+ tracker_hbox.addWidget(self.trackpy_option, 50, alignment=Qt.AlignCenter)
63
+
64
+ self._layout.addLayout(tracker_hbox)
65
+ self._layout.addWidget(self.config_frame)
66
+ self._layout.addWidget(self.features_frame)
67
+ self._layout.addWidget(self.config_trackpy_frame)
68
+ self._layout.addWidget(self.post_proc_frame)
69
+ self._layout.addWidget(self.submit_btn)
70
+
71
+
72
+ def _create_widgets(self):
61
73
 
62
74
  """
63
75
  Create the multibox design with collapsable frames.
64
76
 
65
77
  """
66
78
 
67
- # Create button widget and layout
68
- self.scroll_area = QScrollArea(self)
69
- self.button_widget = QWidget()
70
- main_layout = QVBoxLayout()
71
- self.button_widget.setLayout(main_layout)
72
- main_layout.setContentsMargins(30,30,30,30)
73
-
74
- # First collapsable Frame CONFIG
79
+ super()._create_widgets()
75
80
 
76
81
  self.btrack_option = QRadioButton('bTrack')
77
82
  self.btrack_option.setChecked(True)
@@ -85,70 +90,37 @@ class ConfigTracking(QMainWindow, Styles):
85
90
  self.config_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
86
91
  self.populate_config_frame()
87
92
 
88
- tracker_hbox = QHBoxLayout()
89
- tracker_hbox.setContentsMargins(15,15,15,15)
90
- tracker_hbox.addWidget(self.btrack_option, 50, alignment=Qt.AlignCenter)
91
- tracker_hbox.addWidget(self.trackpy_option, 50, alignment=Qt.AlignCenter)
92
- main_layout.addLayout(tracker_hbox)
93
-
94
- main_layout.addWidget(self.config_frame)
95
-
96
93
  # Second collapsable frame FEATURES
97
94
  self.features_frame = QFrame()
98
95
  self.features_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
99
96
  self.populate_features_frame()
100
- main_layout.addWidget(self.features_frame)
101
97
 
102
98
  self.config_trackpy_frame = QFrame()
103
99
  self.config_trackpy_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
104
100
  self.populate_config_trackpy_frame()
105
- main_layout.addWidget(self.config_trackpy_frame)
106
101
  self.config_trackpy_frame.hide()
107
102
 
108
103
  # Third collapsable frame POST-PROCESSING
109
104
  self.post_proc_frame = QFrame()
110
105
  self.post_proc_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
111
106
  self.populate_post_proc_frame()
112
- main_layout.addWidget(self.post_proc_frame)
113
-
114
- self.submit_btn = QPushButton('Save')
115
- self.submit_btn.setStyleSheet(self.parent_window.parent_window.parent_window.button_style_sheet)
116
- self.submit_btn.clicked.connect(self.write_instructions)
117
- main_layout.addWidget(self.submit_btn)
118
-
119
- #self.populate_left_panel()
120
- #grid.addLayout(self.left_side, 0, 0, 1, 1)
121
- self.button_widget.adjustSize()
122
-
123
- self.scroll_area.setAlignment(Qt.AlignCenter)
124
- self.scroll_area.setWidget(self.button_widget)
125
- self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
126
- self.scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
127
- self.scroll_area.setWidgetResizable(True)
128
- self.setCentralWidget(self.scroll_area)
129
- self.show()
130
107
 
131
108
  self.btrack_option.toggled.connect(self.show_tracking_options)
132
109
  self.trackpy_option.toggled.connect(self.show_tracking_options)
133
110
 
134
- QApplication.processEvents()
135
- self.adjustScrollArea()
136
-
137
111
  def show_tracking_options(self):
138
112
 
139
113
  if self.btrack_option.isChecked():
140
114
  self.config_frame.show()
141
115
  self.features_frame.show()
142
116
  self.config_trackpy_frame.hide()
143
- #self.scroll_area.setMinimumHeight(min(int(930), int(0.9*self.screen_height)))
144
- #self.adjustSize()
117
+ #self._adjustSize()
145
118
  else:
146
119
  self.config_frame.hide()
147
120
  self.features_frame.hide()
148
121
  self.config_trackpy_frame.show()
149
- #self.scroll_area.setMinimumHeight(self.minimum_height)
150
- #self.adjustSize()
151
-
122
+ #self._adjustSize()
123
+
152
124
 
153
125
  def populate_post_proc_frame(self):
154
126
 
@@ -172,13 +144,13 @@ class ConfigTracking(QMainWindow, Styles):
172
144
  title_hbox = QHBoxLayout()
173
145
 
174
146
  self.collapse_post_proc_btn = QPushButton()
175
- self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_down,color="black"))
147
+ self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_down, color="black"))
176
148
  self.collapse_post_proc_btn.setIconSize(QSize(20, 20))
177
149
  self.collapse_post_proc_btn.setStyleSheet(self.button_select_all)
178
150
  #grid.addWidget(self.collapse_post_proc_btn, 0, 0, 1, 4, alignment=Qt.AlignRight)
179
151
 
180
152
  self.help_post_btn = QPushButton()
181
- self.help_post_btn.setIcon(icon(MDI6.help_circle,color=self.help_color))
153
+ self.help_post_btn.setIcon(icon(MDI6.help_circle, color=self.help_color))
182
154
  self.help_post_btn.setIconSize(QSize(20, 20))
183
155
  self.help_post_btn.clicked.connect(self.help_post)
184
156
  self.help_post_btn.setStyleSheet(self.button_select_all)
@@ -188,7 +160,7 @@ class ConfigTracking(QMainWindow, Styles):
188
160
  title_hbox.addWidget(QLabel(), 85, alignment=Qt.AlignCenter)
189
161
  title_hbox.addWidget(self.help_post_btn, 5)
190
162
  title_hbox.addWidget(self.collapse_post_proc_btn, 5)
191
- grid.addLayout(title_hbox, 0,0,1,4)
163
+ grid.addLayout(title_hbox, 0, 0, 1, 4)
192
164
 
193
165
  self.generate_post_proc_panel_contents()
194
166
  grid.addWidget(self.ContentsPostProc, 1, 0, 1, 4, alignment=Qt.AlignTop)
@@ -205,15 +177,15 @@ class ConfigTracking(QMainWindow, Styles):
205
177
  is_open = np.array([features_open, config_open, post_open])
206
178
 
207
179
  if self.ContentsPostProc.isHidden():
208
- self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_down,color="black"))
180
+ self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_down, color="black"))
209
181
  self.collapse_post_proc_btn.setIconSize(QSize(20, 20))
210
182
  if len(is_open[is_open])==0:
211
- self.scroll_area.setMinimumHeight(int(self.minimum_height))
212
- self.adjustSize()
183
+ pass
184
+ #self._scroll_area.setMinimumHeight(int(self.minimum_height))
185
+ #self._adjustSize()
213
186
  else:
214
- self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_up,color="black"))
187
+ self.collapse_post_proc_btn.setIcon(icon(MDI6.chevron_up, color="black"))
215
188
  self.collapse_post_proc_btn.setIconSize(QSize(20, 20))
216
- self.scroll_area.setMinimumHeight(min(int(930), int(0.9*self.screen_height)))
217
189
 
218
190
 
219
191
  def help_post(self):
@@ -222,7 +194,7 @@ class ConfigTracking(QMainWindow, Styles):
222
194
  Helper for track post-processing strategy.
223
195
  """
224
196
 
225
- dict_path = os.sep.join([get_software_location(),'celldetective','gui','help','track-postprocessing.json'])
197
+ dict_path = os.sep.join([get_software_location(), 'celldetective', 'gui', 'help', 'track-postprocessing.json'])
226
198
 
227
199
  with open(dict_path) as f:
228
200
  d = json.load(f)
@@ -246,7 +218,7 @@ class ConfigTracking(QMainWindow, Styles):
246
218
  Helper for track post-processing strategy.
247
219
  """
248
220
 
249
- dict_path = os.sep.join([get_software_location(),'celldetective','gui','help','feature-btrack.json'])
221
+ dict_path = os.sep.join([get_software_location(), 'celldetective', 'gui', 'help', 'feature-btrack.json'])
250
222
 
251
223
  with open(dict_path) as f:
252
224
  d = json.load(f)
@@ -300,7 +272,7 @@ class ConfigTracking(QMainWindow, Styles):
300
272
  title_hbox.addWidget(QLabel(), 85, alignment=Qt.AlignCenter)
301
273
  title_hbox.addWidget(self.help_feature_btn, 5)
302
274
  title_hbox.addWidget(self.collapse_features_btn, 5)
303
- grid.addLayout(title_hbox, 0,0,1,4)
275
+ grid.addLayout(title_hbox, 0, 0, 1, 4)
304
276
 
305
277
  self.generate_feature_panel_contents()
306
278
  grid.addWidget(self.ContentsFeatures, 1, 0, 1, 4, alignment=Qt.AlignTop)
@@ -321,15 +293,15 @@ class ConfigTracking(QMainWindow, Styles):
321
293
  is_open = np.array([features_open, config_open, post_open])
322
294
 
323
295
  if self.ContentsFeatures.isHidden():
324
- self.collapse_features_btn.setIcon(icon(MDI6.chevron_down,color="black"))
296
+ self.collapse_features_btn.setIcon(icon(MDI6.chevron_down, color="black"))
325
297
  self.collapse_features_btn.setIconSize(QSize(20, 20))
326
298
  if len(is_open[is_open])==0:
327
- self.scroll_area.setMinimumHeight(int(self.minimum_height))
328
- self.adjustSize()
299
+ pass
300
+ #self._scroll_area.setMinimumHeight(int(self.minimum_height))
301
+ #self._adjustSize()
329
302
  else:
330
- self.collapse_features_btn.setIcon(icon(MDI6.chevron_up,color="black"))
303
+ self.collapse_features_btn.setIcon(icon(MDI6.chevron_up, color="black"))
331
304
  self.collapse_features_btn.setIconSize(QSize(20, 20))
332
- self.scroll_area.setMinimumHeight(min(int(930), int(0.9*self.screen_height)))
333
305
 
334
306
 
335
307
  def generate_post_proc_panel_contents(self):
@@ -351,7 +323,7 @@ class ConfigTracking(QMainWindow, Styles):
351
323
  self.min_tracklength_slider.setSingleStep(1)
352
324
  self.min_tracklength_slider.setTickInterval(1)
353
325
  self.min_tracklength_slider.setSingleStep(1)
354
- self.min_tracklength_slider.setOrientation(1)
326
+ self.min_tracklength_slider.setOrientation(Qt.Horizontal)
355
327
  self.min_tracklength_slider.setRange(0,self.parent_window.parent_window.len_movie)
356
328
  self.min_tracklength_slider.setValue(0)
357
329
  tracklength_layout.addWidget(QLabel('Min. tracklength: '),40)
@@ -391,7 +363,6 @@ class ConfigTracking(QMainWindow, Styles):
391
363
 
392
364
  layout.addLayout(clean_traj_sublayout)
393
365
 
394
-
395
366
  def generate_feature_panel_contents(self):
396
367
 
397
368
  self.ContentsFeatures = QFrame()
@@ -456,10 +427,9 @@ class ConfigTracking(QMainWindow, Styles):
456
427
 
457
428
  # Slider to set vmin & vmax
458
429
  self.haralick_scale_slider = QLabeledDoubleSlider()
459
- self.haralick_scale_slider.setSingleStep(0.05)
460
430
  self.haralick_scale_slider.setTickInterval(0.05)
461
431
  self.haralick_scale_slider.setSingleStep(1)
462
- self.haralick_scale_slider.setOrientation(1)
432
+ self.haralick_scale_slider.setOrientation(Qt.Horizontal)
463
433
  self.haralick_scale_slider.setRange(0,1)
464
434
  self.haralick_scale_slider.setValue(0.5)
465
435
  self.haralick_scale_lbl = QLabel('Scale: ')
@@ -621,12 +591,12 @@ class ConfigTracking(QMainWindow, Styles):
621
591
  self.collapse_config_btn.setIcon(icon(MDI6.chevron_down,color="black"))
622
592
  self.collapse_config_btn.setIconSize(QSize(20, 20))
623
593
  if len(is_open[is_open])==0:
624
- self.scroll_area.setMinimumHeight(int(self.minimum_height))
625
- self.adjustSize()
594
+ pass
595
+ #self._scroll_area.setMinimumHeight(int(self.minimum_height))
596
+ #self._adjustSize()
626
597
  else:
627
598
  self.collapse_config_btn.setIcon(icon(MDI6.chevron_up,color="black"))
628
599
  self.collapse_config_btn.setIconSize(QSize(20, 20))
629
- self.scroll_area.setMinimumHeight(min(int(930), int(0.9*self.screen_height)))
630
600
 
631
601
  def collapse_config_trackpy_advanced(self):
632
602
 
@@ -642,12 +612,12 @@ class ConfigTracking(QMainWindow, Styles):
642
612
  self.collapse_config_trackpy_btn.setIcon(icon(MDI6.chevron_down,color="black"))
643
613
  self.collapse_config_trackpy_btn.setIconSize(QSize(20, 20))
644
614
  if len(is_open[is_open])==0:
645
- self.scroll_area.setMinimumHeight(int(self.minimum_height))
646
- self.adjustSize()
615
+ pass
616
+ #self._scroll_area.setMinimumHeight(int(self.minimum_height))
617
+ #self._adjustSize()
647
618
  else:
648
619
  self.collapse_config_trackpy_btn.setIcon(icon(MDI6.chevron_up,color="black"))
649
620
  self.collapse_config_trackpy_btn.setIconSize(QSize(20, 20))
650
- self.scroll_area.setMinimumHeight(min(int(930), int(0.9*self.screen_height)))
651
621
 
652
622
 
653
623
  def generate_config_trackpy_panel_contents(self):
@@ -660,7 +630,7 @@ class ConfigTracking(QMainWindow, Styles):
660
630
  self.search_range_lbl = QLabel("search range [px]: ")
661
631
  self.search_range_le = QLineEdit('30')
662
632
  self.search_range_le.setPlaceholderText('search distance in pixels')
663
- self.search_range_le.setValidator(self.floatValidator)
633
+ self.search_range_le.setValidator(self._floatValidator)
664
634
  sr_layout.addWidget(self.search_range_lbl, 30)
665
635
  sr_layout.addWidget(self.search_range_le, 70)
666
636
  layout.addLayout(sr_layout)
@@ -671,7 +641,7 @@ class ConfigTracking(QMainWindow, Styles):
671
641
  self.memory_slider.setSingleStep(1)
672
642
  self.memory_slider.setTickInterval(1)
673
643
  self.memory_slider.setSingleStep(1)
674
- self.memory_slider.setOrientation(1)
644
+ self.memory_slider.setOrientation(Qt.Horizontal)
675
645
  self.memory_slider.setRange(0,self.parent_window.parent_window.len_movie)
676
646
  self.memory_slider.setValue(0)
677
647
  memory_layout.addWidget(self.memory_lbl, 30)
@@ -738,14 +708,14 @@ class ConfigTracking(QMainWindow, Styles):
738
708
 
739
709
  self.file_dialog = QFileDialog()
740
710
  try:
741
- modelpath = os.sep.join([self.soft_path, "celldetective","models","tracking_configs"]) + os.sep
711
+ modelpath = os.sep.join([self._software_path, "celldetective","models","tracking_configs"]) + os.sep
742
712
  print("Track config path: ", modelpath)
743
713
  self.filename = self.file_dialog.getOpenFileName(None, "Load config", modelpath, "json files (*.json)")[0]
744
714
  if self.filename!=self.config_path:
745
715
  copyfile(self.filename, self.config_path)
746
716
  self.load_cell_config()
747
717
  except Exception as e:
748
- print(e, modelpath)
718
+ print(e)
749
719
  return None
750
720
 
751
721
  def reset_btrack_config(self):
@@ -829,16 +799,16 @@ class ConfigTracking(QMainWindow, Styles):
829
799
  else:
830
800
  self.post_proc_ticked = True
831
801
 
832
- def adjustScrollArea(self):
833
-
834
- """
835
- Auto-adjust scroll area to fill space
836
- (from https://stackoverflow.com/questions/66417576/make-qscrollarea-use-all-available-space-of-qmainwindow-height-axis)
837
- """
838
-
839
- step = 5
840
- while self.scroll_area.verticalScrollBar().isVisible() and self.height() < self.maximumHeight():
841
- self.resize(self.width(), self.height() + step)
802
+ # def adjustScrollArea(self):
803
+ #
804
+ # """
805
+ # Auto-adjust scroll area to fill space
806
+ # (from https://stackoverflow.com/questions/66417576/make-qscrollarea-use-all-available-space-of-qmainwindow-height-axis)
807
+ # """
808
+ #
809
+ # step = 5
810
+ # while self._scroll_area.verticalScrollBar().isVisible() and self.height() < self.maximumHeight():
811
+ # self.resize(self.width(), self.height() + step)
842
812
 
843
813
  def load_cell_config(self):
844
814
 
@@ -851,7 +821,7 @@ class ConfigTracking(QMainWindow, Styles):
851
821
  json_data = json.load(f)
852
822
  self.config_le.setText(json.dumps(json_data, indent=4))
853
823
 
854
- def write_instructions(self):
824
+ def _write_instructions(self):
855
825
 
856
826
  """
857
827
  Write the selected options in a json file for later reading by the software.
@@ -960,7 +930,7 @@ class ConfigTracking(QMainWindow, Styles):
960
930
  else:
961
931
  self.haralick_options = None
962
932
 
963
- def load_previous_tracking_instructions(self):
933
+ def _load_previous_instructions(self):
964
934
 
965
935
  """
966
936
  Read the tracking options from a previously written json file.
@@ -994,7 +964,7 @@ class ConfigTracking(QMainWindow, Styles):
994
964
  if 'search_range' in tracking_instructions:
995
965
  search_range = tracking_instructions['search_range']
996
966
  if search_range is not None:
997
- self.search_range_le.setText(str(search_range).replace('.',','))
967
+ self.search_range_le.setText(str(search_range).replace('.', ','))
998
968
  if 'memory' in tracking_instructions:
999
969
  memory = tracking_instructions['memory']
1000
970
  if memory is not None:
@@ -1072,7 +1042,7 @@ class ConfigTracking(QMainWindow, Styles):
1072
1042
  Load the first frame of the first movie found in the experiment folder as a sample.
1073
1043
  """
1074
1044
 
1075
- movies = glob(self.parent_window.parent_window.exp_dir + os.sep.join(["*","*","movie",self.parent_window.parent_window.movie_prefix+"*.tif"]))
1045
+ movies = glob(self.parent_window.parent_window.exp_dir + os.sep.join(["*", "*", "movie", self.parent_window.parent_window.movie_prefix+"*.tif"]))
1076
1046
  if len(movies)==0:
1077
1047
  msgBox = QMessageBox()
1078
1048
  msgBox.setIcon(QMessageBox.Warning)
@@ -1088,7 +1058,6 @@ class ConfigTracking(QMainWindow, Styles):
1088
1058
  n_channels = len(self.channels)
1089
1059
  self.test_frame = load_frames(np.arange(n_channels), stack0, scale=None, normalize_input=False)
1090
1060
 
1091
-
1092
1061
  def control_haralick_digitalization(self):
1093
1062
 
1094
1063
  """
@@ -14,7 +14,8 @@ class Styles(object):
14
14
 
15
15
 
16
16
  self.celldetective_blue = "#1565c0"
17
- self.celldetective_icon = QIcon(os.sep.join([get_software_location(),'celldetective','icons','logo.png']))
17
+ self.celldetective_logo_path = os.sep.join([get_software_location(),'celldetective','icons','logo.png'])
18
+ self.celldetective_icon = QIcon(self.celldetective_logo_path)
18
19
 
19
20
  self.action_lbl_style_sheet = """
20
21
  font-size: 10px;