spacr 0.4.15__py3-none-any.whl → 0.4.60__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.
- spacr/core.py +52 -9
- spacr/deep_spacr.py +2 -3
- spacr/gui_core.py +247 -41
- spacr/gui_elements.py +133 -2
- spacr/gui_utils.py +17 -15
- spacr/io.py +540 -55
- spacr/ml.py +141 -258
- spacr/plot.py +76 -34
- spacr/sequencing.py +73 -38
- spacr/settings.py +136 -128
- spacr/submodules.py +619 -213
- spacr/timelapse.py +25 -25
- spacr/toxo.py +23 -23
- spacr/utils.py +162 -89
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/METADATA +2 -1
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/RECORD +20 -20
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/LICENSE +0 -0
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/WHEEL +0 -0
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/entry_points.txt +0 -0
- {spacr-0.4.15.dist-info → spacr-0.4.60.dist-info}/top_level.txt +0 -0
spacr/gui_utils.py
CHANGED
@@ -370,24 +370,24 @@ def convert_settings_dict_for_gui(settings):
|
|
370
370
|
chans_v4 = [0, 1, 2, 3, None]
|
371
371
|
variables = {}
|
372
372
|
special_cases = {
|
373
|
-
'metadata_type': ('combo', ['cellvoyager', 'cq1', '
|
373
|
+
'metadata_type': ('combo', ['cellvoyager', 'cq1', 'auto', 'custom'], 'cellvoyager'),
|
374
374
|
'channels': ('combo', chan_list, '[0,1,2,3]'),
|
375
375
|
'train_channels': ('combo', ["['r','g','b']", "['r','g']", "['r','b']", "['g','b']", "['r']", "['g']", "['b']"], "['r','g','b']"),
|
376
376
|
'channel_dims': ('combo', chan_list, '[0,1,2,3]'),
|
377
377
|
'dataset_mode': ('combo', ['annotation', 'metadata', 'recruitment'], 'metadata'),
|
378
378
|
'cov_type': ('combo', ['HC0', 'HC1', 'HC2', 'HC3', None], None),
|
379
|
-
'cell_mask_dim': ('combo',
|
380
|
-
'cell_chann_dim': ('combo',
|
381
|
-
'nucleus_mask_dim': ('combo',
|
382
|
-
'nucleus_chann_dim': ('combo',
|
383
|
-
'pathogen_mask_dim': ('combo',
|
384
|
-
'pathogen_chann_dim': ('combo',
|
379
|
+
#'cell_mask_dim': ('combo', chans_v3, None),
|
380
|
+
#'cell_chann_dim': ('combo', chans_v3, None),
|
381
|
+
#'nucleus_mask_dim': ('combo', chans_v3, None),
|
382
|
+
#'nucleus_chann_dim': ('combo', chans_v3, None),
|
383
|
+
#'pathogen_mask_dim': ('combo', chans_v3, None),
|
384
|
+
#'pathogen_chann_dim': ('combo', chans_v3, None),
|
385
385
|
'crop_mode': ('combo', ["['cell']", "['nucleus']", "['pathogen']", "['cell', 'nucleus']", "['cell', 'pathogen']", "['nucleus', 'pathogen']", "['cell', 'nucleus', 'pathogen']"], "['cell']"),
|
386
386
|
#'magnification': ('combo', [20, 40, 60], 20),
|
387
|
-
'nucleus_channel': ('combo', chans_v3, None),
|
388
|
-
'cell_channel': ('combo', chans_v3, None),
|
389
|
-
'channel_of_interest': ('combo', chans_v3, None),
|
390
|
-
'pathogen_channel': ('combo', chans_v3, None),
|
387
|
+
#'nucleus_channel': ('combo', chans_v3, None),
|
388
|
+
#'cell_channel': ('combo', chans_v3, None),
|
389
|
+
#'channel_of_interest': ('combo', chans_v3, None),
|
390
|
+
#'pathogen_channel': ('combo', chans_v3, None),
|
391
391
|
'timelapse_mode': ('combo', ['trackpy', 'btrack'], 'trackpy'),
|
392
392
|
'train_mode': ('combo', ['erm', 'irm'], 'erm'),
|
393
393
|
'clustering': ('combo', ['dbscan', 'kmean'], 'dbscan'),
|
@@ -464,10 +464,11 @@ def function_gui_wrapper(function=None, settings={}, q=None, fig_queue=None, imp
|
|
464
464
|
finally:
|
465
465
|
# Restore the original plt.show function
|
466
466
|
plt.show = original_show
|
467
|
+
|
467
468
|
|
469
|
+
|
468
470
|
def run_function_gui(settings_type, settings, q, fig_queue, stop_requested):
|
469
471
|
|
470
|
-
from .gui_utils import process_stdout_stderr
|
471
472
|
from .core import generate_image_umap, preprocess_generate_masks
|
472
473
|
from .cellpose import identify_masks_finetune, check_cellpose_models, compare_cellpose_masks
|
473
474
|
from .submodules import analyze_recruitment
|
@@ -478,9 +479,10 @@ def run_function_gui(settings_type, settings, q, fig_queue, stop_requested):
|
|
478
479
|
from .sim import run_multiple_simulations
|
479
480
|
from .deep_spacr import deep_spacr, apply_model_to_tar
|
480
481
|
from .sequencing import generate_barecode_mapping
|
482
|
+
|
481
483
|
process_stdout_stderr(q)
|
482
|
-
|
483
|
-
print(f'run_function_gui settings_type: {settings_type}')
|
484
|
+
|
485
|
+
print(f'run_function_gui settings_type: {settings_type}')
|
484
486
|
|
485
487
|
if settings_type == 'mask':
|
486
488
|
function = preprocess_generate_masks
|
@@ -525,7 +527,7 @@ def run_function_gui(settings_type, settings, q, fig_queue, stop_requested):
|
|
525
527
|
function = process_non_tif_non_2D_images
|
526
528
|
imports = 1
|
527
529
|
else:
|
528
|
-
raise ValueError(f"Invalid settings type: {settings_type}")
|
530
|
+
raise ValueError(f"Error: Invalid settings type: {settings_type}")
|
529
531
|
try:
|
530
532
|
function_gui_wrapper(function, settings, q, fig_queue, imports)
|
531
533
|
except Exception as e:
|