spacr 0.1.50__tar.gz → 0.1.55__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.1.50/spacr.egg-info → spacr-0.1.55}/PKG-INFO +1 -1
- {spacr-0.1.50 → spacr-0.1.55}/setup.py +1 -1
- {spacr-0.1.50 → spacr-0.1.55}/spacr/__init__.py +4 -1
- {spacr-0.1.50 → spacr-0.1.55}/spacr/app_annotate.py +3 -3
- {spacr-0.1.50 → spacr-0.1.55}/spacr/app_make_masks.py +3 -3
- spacr-0.1.55/spacr/app_sequencing.py +8 -0
- spacr-0.1.55/spacr/app_umap.py +8 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/core.py +8 -6
- {spacr-0.1.50 → spacr-0.1.55}/spacr/gui.py +10 -4
- {spacr-0.1.50 → spacr-0.1.55}/spacr/gui_utils.py +388 -701
- {spacr-0.1.50 → spacr-0.1.55}/spacr/sequencing.py +1 -17
- spacr-0.1.55/spacr/settings.py +911 -0
- {spacr-0.1.50 → spacr-0.1.55/spacr.egg-info}/PKG-INFO +1 -1
- {spacr-0.1.50 → spacr-0.1.55}/spacr.egg-info/SOURCES.txt +2 -1
- spacr-0.1.50/spacr/app_make_masks_v2.py +0 -686
- spacr-0.1.50/spacr/settings.py +0 -488
- {spacr-0.1.50 → spacr-0.1.55}/LICENSE +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/MANIFEST.in +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/README.rst +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/setup.cfg +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/__main__.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/app_classify.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/app_mask.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/app_measure.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/chris.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/deep_spacr.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/graph_learning.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/io.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/logger.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/measure.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/models/cp/toxo_plaque_cyto_e25000_X1120_Y1120.CP_model_settings.csv +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/models/cp/toxo_pv_lumen.CP_model +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/plot.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/sim.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/sim_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/timelapse.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/utils.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr/version.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr.egg-info/dependency_links.txt +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr.egg-info/entry_points.txt +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr.egg-info/requires.txt +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/spacr.egg-info/top_level.txt +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_annotate_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_core.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_gui_classify_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_gui_mask_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_gui_measure_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_gui_sim_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_gui_utils.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_io.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_mask_app.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_measure.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_plot.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_sim.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_timelapse.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_train.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_umap.py +0 -0
- {spacr-0.1.50 → spacr-0.1.55}/tests/test_utils.py +0 -0
@@ -15,10 +15,11 @@ from . import deep_spacr
|
|
15
15
|
from . import app_annotate
|
16
16
|
from . import gui_utils
|
17
17
|
from . import app_make_masks
|
18
|
-
from . import app_make_masks_v2
|
19
18
|
from . import app_mask
|
20
19
|
from . import app_measure
|
21
20
|
from . import app_classify
|
21
|
+
from . import app_sequencing
|
22
|
+
from . import app_umap
|
22
23
|
from . import logger
|
23
24
|
|
24
25
|
|
@@ -40,6 +41,8 @@ __all__ = [
|
|
40
41
|
"app_mask",
|
41
42
|
"app_measure",
|
42
43
|
"app_classify",
|
44
|
+
"app_sequencing",
|
45
|
+
"app_umap",
|
43
46
|
"logger"
|
44
47
|
]
|
45
48
|
|
@@ -13,7 +13,7 @@ from IPython.display import display, HTML
|
|
13
13
|
from tkinter import font as tkFont
|
14
14
|
from tkinter import TclError
|
15
15
|
|
16
|
-
from .gui_utils import
|
16
|
+
from .gui_utils import spacrFrame, spacrButton, set_dark_style, create_menu_bar, set_default_font
|
17
17
|
|
18
18
|
class ImageApp:
|
19
19
|
def __init__(self, root, db_path, src, image_type=None, channels=None, grid_rows=None, grid_cols=None, image_size=(200, 200), annotation_column='annotate', normalize=False, percentiles=(1,99), measurement=None, threshold=None):
|
@@ -379,7 +379,7 @@ def initiate_annotation_app_root(parent_frame):
|
|
379
379
|
container = tk.PanedWindow(parent_frame, orient=tk.HORIZONTAL, bg='black')
|
380
380
|
container.pack(fill=tk.BOTH, expand=True)
|
381
381
|
|
382
|
-
scrollable_frame =
|
382
|
+
scrollable_frame = spacrFrame(container, bg='black')
|
383
383
|
container.add(scrollable_frame, stretch="always")
|
384
384
|
|
385
385
|
# Setup input fields
|
@@ -444,7 +444,7 @@ def initiate_annotation_app_root(parent_frame):
|
|
444
444
|
# Start the annotate application in the same root window
|
445
445
|
annotate_app(parent_frame, settings)
|
446
446
|
|
447
|
-
run_button =
|
447
|
+
run_button = spacrButton(scrollable_frame.scrollable_frame, text="Run", command=run_app,
|
448
448
|
font=tkFont.Font(family="Arial", size=12, weight=tkFont.NORMAL))
|
449
449
|
run_button.grid(row=row, column=0, columnspan=2, pady=10, padx=10)
|
450
450
|
|
@@ -13,7 +13,7 @@ from ttkthemes import ThemedTk
|
|
13
13
|
|
14
14
|
from .logger import log_function_call
|
15
15
|
|
16
|
-
from .gui_utils import
|
16
|
+
from .gui_utils import spacrFrame, spacrButton, set_dark_style, create_menu_bar, set_default_font
|
17
17
|
|
18
18
|
class modify_masks:
|
19
19
|
|
@@ -869,7 +869,7 @@ def initiate_mask_app_root(parent_frame):
|
|
869
869
|
container = tk.PanedWindow(parent_frame, orient=tk.HORIZONTAL)
|
870
870
|
container.pack(fill=tk.BOTH, expand=True)
|
871
871
|
|
872
|
-
scrollable_frame =
|
872
|
+
scrollable_frame = spacrFrame(container, bg='black')
|
873
873
|
container.add(scrollable_frame, stretch="always")
|
874
874
|
|
875
875
|
# Setup input fields
|
@@ -897,7 +897,7 @@ def initiate_mask_app_root(parent_frame):
|
|
897
897
|
# Start the modify_masks application in the same root window
|
898
898
|
app_instance = modify_masks(parent_frame, folder_path, scale_factor)
|
899
899
|
|
900
|
-
run_button =
|
900
|
+
run_button = spacrButton(scrollable_frame.scrollable_frame, text="Run", command=run_app)
|
901
901
|
run_button.grid(row=row, column=0, columnspan=2, pady=10, padx=10)
|
902
902
|
|
903
903
|
return parent_frame
|
@@ -3021,9 +3021,9 @@ def generate_image_umap(settings={}):
|
|
3021
3021
|
"""
|
3022
3022
|
|
3023
3023
|
from .io import _read_and_join_tables
|
3024
|
-
from .utils import get_db_paths, preprocess_data, reduction_and_clustering, remove_noise, generate_colors, correct_paths, plot_embedding, plot_clusters_grid, cluster_feature_analysis
|
3025
|
-
from .settings import
|
3026
|
-
settings =
|
3024
|
+
from .utils import get_db_paths, preprocess_data, reduction_and_clustering, remove_noise, generate_colors, correct_paths, plot_embedding, plot_clusters_grid, cluster_feature_analysis #, generate_umap_from_images
|
3025
|
+
from .settings import set_default_umap_image_settings
|
3026
|
+
settings = set_default_umap_image_settings(settings)
|
3027
3027
|
|
3028
3028
|
if isinstance(settings['src'], str):
|
3029
3029
|
settings['src'] = [settings['src']]
|
@@ -3109,7 +3109,9 @@ def generate_image_umap(settings={}):
|
|
3109
3109
|
|
3110
3110
|
else:
|
3111
3111
|
if settings['resnet_features']:
|
3112
|
-
|
3112
|
+
# placeholder for resnet features, not implemented yet
|
3113
|
+
pass
|
3114
|
+
#numeric_data, embedding, labels = generate_umap_from_images(image_paths, settings['n_neighbors'], settings['min_dist'], settings['metric'], settings['clustering'], settings['eps'], settings['min_samples'], settings['n_jobs'], settings['verbose'])
|
3113
3115
|
else:
|
3114
3116
|
# Apply the trained reducer to the entire dataset
|
3115
3117
|
numeric_data = preprocess_data(all_df, settings['filter_by'], settings['remove_highly_correlated'], settings['log_data'], settings['exclude'])
|
@@ -3205,9 +3207,9 @@ def reducer_hyperparameter_search(settings={}, reduction_params=None, dbscan_par
|
|
3205
3207
|
|
3206
3208
|
from .io import _read_and_join_tables
|
3207
3209
|
from .utils import get_db_paths, preprocess_data, search_reduction_and_clustering, generate_colors
|
3208
|
-
from .settings import
|
3210
|
+
from .settings import set_default_umap_image_settings
|
3209
3211
|
|
3210
|
-
settings =
|
3212
|
+
settings = set_default_umap_image_settings(settings)
|
3211
3213
|
pointsize = settings['dot_size']
|
3212
3214
|
if isinstance(dbscan_params, dict):
|
3213
3215
|
dbscan_params = [dbscan_params]
|
@@ -4,7 +4,7 @@ from PIL import Image, ImageTk
|
|
4
4
|
import os
|
5
5
|
import requests
|
6
6
|
from multiprocessing import set_start_method
|
7
|
-
from .gui_utils import set_dark_style, create_menu_bar, initiate_root
|
7
|
+
from .gui_utils import set_dark_style, create_menu_bar, initiate_root, spacrButton
|
8
8
|
from .app_annotate import initiate_annotation_app_root
|
9
9
|
from .app_make_masks import initiate_mask_app_root
|
10
10
|
|
@@ -24,7 +24,9 @@ class MainApp(tk.Tk):
|
|
24
24
|
"Measure": (lambda frame: initiate_root(frame, 'measure'), "Measure single object intensity and morphological feature. Crop and save single object image"),
|
25
25
|
"Annotate": (initiate_annotation_app_root, "Annotation single object images on a grid. Annotations are saved to database."),
|
26
26
|
"Make Masks": (initiate_mask_app_root, "Adjust pre-existing Cellpose models to your specific dataset for improved performance"),
|
27
|
-
"Classify": (lambda frame: initiate_root(frame, 'classify'), "Train Torch Convolutional Neural Networks (CNNs) or Transformers to classify single object images.")
|
27
|
+
"Classify": (lambda frame: initiate_root(frame, 'classify'), "Train Torch Convolutional Neural Networks (CNNs) or Transformers to classify single object images."),
|
28
|
+
"Sequencing": (lambda frame: initiate_root(frame, 'sequencing'), "Analyze sequensing data."),
|
29
|
+
"Umap": (lambda frame: initiate_root(frame, 'umap'), "Generate UMAP embedings with datapoints represented as images.")
|
28
30
|
}
|
29
31
|
|
30
32
|
self.selected_app = tk.StringVar()
|
@@ -41,6 +43,10 @@ class MainApp(tk.Tk):
|
|
41
43
|
self.load_app(default_app, self.gui_apps[default_app][3])
|
42
44
|
elif default_app == "Classify":
|
43
45
|
self.load_app(default_app, self.gui_apps[default_app][4])
|
46
|
+
elif default_app == "Sequencing":
|
47
|
+
self.load_app(default_app, self.gui_apps[default_app][5])
|
48
|
+
elif default_app == "Umap":
|
49
|
+
self.load_app(default_app, self.gui_apps[default_app][6])
|
44
50
|
|
45
51
|
def create_widgets(self):
|
46
52
|
# Create the menu bar
|
@@ -81,8 +87,8 @@ class MainApp(tk.Tk):
|
|
81
87
|
app_func, app_desc = app_data
|
82
88
|
|
83
89
|
# Create custom button with text
|
84
|
-
|
85
|
-
button = ttk.Button(buttons_frame, text=app_name, command=lambda app_name=app_name, app_func=app_func: self.load_app(app_name, app_func), style='Custom.TButton')
|
90
|
+
button = spacrButton(buttons_frame, text=app_name, command=lambda app_name=app_name, app_func=app_func: self.load_app(app_name, app_func), font=('Helvetica', 12))
|
91
|
+
#button = ttk.Button(buttons_frame, text=app_name, command=lambda app_name=app_name, app_func=app_func: self.load_app(app_name, app_func), style='Custom.TButton')
|
86
92
|
button.grid(row=i, column=0, pady=10, padx=10, sticky="w")
|
87
93
|
|
88
94
|
description_label = tk.Label(buttons_frame, text=app_desc, bg="black", fg="white", wraplength=800, justify="left", font=('Helvetica', 12))
|