celldetective 1.4.0__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.
- celldetective/_version.py +1 -1
- celldetective/exceptions.py +11 -0
- celldetective/filters.py +7 -1
- celldetective/gui/InitWindow.py +4 -1
- celldetective/gui/__init__.py +2 -9
- celldetective/gui/about.py +2 -2
- celldetective/gui/base_annotator.py +786 -0
- celldetective/gui/classifier_widget.py +18 -13
- celldetective/gui/configure_new_exp.py +51 -30
- celldetective/gui/control_panel.py +10 -7
- celldetective/gui/{signal_annotator.py → event_annotator.py} +473 -1437
- celldetective/gui/generic_signal_plot.py +2 -1
- celldetective/gui/gui_utils.py +5 -2
- celldetective/gui/help/neighborhood.json +2 -2
- celldetective/gui/layouts.py +21 -11
- celldetective/gui/{signal_annotator2.py → pair_event_annotator.py} +3 -1
- celldetective/gui/process_block.py +129 -91
- celldetective/gui/processes/downloader.py +37 -34
- celldetective/gui/processes/measure_cells.py +14 -8
- celldetective/gui/processes/segment_cells.py +21 -6
- celldetective/gui/processes/track_cells.py +12 -13
- celldetective/gui/settings/__init__.py +7 -0
- celldetective/gui/settings/_settings_base.py +70 -0
- celldetective/gui/{retrain_signal_model_options.py → settings/_settings_event_model_training.py} +35 -91
- celldetective/gui/{measurement_options.py → settings/_settings_measurements.py} +28 -81
- celldetective/gui/{neighborhood_options.py → settings/_settings_neighborhood.py} +1 -1
- celldetective/gui/settings/_settings_segmentation.py +49 -0
- celldetective/gui/{retrain_segmentation_model_options.py → settings/_settings_segmentation_model_training.py} +33 -79
- celldetective/gui/{signal_annotator_options.py → settings/_settings_signal_annotator.py} +73 -95
- celldetective/gui/{btrack_options.py → settings/_settings_tracking.py} +64 -87
- celldetective/gui/styles.py +2 -1
- celldetective/gui/survival_ui.py +1 -1
- celldetective/gui/tableUI.py +25 -0
- celldetective/gui/table_ops/__init__.py +0 -0
- celldetective/gui/table_ops/merge_groups.py +118 -0
- celldetective/gui/viewers.py +3 -5
- celldetective/gui/workers.py +0 -2
- celldetective/io.py +98 -55
- celldetective/links/zenodo.json +145 -144
- celldetective/measure.py +31 -26
- celldetective/preprocessing.py +34 -21
- celldetective/regionprops/_regionprops.py +16 -5
- celldetective/scripts/measure_cells.py +5 -5
- celldetective/scripts/measure_relative.py +16 -11
- celldetective/scripts/segment_cells.py +4 -4
- celldetective/scripts/segment_cells_thresholds.py +3 -3
- celldetective/scripts/track_cells.py +7 -7
- celldetective/scripts/train_segmentation_model.py +10 -1
- celldetective/tracking.py +10 -4
- celldetective/utils.py +59 -58
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/METADATA +1 -1
- celldetective-1.4.1.dist-info/RECORD +123 -0
- tests/gui/__init__.py +0 -0
- tests/gui/test_new_project.py +228 -0
- tests/{test_qt.py → gui/test_project.py} +22 -26
- tests/test_preprocessing.py +2 -2
- celldetective/models/segmentation_effectors/ricm_bf_all_last/config_input.json +0 -79
- celldetective/models/segmentation_effectors/ricm_bf_all_last/ricm_bf_all_last +0 -0
- celldetective/models/segmentation_effectors/ricm_bf_all_last/training_instructions.json +0 -37
- celldetective/models/segmentation_effectors/test-transfer/config_input.json +0 -39
- celldetective/models/segmentation_effectors/test-transfer/test-transfer +0 -0
- celldetective/models/signal_detection/NucCond/classification_loss.png +0 -0
- celldetective/models/signal_detection/NucCond/classifier.h5 +0 -0
- celldetective/models/signal_detection/NucCond/config_input.json +0 -1
- celldetective/models/signal_detection/NucCond/log_classifier.csv +0 -126
- celldetective/models/signal_detection/NucCond/log_regressor.csv +0 -282
- celldetective/models/signal_detection/NucCond/regression_loss.png +0 -0
- celldetective/models/signal_detection/NucCond/regressor.h5 +0 -0
- celldetective/models/signal_detection/NucCond/scores.npy +0 -0
- celldetective/models/signal_detection/NucCond/test_confusion_matrix.png +0 -0
- celldetective/models/signal_detection/NucCond/test_regression.png +0 -0
- celldetective/models/signal_detection/NucCond/validation_confusion_matrix.png +0 -0
- celldetective/models/signal_detection/NucCond/validation_regression.png +0 -0
- celldetective-1.4.0.dist-info/RECORD +0 -131
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/WHEEL +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/entry_points.txt +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/licenses/LICENSE +0 -0
- {celldetective-1.4.0.dist-info → celldetective-1.4.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from PyQt5 import QtCore
|
|
3
|
+
from PyQt5.QtWidgets import QApplication
|
|
4
|
+
from celldetective.gui.InitWindow import AppInitWindow
|
|
5
|
+
from celldetective.utils import get_software_location
|
|
6
|
+
import os
|
|
7
|
+
from unittest.mock import patch
|
|
8
|
+
import shutil
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
abs_path = os.sep.join([os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]])
|
|
12
|
+
print(abs_path)
|
|
13
|
+
|
|
14
|
+
@pytest.fixture
|
|
15
|
+
def app(qtbot):
|
|
16
|
+
software_location = get_software_location()
|
|
17
|
+
test_app = AppInitWindow(software_location=software_location)
|
|
18
|
+
qtbot.addWidget(test_app)
|
|
19
|
+
return test_app
|
|
20
|
+
|
|
21
|
+
def test_new_project(app, qtbot):
|
|
22
|
+
# app.newExpAction.trigger()
|
|
23
|
+
# qtbot.wait(1000)
|
|
24
|
+
interaction_time = 500
|
|
25
|
+
test_directory = os.path.dirname(os.path.abspath(__file__))
|
|
26
|
+
parent_directory = str(Path(test_directory).parent)
|
|
27
|
+
|
|
28
|
+
# Patch QFileDialog.getExistingDirectory to return test_directory
|
|
29
|
+
with patch('PyQt5.QtWidgets.QFileDialog.getExistingDirectory', return_value=parent_directory):
|
|
30
|
+
|
|
31
|
+
if os.path.exists(os.sep.join([parent_directory, "ExperimentTest"])):
|
|
32
|
+
shutil.rmtree(os.sep.join([parent_directory, "ExperimentTest"]))
|
|
33
|
+
|
|
34
|
+
app.newExpAction.trigger()
|
|
35
|
+
qtbot.wait(interaction_time*3)
|
|
36
|
+
|
|
37
|
+
app.new_exp_window.expName.setText('ExperimentTest')
|
|
38
|
+
qtbot.wait(interaction_time)
|
|
39
|
+
|
|
40
|
+
app.new_exp_window.SliderWells.setValue(10)
|
|
41
|
+
qtbot.wait(interaction_time)
|
|
42
|
+
|
|
43
|
+
app.new_exp_window.SliderPos.setValue(3)
|
|
44
|
+
qtbot.wait(interaction_time)
|
|
45
|
+
|
|
46
|
+
app.new_exp_window.MovieLengthSlider.setValue(1)
|
|
47
|
+
qtbot.wait(interaction_time)
|
|
48
|
+
|
|
49
|
+
app.new_exp_window.PxToUm_field.setText("0,3112")
|
|
50
|
+
qtbot.wait(interaction_time)
|
|
51
|
+
|
|
52
|
+
app.new_exp_window.shape_x_field.setText("660")
|
|
53
|
+
qtbot.wait(interaction_time)
|
|
54
|
+
|
|
55
|
+
app.new_exp_window.shape_y_field.setText('682')
|
|
56
|
+
qtbot.wait(interaction_time)
|
|
57
|
+
|
|
58
|
+
# set first channel
|
|
59
|
+
app.new_exp_window.checkBoxes[0].setChecked(True)
|
|
60
|
+
qtbot.wait(interaction_time)
|
|
61
|
+
|
|
62
|
+
app.new_exp_window.sliders[0].setValue(0)
|
|
63
|
+
qtbot.wait(interaction_time)
|
|
64
|
+
|
|
65
|
+
# set second with channel index of 1
|
|
66
|
+
app.new_exp_window.checkBoxes[1].setChecked(True)
|
|
67
|
+
qtbot.wait(interaction_time)
|
|
68
|
+
|
|
69
|
+
app.new_exp_window.sliders[1].setValue(3)
|
|
70
|
+
qtbot.wait(interaction_time)
|
|
71
|
+
|
|
72
|
+
app.new_exp_window.checkBoxes[2].setChecked(True)
|
|
73
|
+
qtbot.wait(interaction_time)
|
|
74
|
+
|
|
75
|
+
app.new_exp_window.sliders[2].setValue(1)
|
|
76
|
+
qtbot.wait(interaction_time)
|
|
77
|
+
|
|
78
|
+
# add extra custom channel
|
|
79
|
+
qtbot.mouseClick(app.new_exp_window.addChannelBtn, QtCore.Qt.LeftButton)
|
|
80
|
+
qtbot.wait(interaction_time)
|
|
81
|
+
|
|
82
|
+
app.new_exp_window.name_le.setText('empty_channel')
|
|
83
|
+
qtbot.wait(interaction_time)
|
|
84
|
+
|
|
85
|
+
qtbot.mouseClick(app.new_exp_window.createBtn, QtCore.Qt.LeftButton)
|
|
86
|
+
qtbot.wait(interaction_time)
|
|
87
|
+
|
|
88
|
+
app.new_exp_window.checkBoxes[-1].setChecked(True)
|
|
89
|
+
qtbot.wait(interaction_time)
|
|
90
|
+
|
|
91
|
+
app.new_exp_window.sliders[-1].setValue(2)
|
|
92
|
+
qtbot.wait(interaction_time)
|
|
93
|
+
|
|
94
|
+
# Untick populations and create new one
|
|
95
|
+
for box in app.new_exp_window.population_checkboxes:
|
|
96
|
+
if box.text() == 'targets':
|
|
97
|
+
box.setChecked(True)
|
|
98
|
+
else:
|
|
99
|
+
box.setChecked(False)
|
|
100
|
+
|
|
101
|
+
qtbot.mouseClick(app.new_exp_window.addPopBtn, QtCore.Qt.LeftButton)
|
|
102
|
+
qtbot.wait(interaction_time)
|
|
103
|
+
|
|
104
|
+
app.new_exp_window.name_le.setText('more_cells')
|
|
105
|
+
qtbot.wait(interaction_time)
|
|
106
|
+
|
|
107
|
+
qtbot.mouseClick(app.new_exp_window.addPopBtn, QtCore.Qt.LeftButton)
|
|
108
|
+
qtbot.wait(interaction_time)
|
|
109
|
+
|
|
110
|
+
qtbot.mouseClick(app.new_exp_window.validate_button, QtCore.Qt.LeftButton)
|
|
111
|
+
qtbot.wait(interaction_time)
|
|
112
|
+
|
|
113
|
+
qtbot.mouseClick(app.new_exp_window.w.submit_btn, QtCore.Qt.LeftButton)
|
|
114
|
+
qtbot.wait(interaction_time)
|
|
115
|
+
|
|
116
|
+
shutil.copy(os.sep.join([parent_directory, "assets", "sample.tif"]), os.sep.join([parent_directory, "ExperimentTest", "W1", "100", "movie", "sample.tif"]))
|
|
117
|
+
qtbot.wait(interaction_time)
|
|
118
|
+
|
|
119
|
+
qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
120
|
+
qtbot.mouseClick(app.control_panel.view_stack_btn, QtCore.Qt.LeftButton)
|
|
121
|
+
qtbot.wait(interaction_time)
|
|
122
|
+
|
|
123
|
+
app.control_panel.viewer.channels_cb.setCurrentIndex(1)
|
|
124
|
+
qtbot.wait(interaction_time*2)
|
|
125
|
+
|
|
126
|
+
app.control_panel.viewer.contrast_slider.setValue([200,300])
|
|
127
|
+
qtbot.wait(interaction_time*2)
|
|
128
|
+
|
|
129
|
+
# QApplication.closeAllWindows()
|
|
130
|
+
# try:
|
|
131
|
+
# shutil.rmtree(os.sep.join([parent_directory, "ExperimentTest"]))
|
|
132
|
+
# except:
|
|
133
|
+
# pass
|
|
134
|
+
# def test_lauch_app(app, qtbot):
|
|
135
|
+
# app.show()
|
|
136
|
+
# qtbot.wait(1000)
|
|
137
|
+
#
|
|
138
|
+
# def test_open_project(app, qtbot):
|
|
139
|
+
# app.experiment_path_selection.setText(abs_path + os.sep + 'examples/demo')
|
|
140
|
+
# qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
141
|
+
# qtbot.wait(1000)
|
|
142
|
+
#
|
|
143
|
+
# def test_launch_demo(app, qtbot):
|
|
144
|
+
# app.experiment_path_selection.setText(abs_path + os.sep + 'examples/demo')
|
|
145
|
+
# qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
146
|
+
#
|
|
147
|
+
# def test_preprocessing_panel(app, qtbot):
|
|
148
|
+
#
|
|
149
|
+
# app.experiment_path_selection.setText(abs_path + os.sep + 'examples/demo')
|
|
150
|
+
# qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
151
|
+
#
|
|
152
|
+
# qtbot.mouseClick(app.control_panel.PreprocessingPanel.collapse_btn, QtCore.Qt.LeftButton)
|
|
153
|
+
# qtbot.mouseClick(app.control_panel.PreprocessingPanel.fit_correction_layout.add_correction_btn, QtCore.Qt.LeftButton)
|
|
154
|
+
# qtbot.mouseClick(app.control_panel.PreprocessingPanel.collapse_btn, QtCore.Qt.LeftButton)
|
|
155
|
+
#
|
|
156
|
+
# def test_app(app, qtbot):
|
|
157
|
+
#
|
|
158
|
+
# # Set an experiment folder and open
|
|
159
|
+
# app.experiment_path_selection.setText(os.sep.join([abs_path,'examples','demo']))
|
|
160
|
+
# qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
161
|
+
#
|
|
162
|
+
# # Set a position
|
|
163
|
+
# #app.control_panel.position_list.setCurrentIndex(0)
|
|
164
|
+
# #app.control_panel.update_position_options()
|
|
165
|
+
#
|
|
166
|
+
# # View stacl
|
|
167
|
+
# qtbot.mouseClick(app.control_panel.view_stack_btn, QtCore.Qt.LeftButton)
|
|
168
|
+
# #qtbot.wait(1000)
|
|
169
|
+
# app.control_panel.viewer.close()
|
|
170
|
+
#
|
|
171
|
+
# # Expand process block
|
|
172
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].collapse_btn, QtCore.Qt.LeftButton)
|
|
173
|
+
#
|
|
174
|
+
# # Use Threshold Config Wizard
|
|
175
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].upload_model_btn, QtCore.Qt.LeftButton)
|
|
176
|
+
# qtbot.wait(1000)
|
|
177
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].SegModelLoader.threshold_config_button, QtCore.Qt.LeftButton)
|
|
178
|
+
# app.control_panel.ProcessPopulations[0].SegModelLoader.ThreshWizard.close()
|
|
179
|
+
# app.control_panel.ProcessPopulations[0].SegModelLoader.close()
|
|
180
|
+
#
|
|
181
|
+
# # Check segmentation with napari
|
|
182
|
+
# #qtbot.mouseClick(app.control_panel.ProcessEffectors.check_seg_btn, QtCore.Qt.LeftButton)
|
|
183
|
+
# # close napari?
|
|
184
|
+
#
|
|
185
|
+
# # Train model
|
|
186
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].train_btn, QtCore.Qt.LeftButton)
|
|
187
|
+
# qtbot.wait(1000)
|
|
188
|
+
# app.control_panel.ProcessPopulations[0].ConfigSegmentationTrain.close()
|
|
189
|
+
#
|
|
190
|
+
# # Config tracking
|
|
191
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].track_config_btn, QtCore.Qt.LeftButton)
|
|
192
|
+
# qtbot.wait(1000)
|
|
193
|
+
# app.control_panel.ProcessPopulations[0].ConfigTracking.close()
|
|
194
|
+
#
|
|
195
|
+
# # Config measurements
|
|
196
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].measurements_config_btn, QtCore.Qt.LeftButton)
|
|
197
|
+
# qtbot.wait(1000)
|
|
198
|
+
# app.control_panel.ProcessPopulations[0].ConfigMeasurements.close()
|
|
199
|
+
#
|
|
200
|
+
# # Classifier widget
|
|
201
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].classify_btn, QtCore.Qt.LeftButton)
|
|
202
|
+
# qtbot.wait(1000)
|
|
203
|
+
# app.control_panel.ProcessPopulations[0].ClassifierWidget.close()
|
|
204
|
+
#
|
|
205
|
+
# # Config signal annotator
|
|
206
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].config_signal_annotator_btn, QtCore.Qt.LeftButton)
|
|
207
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].ConfigSignalAnnotator.rgb_btn, QtCore.Qt.LeftButton)
|
|
208
|
+
# qtbot.wait(1000)
|
|
209
|
+
# app.control_panel.ProcessPopulations[0].ConfigSignalAnnotator.close()
|
|
210
|
+
#
|
|
211
|
+
# # Signal annotator widget
|
|
212
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].check_signals_btn, QtCore.Qt.LeftButton)
|
|
213
|
+
# qtbot.wait(1000)
|
|
214
|
+
# app.control_panel.ProcessPopulations[0].SignalAnnotator.close()
|
|
215
|
+
#
|
|
216
|
+
# # Table widget
|
|
217
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].view_tab_btn, QtCore.Qt.LeftButton)
|
|
218
|
+
# qtbot.wait(1000)
|
|
219
|
+
# app.control_panel.ProcessPopulations[0].tab_ui.close()
|
|
220
|
+
#
|
|
221
|
+
# #qtbot.mouseClick(app.control_panel.PreprocessingPanel.fit_correction_layout.add_correction_btn, QtCore.Qt.LeftButton)
|
|
222
|
+
# qtbot.mouseClick(app.control_panel.ProcessPopulations[0].collapse_btn, QtCore.Qt.LeftButton)
|
|
223
|
+
#
|
|
224
|
+
#
|
|
225
|
+
#
|
|
226
|
+
# def test_click(app, qtbot):
|
|
227
|
+
# qtbot.mouseClick(app.new_exp_button, QtCore.Qt.LeftButton)
|
|
228
|
+
# qtbot.wait(10000)
|
|
@@ -2,36 +2,38 @@ import pytest
|
|
|
2
2
|
from PyQt5 import QtCore
|
|
3
3
|
from celldetective.gui.InitWindow import AppInitWindow
|
|
4
4
|
from celldetective.utils import get_software_location
|
|
5
|
-
import time
|
|
6
5
|
import os
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
print(abs_path)
|
|
7
|
+
software_location = get_software_location()
|
|
10
8
|
|
|
11
9
|
@pytest.fixture
|
|
12
10
|
def app(qtbot):
|
|
13
|
-
software_location = get_software_location()
|
|
14
11
|
test_app = AppInitWindow(software_location=software_location)
|
|
15
12
|
qtbot.addWidget(test_app)
|
|
16
13
|
return test_app
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
def test_open_project(app, qtbot):
|
|
16
|
+
app.experiment_path_selection.setText(software_location + os.sep + 'examples/demo')
|
|
17
|
+
qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
18
|
+
qtbot.wait(10000)
|
|
19
|
+
|
|
20
|
+
def test_launch_demo(app, qtbot):
|
|
21
|
+
app.experiment_path_selection.setText(software_location + os.sep + 'examples/demo')
|
|
22
|
+
qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
def test_preprocessing_panel(app, qtbot):
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
app.experiment_path_selection.setText(software_location + os.sep + 'examples/demo')
|
|
27
|
+
qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
qtbot.mouseClick(app.control_panel.PreprocessingPanel.collapse_btn, QtCore.Qt.LeftButton)
|
|
30
|
+
qtbot.mouseClick(app.control_panel.PreprocessingPanel.fit_correction_layout.add_correction_btn, QtCore.Qt.LeftButton)
|
|
31
|
+
qtbot.mouseClick(app.control_panel.PreprocessingPanel.collapse_btn, QtCore.Qt.LeftButton)
|
|
30
32
|
|
|
31
33
|
def test_app(app, qtbot):
|
|
32
34
|
|
|
33
35
|
# Set an experiment folder and open
|
|
34
|
-
app.experiment_path_selection.setText(os.sep.join([
|
|
36
|
+
app.experiment_path_selection.setText(os.sep.join([software_location,'examples','demo']))
|
|
35
37
|
qtbot.mouseClick(app.validate_button, QtCore.Qt.LeftButton)
|
|
36
38
|
|
|
37
39
|
# Set a position
|
|
@@ -60,17 +62,17 @@ def test_app(app, qtbot):
|
|
|
60
62
|
# Train model
|
|
61
63
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].train_btn, QtCore.Qt.LeftButton)
|
|
62
64
|
qtbot.wait(1000)
|
|
63
|
-
app.control_panel.ProcessPopulations[0].
|
|
65
|
+
app.control_panel.ProcessPopulations[0].settings_segmentation_training.close()
|
|
64
66
|
|
|
65
67
|
# Config tracking
|
|
66
68
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].track_config_btn, QtCore.Qt.LeftButton)
|
|
67
69
|
qtbot.wait(1000)
|
|
68
|
-
app.control_panel.ProcessPopulations[0].
|
|
70
|
+
app.control_panel.ProcessPopulations[0].settings_tracking.close()
|
|
69
71
|
|
|
70
72
|
# Config measurements
|
|
71
73
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].measurements_config_btn, QtCore.Qt.LeftButton)
|
|
72
74
|
qtbot.wait(1000)
|
|
73
|
-
app.control_panel.ProcessPopulations[0].
|
|
75
|
+
app.control_panel.ProcessPopulations[0].settings_measurements.close()
|
|
74
76
|
|
|
75
77
|
# Classifier widget
|
|
76
78
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].classify_btn, QtCore.Qt.LeftButton)
|
|
@@ -79,14 +81,14 @@ def test_app(app, qtbot):
|
|
|
79
81
|
|
|
80
82
|
# Config signal annotator
|
|
81
83
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].config_signal_annotator_btn, QtCore.Qt.LeftButton)
|
|
82
|
-
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].
|
|
84
|
+
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].settings_signal_annotator.rgb_btn, QtCore.Qt.LeftButton)
|
|
83
85
|
qtbot.wait(1000)
|
|
84
|
-
app.control_panel.ProcessPopulations[0].
|
|
86
|
+
app.control_panel.ProcessPopulations[0].settings_signal_annotator.close()
|
|
85
87
|
|
|
86
88
|
# Signal annotator widget
|
|
87
89
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].check_signals_btn, QtCore.Qt.LeftButton)
|
|
88
90
|
qtbot.wait(1000)
|
|
89
|
-
app.control_panel.ProcessPopulations[0].
|
|
91
|
+
app.control_panel.ProcessPopulations[0].event_annotator.close()
|
|
90
92
|
|
|
91
93
|
# Table widget
|
|
92
94
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].view_tab_btn, QtCore.Qt.LeftButton)
|
|
@@ -95,9 +97,3 @@ def test_app(app, qtbot):
|
|
|
95
97
|
|
|
96
98
|
#qtbot.mouseClick(app.control_panel.PreprocessingPanel.fit_correction_layout.add_correction_btn, QtCore.Qt.LeftButton)
|
|
97
99
|
qtbot.mouseClick(app.control_panel.ProcessPopulations[0].collapse_btn, QtCore.Qt.LeftButton)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
# def test_click(app, qtbot):
|
|
102
|
-
# qtbot.mouseClick(app.new_exp_button, QtCore.Qt.LeftButton)
|
|
103
|
-
# qtbot.wait(10000)
|
tests/test_preprocessing.py
CHANGED
|
@@ -20,11 +20,11 @@ class TestFitPlane(unittest.TestCase):
|
|
|
20
20
|
self.assertTrue(np.allclose(self.img, mat))
|
|
21
21
|
|
|
22
22
|
def test_plane_is_well_fit_and_applied_with_division(self):
|
|
23
|
-
result = field_correction(self.img,
|
|
23
|
+
result = field_correction(self.img, threshold=1.0E05, operation='divide', model='plane', clip=False, return_bg=False, activation_protocol=[])
|
|
24
24
|
self.assertTrue(np.allclose(result, np.full((100,100), 1.0)))
|
|
25
25
|
|
|
26
26
|
def test_plane_is_well_fit_and_applied_with_subtraction(self):
|
|
27
|
-
result = field_correction(self.img,
|
|
27
|
+
result = field_correction(self.img, threshold=1.0E05, operation='subtract', model='plane', clip=False, return_bg=False, activation_protocol=[])
|
|
28
28
|
self.assertTrue(np.allclose(result, np.zeros((100,100))))
|
|
29
29
|
|
|
30
30
|
def test_plane_is_well_fit_with_cell(self):
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"channels": [
|
|
3
|
-
"adhesion_channel",
|
|
4
|
-
"brightfield_channel"
|
|
5
|
-
],
|
|
6
|
-
"diameter": 30.0,
|
|
7
|
-
"cellprob_threshold": 0.0,
|
|
8
|
-
"flow_threshold": 0.4,
|
|
9
|
-
"normalization_percentile": [
|
|
10
|
-
false,
|
|
11
|
-
true
|
|
12
|
-
],
|
|
13
|
-
"normalization_clip": [
|
|
14
|
-
true,
|
|
15
|
-
true
|
|
16
|
-
],
|
|
17
|
-
"normalization_values": [
|
|
18
|
-
[
|
|
19
|
-
0.75,
|
|
20
|
-
1.25
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
1.0,
|
|
24
|
-
99.0
|
|
25
|
-
]
|
|
26
|
-
],
|
|
27
|
-
"model_type": "cellpose",
|
|
28
|
-
"spatial_calibration": 0.2,
|
|
29
|
-
"dataset": {
|
|
30
|
-
"train": [
|
|
31
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_404_0066_roi_429_935_159_649.tif",
|
|
32
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_200_0003_roi_457_991_5_488.tif",
|
|
33
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_508_0008.tif",
|
|
34
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_305_0075.tif",
|
|
35
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_302_0063_roi_405_865_462_937.tif",
|
|
36
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_506_0066_roi_473_944_494_953.tif",
|
|
37
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_202_0027_roi_557_998_3_447.tif",
|
|
38
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_208_0027_roi_600_997_5_387.tif",
|
|
39
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_206_0023_roi_251_707_249_666.tif",
|
|
40
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_201_0017_roi_324_961_23_596.tif",
|
|
41
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_102_0053_roi_511_996_4_433.tif",
|
|
42
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_403_0009_roi_554_996_460_994.tif",
|
|
43
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_508_0066.tif",
|
|
44
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_507_0066_roi_492_998_9_474.tif",
|
|
45
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_202_0029_roi_177_746_4_533.tif",
|
|
46
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_203_0060_roi_369_906_119_648.tif",
|
|
47
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_304_0025.tif",
|
|
48
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_207_0030_roi_152_661_531_998.tif",
|
|
49
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_105_0018_roi_510_954_13_422.tif",
|
|
50
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_507_0016_roi_29_585_462_996.tif",
|
|
51
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_504_0066_roi_305_866_382_909.tif",
|
|
52
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_605_0060_roi_6_479_351_847.tif",
|
|
53
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_403_0008.tif",
|
|
54
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_203_0029_roi_3_376_622_1000.tif",
|
|
55
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_102_0094.tif",
|
|
56
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_202_0055_roi_1_514_68_597.tif",
|
|
57
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_206_0000.tif",
|
|
58
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_302_0023_roi_295_768_6_437.tif",
|
|
59
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_805_0081.tif",
|
|
60
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_605_0010_roi_341_847_162_673.tif",
|
|
61
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_205_0002_roi_70_569_6_490.tif",
|
|
62
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_200_0055_roi_99_778_341_986.tif",
|
|
63
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_802_0040.tif",
|
|
64
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_206_0028_roi_2_426_487_995.tif",
|
|
65
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_706_0042_roi_99_515_11_394.tif"
|
|
66
|
-
],
|
|
67
|
-
"validation": [
|
|
68
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_201_0003_roi_501_957_576_1000.tif",
|
|
69
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-11-23-analysis-2024_603_0032.tif",
|
|
70
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_706_0030_roi_323_824_488_995.tif",
|
|
71
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_202_0014_roi_258_711_504_959.tif",
|
|
72
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_207_0007_roi_119_611_5_451.tif",
|
|
73
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_206_0030.tif",
|
|
74
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_207_0055_roi_519_989_6_429.tif",
|
|
75
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-03-03-analysis-2024_506_0053_roi_190_724_13_490.tif",
|
|
76
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects/Marie-20-06-analysis-2024_300_0047_roi_416_985_436_972.tif"
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
}
|
|
Binary file
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"model_name": "ricm_bf_all_last",
|
|
3
|
-
"model_type": "cellpose",
|
|
4
|
-
"pretrained": null,
|
|
5
|
-
"spatial_calibration": 0.2,
|
|
6
|
-
"channel_option": [
|
|
7
|
-
"adhesion_channel",
|
|
8
|
-
"brightfield_channel"
|
|
9
|
-
],
|
|
10
|
-
"normalization_percentile": [
|
|
11
|
-
false,
|
|
12
|
-
true
|
|
13
|
-
],
|
|
14
|
-
"normalization_clip": [
|
|
15
|
-
true,
|
|
16
|
-
true
|
|
17
|
-
],
|
|
18
|
-
"normalization_values": [
|
|
19
|
-
[
|
|
20
|
-
0.75,
|
|
21
|
-
1.25
|
|
22
|
-
],
|
|
23
|
-
[
|
|
24
|
-
1.0,
|
|
25
|
-
99.0
|
|
26
|
-
]
|
|
27
|
-
],
|
|
28
|
-
"ds": [
|
|
29
|
-
"/home/limozin/Downloads/dataset-marie-all-objects(1)/dataset-marie-all-objects"
|
|
30
|
-
],
|
|
31
|
-
"augmentation_factor": 3.0,
|
|
32
|
-
"validation_split": 0.2,
|
|
33
|
-
"learning_rate": 0.008,
|
|
34
|
-
"batch_size": 8,
|
|
35
|
-
"epochs": 3000,
|
|
36
|
-
"target_directory": "/home/limozin/Documents/GitHub/celldetective/celldetective/models/segmentation_effectors"
|
|
37
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"channels": [
|
|
3
|
-
"brightfield_channel",
|
|
4
|
-
"None"
|
|
5
|
-
],
|
|
6
|
-
"diameter": 30.0,
|
|
7
|
-
"cellprob_threshold": 0.0,
|
|
8
|
-
"flow_threshold": 0.4,
|
|
9
|
-
"normalization_percentile": [
|
|
10
|
-
true,
|
|
11
|
-
true
|
|
12
|
-
],
|
|
13
|
-
"normalization_clip": [
|
|
14
|
-
true,
|
|
15
|
-
true
|
|
16
|
-
],
|
|
17
|
-
"normalization_values": [
|
|
18
|
-
[
|
|
19
|
-
1.0,
|
|
20
|
-
99.0
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
1.0,
|
|
24
|
-
99.0
|
|
25
|
-
]
|
|
26
|
-
],
|
|
27
|
-
"model_type": "cellpose",
|
|
28
|
-
"spatial_calibration": 0.36666666666666664,
|
|
29
|
-
"dataset": {
|
|
30
|
-
"train": [
|
|
31
|
-
"/home/torro/Documents/Experiments/Marie-03-03-analysis-2024/annotations_effectors/Marie-03-03-analysis-2024_206_0028_roi_2_426_487_995.tif",
|
|
32
|
-
"/home/torro/Documents/Experiments/Marie-03-03-analysis-2024/annotations_effectors/Marie-03-03-analysis-2024_203_0029_roi_3_376_622_1000.tif",
|
|
33
|
-
"/home/torro/Documents/Experiments/Marie-03-03-analysis-2024/annotations_effectors/Marie-03-03-analysis-2024_208_0027_roi_600_997_5_387.tif"
|
|
34
|
-
],
|
|
35
|
-
"validation": [
|
|
36
|
-
"/home/torro/Documents/Experiments/Marie-03-03-analysis-2024/annotations_effectors/Marie-03-03-analysis-2024_206_0023_roi_251_707_249_666.tif"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"channels": ["area"], "model_signal_length": 128, "label": "nucShrink", "normalize": true, "normalization_percentile": [true], "normalization_values": [[0.1, 99.99]], "normalization_clip": [true]}
|