cellects 0.1.3__py3-none-any.whl → 0.2.6__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.
- cellects/__main__.py +65 -25
- cellects/config/all_vars_dict.py +18 -17
- cellects/core/cellects_threads.py +1034 -396
- cellects/core/motion_analysis.py +1664 -2010
- cellects/core/one_image_analysis.py +1082 -1061
- cellects/core/program_organizer.py +1687 -1316
- cellects/core/script_based_run.py +80 -76
- cellects/gui/advanced_parameters.py +365 -326
- cellects/gui/cellects.py +102 -91
- cellects/gui/custom_widgets.py +4 -3
- cellects/gui/first_window.py +226 -104
- cellects/gui/if_several_folders_window.py +117 -68
- cellects/gui/image_analysis_window.py +841 -450
- cellects/gui/required_output.py +100 -56
- cellects/gui/ui_strings.py +840 -0
- cellects/gui/video_analysis_window.py +317 -135
- cellects/image_analysis/cell_leaving_detection.py +64 -4
- cellects/image_analysis/image_segmentation.py +451 -22
- cellects/image_analysis/morphological_operations.py +2166 -1635
- cellects/image_analysis/network_functions.py +616 -253
- cellects/image_analysis/one_image_analysis_threads.py +94 -153
- cellects/image_analysis/oscillations_functions.py +131 -0
- cellects/image_analysis/progressively_add_distant_shapes.py +2 -3
- cellects/image_analysis/shape_descriptors.py +517 -466
- cellects/utils/formulas.py +169 -6
- cellects/utils/load_display_save.py +362 -105
- cellects/utils/utilitarian.py +86 -9
- cellects-0.2.6.dist-info/LICENSE +675 -0
- cellects-0.2.6.dist-info/METADATA +829 -0
- cellects-0.2.6.dist-info/RECORD +44 -0
- cellects/core/one_video_per_blob.py +0 -540
- cellects/image_analysis/cluster_flux_study.py +0 -102
- cellects-0.1.3.dist-info/LICENSE.odt +0 -0
- cellects-0.1.3.dist-info/METADATA +0 -176
- cellects-0.1.3.dist-info/RECORD +0 -44
- {cellects-0.1.3.dist-info → cellects-0.2.6.dist-info}/WHEEL +0 -0
- {cellects-0.1.3.dist-info → cellects-0.2.6.dist-info}/entry_points.txt +0 -0
- {cellects-0.1.3.dist-info → cellects-0.2.6.dist-info}/top_level.txt +0 -0
cellects/__main__.py
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
2
|
+
"""
|
|
3
|
+
Launcher for the Cellects software.
|
|
4
|
+
|
|
5
|
+
This module initializes logging configuration, creates the Qt application instance,
|
|
6
|
+
loads Cellects icon, and launches the main GUI interface.
|
|
7
|
+
"""
|
|
3
8
|
|
|
4
|
-
"""
|
|
5
|
-
import logging
|
|
6
9
|
import sys
|
|
10
|
+
import logging
|
|
7
11
|
import coloredlogs
|
|
8
12
|
from PySide6 import QtWidgets, QtGui
|
|
9
13
|
from cellects.core.cellects_paths import ICONS_DIR
|
|
10
14
|
|
|
11
|
-
# These two lines allow the taskbar icon to be cellects_icon instead if python icon.
|
|
12
15
|
if sys.platform.startswith('win'):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
try:
|
|
17
|
+
import ctypes
|
|
18
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('company.app.1')
|
|
19
|
+
except Exception as e:
|
|
20
|
+
logging.getLogger(__name__).debug(f"Windows taskbar icon setup failed: {e}")
|
|
16
21
|
|
|
17
|
-
LOGLEVEL = "INFO" #
|
|
22
|
+
LOGLEVEL = "INFO" # Set to DEBUG for development
|
|
18
23
|
|
|
19
24
|
def _initialize_coloredlogs(loglevel: str = 'DEBUG') -> None:
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
"""Initialize colored console logging with custom format.
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
loglevel : str, optional
|
|
31
|
+
Logging threshold level (default is DEBUG). Accepts standard Python
|
|
32
|
+
logging level strings like 'DEBUG', 'INFO', or 'WARNING'.
|
|
33
|
+
|
|
34
|
+
Notes
|
|
35
|
+
-----
|
|
36
|
+
This function must be called before any other logging setup to ensure proper
|
|
37
|
+
configuration of colored output.
|
|
38
|
+
"""
|
|
39
|
+
# Configure basic logging before applying colored logs
|
|
40
|
+
logging.basicConfig(level=loglevel)
|
|
41
|
+
|
|
42
|
+
# Apply colored formatting to the root logger
|
|
21
43
|
coloredlogs.install(
|
|
22
44
|
logger=logging.basicConfig(),
|
|
23
45
|
level=loglevel,
|
|
@@ -26,23 +48,41 @@ def _initialize_coloredlogs(loglevel: str = 'DEBUG') -> None:
|
|
|
26
48
|
|
|
27
49
|
|
|
28
50
|
def run_cellects():
|
|
29
|
-
"""
|
|
51
|
+
"""Run the Cellects application entry point.
|
|
52
|
+
|
|
53
|
+
This function initializes the Qt application, loads platform-specific icons,
|
|
54
|
+
creates and displays the main window widget, then starts the event loop.
|
|
55
|
+
|
|
56
|
+
Raises
|
|
57
|
+
------
|
|
58
|
+
ImportError
|
|
59
|
+
If required GUI components cannot be loaded
|
|
60
|
+
"""
|
|
30
61
|
_initialize_coloredlogs(LOGLEVEL)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
icon
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
|
|
63
|
+
try:
|
|
64
|
+
from cellects.gui.cellects import CellectsMainWidget
|
|
65
|
+
|
|
66
|
+
# Initialize application
|
|
67
|
+
app = QtWidgets.QApplication([])
|
|
68
|
+
|
|
69
|
+
# Set custom window icon for taskbar (platform-specific handling)
|
|
70
|
+
icon = QtGui.QIcon()
|
|
71
|
+
platform_icon_path = (
|
|
72
|
+
ICONS_DIR / "cellects_icon.ico" if sys.platform.startswith('win')
|
|
73
|
+
else ICONS_DIR / "cellects_icon.icns"
|
|
74
|
+
)
|
|
75
|
+
icon.addPixmap(QtGui.QPixmap(str(platform_icon_path)))
|
|
76
|
+
app.setWindowIcon(icon)
|
|
77
|
+
|
|
78
|
+
# Create and display main window
|
|
79
|
+
session = CellectsMainWidget()
|
|
80
|
+
session.instantiate()
|
|
81
|
+
session.show()
|
|
82
|
+
sys.exit(app.exec())
|
|
83
|
+
except Exception as e:
|
|
84
|
+
logging.getLogger(__name__).critical("Application failed to start", exc_info=True)
|
|
85
|
+
raise
|
|
46
86
|
|
|
47
87
|
|
|
48
88
|
if __name__ == "__main__":
|
cellects/config/all_vars_dict.py
CHANGED
|
@@ -41,7 +41,6 @@ class DefaultDicts:
|
|
|
41
41
|
'extract_time_interval': True,
|
|
42
42
|
'do_multiprocessing': False,
|
|
43
43
|
'extension': '.tif',
|
|
44
|
-
'first_detection_frame': 1,
|
|
45
44
|
'folder_number': 1,
|
|
46
45
|
'first_folder_sample_number': 1,
|
|
47
46
|
'first_move_threshold_in_mm²': 10,
|
|
@@ -64,11 +63,15 @@ class DefaultDicts:
|
|
|
64
63
|
'set_spot_shape': True,
|
|
65
64
|
'set_spot_size': True,
|
|
66
65
|
'starting_blob_hsize_in_mm': 15,
|
|
67
|
-
'starting_blob_shape': None
|
|
66
|
+
'starting_blob_shape': None,
|
|
67
|
+
'auto_mesh_side_length': True,
|
|
68
|
+
'auto_mesh_step_length': True,
|
|
69
|
+
'auto_mesh_min_int_var': True,
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
self.vars = {
|
|
71
|
-
'
|
|
73
|
+
'video_list': None,
|
|
74
|
+
'analyzed_individuals': np.array([1], dtype=np.uint16),
|
|
72
75
|
'arena_shape': 'rectangle', # 'circle',
|
|
73
76
|
'bio_label': 1,
|
|
74
77
|
'bio_label2': 1,
|
|
@@ -83,16 +86,19 @@ class DefaultDicts:
|
|
|
83
86
|
'first_move_threshold': None,
|
|
84
87
|
'img_number': 0,
|
|
85
88
|
'iso_digi_analysis': True,
|
|
89
|
+
'first_detection_frame': 0,
|
|
86
90
|
'luminosity_threshold': 127,
|
|
87
91
|
'max_size_for_connection': 300,
|
|
88
92
|
'min_size_for_connection': 20,
|
|
89
93
|
'origin_state': 'fluctuating',
|
|
90
94
|
'oscilacyto_analysis': False,
|
|
91
|
-
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
95
|
+
|
|
96
|
+
'rolling_window_segmentation': {'do': False, 'side_len': None, 'step': None, 'min_int_var': None},
|
|
97
|
+
'grid_segmentation': False,
|
|
98
|
+
'mesh_side_length': 4,
|
|
99
|
+
'mesh_step_length': 2,
|
|
100
|
+
'mesh_min_int_var': 20,
|
|
101
|
+
|
|
96
102
|
'fractal_analysis': False,
|
|
97
103
|
'fractal_box_side_threshold': 32,
|
|
98
104
|
'fractal_zoom_step': 0,
|
|
@@ -115,11 +121,12 @@ class DefaultDicts:
|
|
|
115
121
|
'maximal_growth_factor': 0.05,
|
|
116
122
|
'min_ram_free': 0.87,
|
|
117
123
|
'expected_oscillation_period': 2, # (min)
|
|
118
|
-
'minimal_oscillating_cluster_size':
|
|
124
|
+
'minimal_oscillating_cluster_size': 50, # (pixels)
|
|
119
125
|
'output_in_mm': True,
|
|
120
126
|
'save_processed_videos': True,
|
|
121
127
|
'several_blob_per_arena': False,
|
|
122
128
|
'time_step': 1,
|
|
129
|
+
'time_step_is_arbitrary': True,
|
|
123
130
|
'true_if_use_light_AND_slope_else_OR': False,
|
|
124
131
|
'do_fading': False,
|
|
125
132
|
'fading': 0,
|
|
@@ -128,13 +135,12 @@ class DefaultDicts:
|
|
|
128
135
|
'exif': [],
|
|
129
136
|
'lose_accuracy_to_save_memory': True,
|
|
130
137
|
'save_coord_specimen': False,
|
|
131
|
-
'
|
|
138
|
+
'save_graph': False,
|
|
132
139
|
'save_coord_thickening_slimming': False,
|
|
133
140
|
'save_coord_network': False,
|
|
134
|
-
'grid_segmentation': False,
|
|
135
141
|
# Data stored during analysis:
|
|
136
142
|
'descriptors': descriptors,
|
|
137
|
-
'filter_spec': {'filter1_type': "", 'filter1_param': [
|
|
143
|
+
'filter_spec': {'filter1_type': "", 'filter1_param': [.5, 1.], 'filter2_type': "", 'filter2_param': [.5, 1.]},
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
def save_as_pkl(self, po=None):
|
|
@@ -148,8 +154,3 @@ class DefaultDicts:
|
|
|
148
154
|
po.all = self.all
|
|
149
155
|
po.vars = self.vars
|
|
150
156
|
po.save_variable_dict()
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if __name__ == "__main__":
|
|
155
|
-
DefaultDicts().save_as_pkl()
|