spacr 0.0.35__tar.gz → 0.0.36__tar.gz
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.
- {spacr-0.0.35/spacr.egg-info → spacr-0.0.36}/PKG-INFO +1 -1
- {spacr-0.0.35 → spacr-0.0.36}/setup.py +1 -1
- {spacr-0.0.35 → spacr-0.0.36}/spacr/annotate_app.py +1 -1
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui_classify_app.py +4 -4
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui_mask_app.py +4 -4
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui_measure_app.py +5 -5
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui_utils.py +2 -2
- {spacr-0.0.35 → spacr-0.0.36}/spacr/io.py +3 -3
- {spacr-0.0.35 → spacr-0.0.36}/spacr/mask_app.py +1 -1
- {spacr-0.0.35 → spacr-0.0.36}/spacr/measure.py +4 -4
- {spacr-0.0.35 → spacr-0.0.36}/spacr/old_code.py +1 -1
- {spacr-0.0.35 → spacr-0.0.36/spacr.egg-info}/PKG-INFO +1 -1
- {spacr-0.0.35 → spacr-0.0.36}/LICENSE +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/README.md +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/setup.cfg +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/__init__.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/__main__.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/alpha.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/chris.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/cli.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/core.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/foldseek.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/get_alfafold_structures.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/graph_learning.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/graph_learning_lap.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/gui_sim_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/logger.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/plot.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/sim.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/timelapse.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/train.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/umap.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/utils.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr/version.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr.egg-info/SOURCES.txt +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr.egg-info/dependency_links.txt +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr.egg-info/entry_points.txt +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr.egg-info/requires.txt +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/spacr.egg-info/top_level.txt +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_annotate_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_core.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_gui_classify_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_gui_mask_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_gui_measure_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_gui_sim_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_gui_utils.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_io.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_mask_app.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_measure.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_plot.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_sim.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_timelapse.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_train.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_umap.py +0 -0
- {spacr-0.0.35 → spacr-0.0.36}/tests/test_utils.py +0 -0
@@ -21,7 +21,7 @@ from .gui_utils import classify_variables, check_classify_gui_settings, train_te
|
|
21
21
|
|
22
22
|
thread_control = {"run_thread": None, "stop_requested": False}
|
23
23
|
|
24
|
-
|
24
|
+
#@log_function_call
|
25
25
|
def initiate_abort():
|
26
26
|
global thread_control
|
27
27
|
if thread_control.get("stop_requested") is not None:
|
@@ -33,7 +33,7 @@ def initiate_abort():
|
|
33
33
|
thread_control["run_thread"].terminate()
|
34
34
|
thread_control["run_thread"] = None
|
35
35
|
|
36
|
-
|
36
|
+
#@log_function_call
|
37
37
|
def run_classify_gui(q, fig_queue, stop_requested):
|
38
38
|
global vars_dict
|
39
39
|
process_stdout_stderr(q)
|
@@ -49,7 +49,7 @@ def run_classify_gui(q, fig_queue, stop_requested):
|
|
49
49
|
finally:
|
50
50
|
stop_requested.value = 1
|
51
51
|
|
52
|
-
|
52
|
+
#@log_function_call
|
53
53
|
def start_process(q, fig_queue):
|
54
54
|
global thread_control
|
55
55
|
if thread_control.get("run_thread") is not None:
|
@@ -69,7 +69,7 @@ def import_settings(scrollable_frame):
|
|
69
69
|
new_settings = update_settings_from_csv(variables, csv_settings)
|
70
70
|
vars_dict = generate_fields(new_settings, scrollable_frame)
|
71
71
|
|
72
|
-
|
72
|
+
#@log_function_call
|
73
73
|
def initiate_classify_root(parent_frame, width, height):
|
74
74
|
global vars_dict, q, canvas, fig_queue, canvas_widget, thread_control
|
75
75
|
|
@@ -50,7 +50,7 @@ def toggle_advanced_settings():
|
|
50
50
|
label.grid() # Show the label
|
51
51
|
widget.grid() # Show the widget
|
52
52
|
|
53
|
-
|
53
|
+
#@log_function_call
|
54
54
|
def initiate_abort():
|
55
55
|
global thread_control
|
56
56
|
if thread_control.get("stop_requested") is not None:
|
@@ -62,7 +62,7 @@ def initiate_abort():
|
|
62
62
|
thread_control["run_thread"].terminate()
|
63
63
|
thread_control["run_thread"] = None
|
64
64
|
|
65
|
-
|
65
|
+
#@log_function_call
|
66
66
|
def run_mask_gui(q, fig_queue, stop_requested):
|
67
67
|
global vars_dict
|
68
68
|
process_stdout_stderr(q)
|
@@ -75,7 +75,7 @@ def run_mask_gui(q, fig_queue, stop_requested):
|
|
75
75
|
finally:
|
76
76
|
stop_requested.value = 1
|
77
77
|
|
78
|
-
|
78
|
+
#@log_function_call
|
79
79
|
def start_process(q, fig_queue):
|
80
80
|
global thread_control
|
81
81
|
if thread_control.get("run_thread") is not None:
|
@@ -95,7 +95,7 @@ def import_settings(scrollable_frame):
|
|
95
95
|
new_settings = update_settings_from_csv(variables, csv_settings)
|
96
96
|
vars_dict = generate_fields(new_settings, scrollable_frame)
|
97
97
|
|
98
|
-
|
98
|
+
#@log_function_call
|
99
99
|
def initiate_mask_root(parent_frame, width, height):
|
100
100
|
global vars_dict, q, canvas, fig_queue, canvas_widget, thread_control, advanced_var, scrollable_frame
|
101
101
|
|
@@ -50,7 +50,7 @@ def toggle_advanced_settings():
|
|
50
50
|
label.grid() # Show the label
|
51
51
|
widget.grid() # Show the widget
|
52
52
|
|
53
|
-
|
53
|
+
#@log_function_call
|
54
54
|
def run_measure_gui(q, fig_queue, stop_requested):
|
55
55
|
global vars_dict
|
56
56
|
process_stdout_stderr(q)
|
@@ -64,7 +64,7 @@ def run_measure_gui(q, fig_queue, stop_requested):
|
|
64
64
|
finally:
|
65
65
|
stop_requested.value = 1
|
66
66
|
|
67
|
-
|
67
|
+
#@log_function_call
|
68
68
|
def start_process(q, fig_queue):
|
69
69
|
global thread_control
|
70
70
|
if thread_control.get("run_thread") is not None:
|
@@ -75,7 +75,7 @@ def start_process(q, fig_queue):
|
|
75
75
|
thread_control["run_thread"] = Process(target=run_measure_gui, args=(q, fig_queue, stop_requested))
|
76
76
|
thread_control["run_thread"].start()
|
77
77
|
|
78
|
-
|
78
|
+
#@log_function_call
|
79
79
|
def initiate_abort():
|
80
80
|
global thread_control
|
81
81
|
if thread_control.get("stop_requested") is not None:
|
@@ -87,7 +87,7 @@ def initiate_abort():
|
|
87
87
|
thread_control["run_thread"].terminate()
|
88
88
|
thread_control["run_thread"] = None
|
89
89
|
|
90
|
-
|
90
|
+
#@log_function_call
|
91
91
|
def import_settings(scrollable_frame):
|
92
92
|
global vars_dict
|
93
93
|
|
@@ -97,7 +97,7 @@ def import_settings(scrollable_frame):
|
|
97
97
|
new_settings = update_settings_from_csv(variables, csv_settings)
|
98
98
|
vars_dict = generate_fields(new_settings, scrollable_frame)
|
99
99
|
|
100
|
-
|
100
|
+
#@log_function_call
|
101
101
|
def initiate_measure_root(parent_frame, width, height):
|
102
102
|
global vars_dict, q, canvas, fig_queue, canvas_widget, thread_control, variables, advanced_var, scrollable_frame
|
103
103
|
|
@@ -744,7 +744,7 @@ def set_dark_style(style):
|
|
744
744
|
style.configure('TEntry', background='black', foreground='white')
|
745
745
|
style.configure('TCheckbutton', background='black', foreground='white')
|
746
746
|
|
747
|
-
|
747
|
+
##@log_function_call
|
748
748
|
def main_thread_update_function(root, q, fig_queue, canvas_widget, progress_label):
|
749
749
|
try:
|
750
750
|
ansi_escape_pattern = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
|
@@ -833,7 +833,7 @@ def measure_crop_wrapper(settings, q, fig_queue):
|
|
833
833
|
finally:
|
834
834
|
plt.show = original_show # Restore the original plt.show function
|
835
835
|
|
836
|
-
|
836
|
+
#@log_function_call
|
837
837
|
def preprocess_generate_masks_wrapper(settings, q, fig_queue):
|
838
838
|
"""
|
839
839
|
Wraps the measure_crop function to integrate with GUI processes.
|
@@ -529,7 +529,7 @@ class TarImageDataset(Dataset):
|
|
529
529
|
|
530
530
|
return img, m.name
|
531
531
|
|
532
|
-
|
532
|
+
#@log_function_call
|
533
533
|
def _rename_and_organize_image_files(src, regex, batch_size=100, pick_slice=False, skip_mode='01', metadata_type='', img_format='.tif'):
|
534
534
|
"""
|
535
535
|
Convert z-stack images to maximum intensity projection (MIP) images.
|
@@ -930,7 +930,7 @@ def _mip_all(src, include_first_chan=True):
|
|
930
930
|
np.save(os.path.join(src, filename), concatenated)
|
931
931
|
return
|
932
932
|
|
933
|
-
|
933
|
+
#@log_function_call
|
934
934
|
def _concatenate_channel(src, channels, randomize=True, timelapse=False, batch_size=100):
|
935
935
|
"""
|
936
936
|
Concatenates channel data from multiple files and saves the concatenated data as numpy arrays.
|
@@ -1257,7 +1257,7 @@ def delete_empty_subdirectories(folder_path):
|
|
1257
1257
|
# An error occurred, likely because the directory is not empty
|
1258
1258
|
#print(f"Skipping non-empty directory: {full_dir_path}")
|
1259
1259
|
|
1260
|
-
|
1260
|
+
#@log_function_call
|
1261
1261
|
def preprocess_img_data(settings):
|
1262
1262
|
|
1263
1263
|
from .plot import plot_arrays, _plot_4D_arrays
|
@@ -753,7 +753,7 @@ class modify_masks:
|
|
753
753
|
self.mask[labeled_mask == i] = 0 # Remove small objects
|
754
754
|
self.update_display()
|
755
755
|
|
756
|
-
|
756
|
+
##@log_function_call
|
757
757
|
def initiate_mask_app_root(width, height):
|
758
758
|
theme = 'breeze'
|
759
759
|
root = ThemedTk(theme=theme)
|
@@ -157,7 +157,7 @@ def _analyze_cytoskeleton(array, mask, channel):
|
|
157
157
|
|
158
158
|
return pd.DataFrame(properties_list)
|
159
159
|
|
160
|
-
|
160
|
+
#@log_function_call
|
161
161
|
def _morphological_measurements(cell_mask, nucleus_mask, pathogen_mask, cytoplasm_mask, settings, zernike=True, degree=8):
|
162
162
|
"""
|
163
163
|
Calculate morphological measurements for cells, nucleus, pathogens, and cytoplasms based on the given masks.
|
@@ -501,7 +501,7 @@ def _estimate_blur(image):
|
|
501
501
|
# Compute and return the variance of the Laplacian
|
502
502
|
return lap.var()
|
503
503
|
|
504
|
-
|
504
|
+
#@log_function_call
|
505
505
|
def _intensity_measurements(cell_mask, nucleus_mask, pathogen_mask, cytoplasm_mask, channel_arrays, settings, sizes=[3, 6, 12, 24], periphery=True, outside=True):
|
506
506
|
"""
|
507
507
|
Calculate various intensity measurements for different regions in the image.
|
@@ -589,7 +589,7 @@ def _intensity_measurements(cell_mask, nucleus_mask, pathogen_mask, cytoplasm_ma
|
|
589
589
|
|
590
590
|
return pd.concat(cell_dfs, axis=1), pd.concat(nucleus_dfs, axis=1), pd.concat(pathogen_dfs, axis=1), pd.concat(cytoplasm_dfs, axis=1)
|
591
591
|
|
592
|
-
|
592
|
+
#@log_function_call
|
593
593
|
def _measure_crop_core(index, time_ls, file, settings):
|
594
594
|
|
595
595
|
"""
|
@@ -887,7 +887,7 @@ def _measure_crop_core(index, time_ls, file, settings):
|
|
887
887
|
average_time = np.mean(time_ls) if len(time_ls) > 0 else 0
|
888
888
|
return average_time, cells
|
889
889
|
|
890
|
-
|
890
|
+
#@log_function_call
|
891
891
|
def measure_crop(settings):
|
892
892
|
|
893
893
|
"""
|
@@ -103,7 +103,7 @@ def run_mask_gui(q):
|
|
103
103
|
except Exception as e:
|
104
104
|
q.put(f"Error during processing: {e}\n")
|
105
105
|
|
106
|
-
|
106
|
+
#@log_function_call
|
107
107
|
def main_thread_update_function(root, q, fig_queue, canvas_widget, progress_label):
|
108
108
|
try:
|
109
109
|
while not q.empty():
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|