spacr 0.0.21__py3-none-any.whl → 0.0.35__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/annotate_app.py +5 -3
- spacr/chris.py +50 -0
- spacr/gui.py +144 -0
- spacr/gui_classify_app.py +65 -74
- spacr/gui_mask_app.py +107 -104
- spacr/gui_measure_app.py +104 -81
- spacr/gui_utils.py +265 -35
- spacr/io.py +1 -0
- spacr/mask_app.py +6 -3
- spacr/utils.py +0 -6
- {spacr-0.0.21.dist-info → spacr-0.0.35.dist-info}/METADATA +1 -1
- {spacr-0.0.21.dist-info → spacr-0.0.35.dist-info}/RECORD +16 -14
- spacr-0.0.35.dist-info/entry_points.txt +8 -0
- spacr-0.0.21.dist-info/entry_points.txt +0 -7
- {spacr-0.0.21.dist-info → spacr-0.0.35.dist-info}/LICENSE +0 -0
- {spacr-0.0.21.dist-info → spacr-0.0.35.dist-info}/WHEEL +0 -0
- {spacr-0.0.21.dist-info → spacr-0.0.35.dist-info}/top_level.txt +0 -0
spacr/gui_utils.py
CHANGED
@@ -1,19 +1,208 @@
|
|
1
|
-
import spacr, inspect, traceback, io, sys, ast, ctypes, matplotlib, re, csv
|
1
|
+
import os, spacr, inspect, traceback, io, sys, ast, ctypes, matplotlib, re, csv, requests
|
2
2
|
import matplotlib.pyplot as plt
|
3
3
|
matplotlib.use('Agg')
|
4
4
|
import numpy as np
|
5
5
|
import tkinter as tk
|
6
6
|
from tkinter import ttk, messagebox
|
7
|
-
|
7
|
+
import tkinter.font as tkFont
|
8
8
|
from torchvision import models
|
9
9
|
|
10
|
+
from .logger import log_function_call
|
11
|
+
|
10
12
|
try:
|
11
13
|
ctypes.windll.shcore.SetProcessDpiAwareness(True)
|
12
14
|
except AttributeError:
|
13
15
|
pass
|
14
16
|
|
15
|
-
|
17
|
+
def load_app(root, app_name, app_func):
|
18
|
+
# Destroy the current window
|
19
|
+
root.destroy()
|
20
|
+
# Create a new window for the app
|
21
|
+
app_window = tk.Tk()
|
22
|
+
app_window.title(f"SpaCr - {app_name}")
|
23
|
+
app_window.geometry("1200x800")
|
24
|
+
#app_window.attributes('-fullscreen', True)
|
25
|
+
app_window.configure(bg="black")
|
26
|
+
create_menu_bar(app_window) # Add menu to the new window
|
27
|
+
app_func(app_window, app_window.winfo_width(), app_window.winfo_height())
|
28
|
+
|
29
|
+
def create_menu_bar(root):
|
30
|
+
|
31
|
+
from .gui_mask_app import initiate_mask_root
|
32
|
+
from .gui_measure_app import initiate_measure_root
|
33
|
+
from .annotate_app import initiate_annotation_app_root
|
34
|
+
from .mask_app import initiate_mask_app_root
|
35
|
+
from .gui_classify_app import initiate_classify_root
|
36
|
+
|
37
|
+
gui_apps = {
|
38
|
+
"Mask": initiate_mask_root,
|
39
|
+
"Measure": initiate_measure_root,
|
40
|
+
"Annotate": initiate_annotation_app_root,
|
41
|
+
"Make Masks": initiate_mask_app_root,
|
42
|
+
"Classify": initiate_classify_root
|
43
|
+
}
|
44
|
+
# Create the menu bar
|
45
|
+
menu_bar = tk.Menu(root, bg="#008080", fg="white")
|
46
|
+
# Create a "SpaCr Applications" menu
|
47
|
+
app_menu = tk.Menu(menu_bar, tearoff=0, bg="#008080", fg="white")
|
48
|
+
menu_bar.add_cascade(label="SpaCr Applications", menu=app_menu)
|
49
|
+
# Add options to the "SpaCr Applications" menu
|
50
|
+
for app_name, app_func in gui_apps.items():
|
51
|
+
app_menu.add_command(label=app_name, command=lambda app_name=app_name, app_func=app_func: load_app(root, app_name, app_func))
|
52
|
+
# Add a separator and an exit option
|
53
|
+
app_menu.add_separator()
|
54
|
+
app_menu.add_command(label="Exit", command=root.quit)
|
55
|
+
# Configure the menu for the root window
|
56
|
+
root.config(menu=menu_bar)
|
57
|
+
|
58
|
+
class CustomButton(tk.Frame):
|
59
|
+
def __init__(self, parent, text="", command=None, *args, **kwargs):
|
60
|
+
super().__init__(parent, *args, **kwargs)
|
61
|
+
self.text = text
|
62
|
+
self.command = command
|
63
|
+
|
64
|
+
self.canvas = tk.Canvas(self, width=200, height=50, highlightthickness=0, bg="black")
|
65
|
+
self.canvas.grid(row=0, column=0)
|
66
|
+
|
67
|
+
self.button_bg = self.create_rounded_rectangle(0, 0, 200, 50, radius=20, fill="#800080")
|
68
|
+
|
69
|
+
# Load the Open Sans font
|
70
|
+
self.font_path = 'fonts/OpenSans-Regular.ttf'
|
71
|
+
if not os.path.exists(self.font_path):
|
72
|
+
self.download_font()
|
73
|
+
|
74
|
+
self.open_sans = tkFont.Font(family="Open Sans", size=10)
|
75
|
+
self.button_text = self.canvas.create_text(100, 25, text=self.text, fill="white", font=self.open_sans)
|
76
|
+
|
77
|
+
self.bind("<Enter>", self.on_enter)
|
78
|
+
self.bind("<Leave>", self.on_leave)
|
79
|
+
self.bind("<Button-1>", self.on_click)
|
80
|
+
self.canvas.bind("<Enter>", self.on_enter)
|
81
|
+
self.canvas.bind("<Leave>", self.on_leave)
|
82
|
+
self.canvas.bind("<Button-1>", self.on_click)
|
83
|
+
|
84
|
+
def on_enter(self, event=None):
|
85
|
+
self.canvas.itemconfig(self.button_bg, fill="#993399")
|
86
|
+
|
87
|
+
def on_leave(self, event=None):
|
88
|
+
self.canvas.itemconfig(self.button_bg, fill="#800080")
|
89
|
+
|
90
|
+
def on_click(self, event=None):
|
91
|
+
if self.command:
|
92
|
+
self.command()
|
93
|
+
|
94
|
+
def create_rounded_rectangle(self, x1, y1, x2, y2, radius=20, **kwargs):
|
95
|
+
points = [x1 + radius, y1,
|
96
|
+
x1 + radius, y1,
|
97
|
+
x2 - radius, y1,
|
98
|
+
x2 - radius, y1,
|
99
|
+
x2, y1,
|
100
|
+
x2, y1 + radius,
|
101
|
+
x2, y1 + radius,
|
102
|
+
x2, y2 - radius,
|
103
|
+
x2, y2 - radius,
|
104
|
+
x2, y2,
|
105
|
+
x2 - radius, y2,
|
106
|
+
x2 - radius, y2,
|
107
|
+
x1 + radius, y2,
|
108
|
+
x1 + radius, y2,
|
109
|
+
x1, y2,
|
110
|
+
x1, y2 - radius,
|
111
|
+
x1, y2 - radius,
|
112
|
+
x1, y1 + radius,
|
113
|
+
x1, y1 + radius,
|
114
|
+
x1, y1]
|
115
|
+
|
116
|
+
return self.canvas.create_polygon(points, **kwargs, smooth=True)
|
117
|
+
|
118
|
+
class ToggleSwitch(ttk.Frame):
|
119
|
+
def __init__(self, parent, text="", variable=None, command=None, *args, **kwargs):
|
120
|
+
super().__init__(parent, *args, **kwargs)
|
121
|
+
self.text = text
|
122
|
+
self.variable = variable if variable else tk.BooleanVar()
|
123
|
+
self.command = command
|
124
|
+
|
125
|
+
self.canvas = tk.Canvas(self, width=40, height=20, highlightthickness=0, bd=0, bg="black")
|
126
|
+
self.canvas.grid(row=0, column=1, padx=(10, 0))
|
127
|
+
|
128
|
+
# Background rounded rectangle with smaller dimensions and no outline
|
129
|
+
self.switch_bg = self.create_rounded_rectangle(2, 2, 38, 18, radius=9, outline="", fill="#fff")
|
16
130
|
|
131
|
+
# Switch ball with no outline
|
132
|
+
self.switch = self.canvas.create_oval(4, 4, 16, 16, outline="", fill="#800080") # Purple initially
|
133
|
+
|
134
|
+
self.label = ttk.Label(self, text=self.text, background="black", foreground="white")
|
135
|
+
self.label.grid(row=0, column=0, padx=(0, 10))
|
136
|
+
|
137
|
+
self.bind("<Button-1>", self.toggle)
|
138
|
+
self.canvas.bind("<Button-1>", self.toggle)
|
139
|
+
self.label.bind("<Button-1>", self.toggle)
|
140
|
+
|
141
|
+
self.update_switch()
|
142
|
+
|
143
|
+
def toggle(self, event=None):
|
144
|
+
self.variable.set(not self.variable.get())
|
145
|
+
self.animate_switch()
|
146
|
+
if self.command:
|
147
|
+
self.command()
|
148
|
+
|
149
|
+
def update_switch(self):
|
150
|
+
if self.variable.get():
|
151
|
+
self.canvas.itemconfig(self.switch, fill="#008080") # Teal
|
152
|
+
self.canvas.coords(self.switch, 24, 4, 36, 16) # Move switch to the right
|
153
|
+
else:
|
154
|
+
self.canvas.itemconfig(self.switch, fill="#800080") # Purple
|
155
|
+
self.canvas.coords(self.switch, 4, 4, 16, 16) # Move switch to the left
|
156
|
+
|
157
|
+
def animate_switch(self):
|
158
|
+
if self.variable.get():
|
159
|
+
start_x, end_x = 4, 24
|
160
|
+
final_color = "#008080" # Teal
|
161
|
+
else:
|
162
|
+
start_x, end_x = 24, 4
|
163
|
+
final_color = "#800080" # Purple
|
164
|
+
|
165
|
+
self.animate_movement(start_x, end_x, final_color)
|
166
|
+
|
167
|
+
def animate_movement(self, start_x, end_x, final_color):
|
168
|
+
step = 1 if start_x < end_x else -1
|
169
|
+
for i in range(start_x, end_x, step):
|
170
|
+
self.canvas.coords(self.switch, i, 4, i + 12, 16)
|
171
|
+
self.canvas.update()
|
172
|
+
self.after(10) # Small delay for smooth animation
|
173
|
+
self.canvas.itemconfig(self.switch, fill=final_color)
|
174
|
+
|
175
|
+
def get(self):
|
176
|
+
return self.variable.get()
|
177
|
+
|
178
|
+
def set(self, value):
|
179
|
+
self.variable.set(value)
|
180
|
+
self.update_switch()
|
181
|
+
|
182
|
+
def create_rounded_rectangle(self, x1, y1, x2, y2, radius=9, **kwargs): # Smaller radius for smaller switch
|
183
|
+
points = [x1 + radius, y1,
|
184
|
+
x1 + radius, y1,
|
185
|
+
x2 - radius, y1,
|
186
|
+
x2 - radius, y1,
|
187
|
+
x2, y1,
|
188
|
+
x2, y1 + radius,
|
189
|
+
x2, y1 + radius,
|
190
|
+
x2, y2 - radius,
|
191
|
+
x2, y2 - radius,
|
192
|
+
x2, y2,
|
193
|
+
x2 - radius, y2,
|
194
|
+
x2 - radius, y2,
|
195
|
+
x1 + radius, y2,
|
196
|
+
x1 + radius, y2,
|
197
|
+
x1, y2,
|
198
|
+
x1, y2 - radius,
|
199
|
+
x1, y2 - radius,
|
200
|
+
x1, y1 + radius,
|
201
|
+
x1, y1 + radius,
|
202
|
+
x1, y1]
|
203
|
+
|
204
|
+
return self.canvas.create_polygon(points, **kwargs, smooth=True)
|
205
|
+
|
17
206
|
def set_default_font(root, font_name="Helvetica", size=12):
|
18
207
|
default_font = (font_name, size)
|
19
208
|
root.option_add("*Font", default_font)
|
@@ -21,13 +210,63 @@ def set_default_font(root, font_name="Helvetica", size=12):
|
|
21
210
|
root.option_add("*TLabel.Font", default_font)
|
22
211
|
root.option_add("*TEntry.Font", default_font)
|
23
212
|
|
213
|
+
def check_and_download_font():
|
214
|
+
font_name = "Open Sans"
|
215
|
+
font_dir = "fonts"
|
216
|
+
font_path = os.path.join(font_dir, "OpenSans-Regular.ttf")
|
217
|
+
|
218
|
+
# Check if the font is already available
|
219
|
+
available_fonts = list(tkFont.families())
|
220
|
+
if font_name not in available_fonts:
|
221
|
+
print(f"Font '{font_name}' not found. Downloading...")
|
222
|
+
if not os.path.exists(font_dir):
|
223
|
+
os.makedirs(font_dir)
|
224
|
+
|
225
|
+
if not os.path.exists(font_path):
|
226
|
+
url = "https://github.com/google/fonts/blob/main/apache/opensans/OpenSans-Regular.ttf?raw=true"
|
227
|
+
response = requests.get(url)
|
228
|
+
with open(font_path, "wb") as f:
|
229
|
+
f.write(response.content)
|
230
|
+
|
231
|
+
# Load the font
|
232
|
+
try:
|
233
|
+
tkFont.nametofont("TkDefaultFont").configure(family=font_name, size=10)
|
234
|
+
tkFont.nametofont("TkTextFont").configure(family=font_name, size=10)
|
235
|
+
tkFont.nametofont("TkHeadingFont").configure(family=font_name, size=12)
|
236
|
+
except tk.TclError:
|
237
|
+
tkFont.nametofont("TkDefaultFont").configure(family="Open Sans", size=10)
|
238
|
+
tkFont.nametofont("TkTextFont").configure(family="Open Sans", size=10)
|
239
|
+
tkFont.nametofont("TkHeadingFont").configure(family="Open Sans", size=12)
|
240
|
+
else:
|
241
|
+
tkFont.nametofont("TkDefaultFont").configure(family=font_name, size=10)
|
242
|
+
tkFont.nametofont("TkTextFont").configure(family=font_name, size=10)
|
243
|
+
tkFont.nametofont("TkHeadingFont").configure(family=font_name, size=12)
|
244
|
+
|
245
|
+
def style_text_boxes_v1(style):
|
246
|
+
style.configure('TEntry', padding='5 5 5 5', borderwidth=1, relief='solid', fieldbackground='#000000', foreground='#ffffff')
|
247
|
+
style.configure('TCombobox', fieldbackground='#000000', background='#000000', foreground='#ffffff')
|
248
|
+
style.configure('Custom.TButton', padding='10 10 10 10', borderwidth=1, relief='solid', background='#008080', foreground='#ffffff', font=('Open Sans', 10, 'bold'))
|
249
|
+
style.map('Custom.TButton',
|
250
|
+
background=[('active', '#66b2b2'), ('disabled', '#004d4d'), ('!disabled', '#008080')],
|
251
|
+
foreground=[('active', '#ffffff'), ('disabled', '#888888')])
|
252
|
+
style.configure('Custom.TLabel', padding='5 5 5 5', borderwidth=1, relief='flat', background='#000000', foreground='#ffffff', font=('Open Sans', 10))
|
253
|
+
style.configure('TCheckbutton', background='#333333', foreground='#ffffff', indicatoron=False, relief='flat')
|
254
|
+
style.map('TCheckbutton', background=[('selected', '#555555'), ('active', '#555555')])
|
255
|
+
|
24
256
|
def style_text_boxes(style):
|
25
|
-
|
26
|
-
|
27
|
-
style.
|
28
|
-
|
257
|
+
check_and_download_font()
|
258
|
+
open_sans = tkFont.Font(family="Open Sans", size=10) # Define the Open Sans font
|
259
|
+
style.configure('TEntry', padding='5 5 5 5', borderwidth=1, relief='solid', fieldbackground='#000000', foreground='#ffffff', font=open_sans)
|
260
|
+
style.configure('TCombobox', fieldbackground='#000000', background='#000000', foreground='#ffffff', font=open_sans)
|
261
|
+
style.configure('Custom.TButton', padding='10 10 10 10', borderwidth=1, relief='solid', background='#008080', foreground='#ffffff', font=open_sans)
|
262
|
+
style.map('Custom.TButton',
|
263
|
+
background=[('active', '#66b2b2'), ('disabled', '#004d4d'), ('!disabled', '#008080')],
|
29
264
|
foreground=[('active', '#ffffff'), ('disabled', '#888888')])
|
30
|
-
style.configure('TLabel', padding='5 5 5 5', borderwidth=1, relief='flat', background='#
|
265
|
+
style.configure('Custom.TLabel', padding='5 5 5 5', borderwidth=1, relief='flat', background='#000000', foreground='#ffffff', font=open_sans)
|
266
|
+
style.configure('TCheckbutton', background='#333333', foreground='#ffffff', indicatoron=False, relief='flat', font=open_sans)
|
267
|
+
style.map('TCheckbutton', background=[('selected', '#555555'), ('active', '#555555')])
|
268
|
+
|
269
|
+
|
31
270
|
|
32
271
|
def read_settings_from_csv(csv_file_path):
|
33
272
|
settings = {}
|
@@ -66,17 +305,8 @@ def disable_interactivity(fig):
|
|
66
305
|
for handler_id in list(handlers.keys()):
|
67
306
|
fig.canvas.mpl_disconnect(handler_id)
|
68
307
|
|
69
|
-
def set_default_font_v1(app, font_name="Arial Bold", size=10):
|
70
|
-
default_font = nametofont("TkDefaultFont")
|
71
|
-
text_font = nametofont("TkTextFont")
|
72
|
-
fixed_font = nametofont("TkFixedFont")
|
73
|
-
|
74
|
-
# Set the family to Open Sans and size as desired
|
75
|
-
for font in (default_font, text_font, fixed_font):
|
76
|
-
font.config(family=font_name, size=size)
|
77
|
-
|
78
308
|
class ScrollableFrame(ttk.Frame):
|
79
|
-
def __init__(self, container, *args, bg='
|
309
|
+
def __init__(self, container, *args, bg='black', **kwargs):
|
80
310
|
super().__init__(container, *args, **kwargs)
|
81
311
|
self.configure(style='TFrame') # Ensure this uses the styled frame from dark mode
|
82
312
|
|
@@ -381,32 +611,31 @@ def classify_variables():
|
|
381
611
|
}
|
382
612
|
return variables
|
383
613
|
|
384
|
-
|
385
|
-
#@log_function_call
|
386
614
|
def create_input_field(frame, label_text, row, var_type='entry', options=None, default_value=None):
|
387
|
-
label = ttk.Label(frame, text=label_text, style='TLabel') #
|
615
|
+
label = ttk.Label(frame, text=label_text, style='Custom.TLabel') # Apply Custom.TLabel style for labels
|
388
616
|
label.grid(column=0, row=row, sticky=tk.W, padx=5, pady=5)
|
389
617
|
|
390
618
|
if var_type == 'entry':
|
391
619
|
var = tk.StringVar(value=default_value) # Set default value
|
392
|
-
entry = ttk.Entry(frame, textvariable=var, style='TEntry') #
|
620
|
+
entry = ttk.Entry(frame, textvariable=var, style='TEntry') # Apply TEntry style for entries
|
393
621
|
entry.grid(column=1, row=row, sticky=tk.EW, padx=5)
|
622
|
+
return (label, entry, var) # Return both the label and the entry, and the variable
|
394
623
|
elif var_type == 'check':
|
395
624
|
var = tk.BooleanVar(value=default_value) # Set default value (True/False)
|
396
|
-
|
397
|
-
check = ttk.Checkbutton(frame, variable=var, style='Dark.TCheckbutton')
|
625
|
+
check = ToggleSwitch(frame, text=label_text, variable=var) # Use ToggleSwitch class
|
398
626
|
check.grid(column=1, row=row, sticky=tk.W, padx=5)
|
627
|
+
return (label, check, var) # Return both the label and the checkbutton, and the variable
|
399
628
|
elif var_type == 'combo':
|
400
629
|
var = tk.StringVar(value=default_value) # Set default value
|
401
|
-
combo = ttk.Combobox(frame, textvariable=var, values=options, style='TCombobox') #
|
630
|
+
combo = ttk.Combobox(frame, textvariable=var, values=options, style='TCombobox') # Apply TCombobox style
|
402
631
|
combo.grid(column=1, row=row, sticky=tk.EW, padx=5)
|
403
632
|
if default_value:
|
404
633
|
combo.set(default_value)
|
634
|
+
return (label, combo, var) # Return both the label and the combobox, and the variable
|
405
635
|
else:
|
406
636
|
var = None # Placeholder in case of an undefined var_type
|
407
|
-
|
408
|
-
|
409
|
-
|
637
|
+
return (label, None, var)
|
638
|
+
|
410
639
|
def mask_variables():
|
411
640
|
variables = {
|
412
641
|
'src': ('entry', None, '/mnt/data/CellVoyager/40x/einar/mitotrackerHeLaToxoDsRed_20240224_123156/test_gui'),
|
@@ -473,7 +702,8 @@ def generate_fields(variables, scrollable_frame):
|
|
473
702
|
vars_dict = {}
|
474
703
|
row = 0
|
475
704
|
for key, (var_type, options, default_value) in variables.items():
|
476
|
-
|
705
|
+
label, widget, var = create_input_field(scrollable_frame.scrollable_frame, key, row, var_type, options, default_value)
|
706
|
+
vars_dict[key] = (label, widget, var) # Store the label, widget, and variable
|
477
707
|
row += 1
|
478
708
|
return vars_dict
|
479
709
|
|
@@ -489,7 +719,7 @@ class TextRedirector(object):
|
|
489
719
|
pass
|
490
720
|
|
491
721
|
def create_dark_mode(root, style, console_output):
|
492
|
-
dark_bg = '
|
722
|
+
dark_bg = 'black'
|
493
723
|
light_text = 'white'
|
494
724
|
dark_text = 'black'
|
495
725
|
input_bg = '#555555' # Slightly lighter background for input fields
|
@@ -505,14 +735,14 @@ def create_dark_mode(root, style, console_output):
|
|
505
735
|
style.map('TCombobox', fieldbackground=[('readonly', input_bg)], selectbackground=[('readonly', input_bg)], foreground=[('readonly', dark_text)])
|
506
736
|
|
507
737
|
if console_output != None:
|
508
|
-
console_output.config(bg=dark_bg, fg=light_text, insertbackground=light_text) #, font=("
|
738
|
+
console_output.config(bg=dark_bg, fg=light_text, insertbackground=light_text) #, font=("Open Sans", 12)
|
509
739
|
root.configure(bg=dark_bg)
|
510
740
|
|
511
741
|
def set_dark_style(style):
|
512
|
-
style.configure('TFrame', background='
|
513
|
-
style.configure('TLabel', background='
|
514
|
-
style.configure('TEntry', background='
|
515
|
-
style.configure('TCheckbutton', background='
|
742
|
+
style.configure('TFrame', background='black')
|
743
|
+
style.configure('TLabel', background='black', foreground='white')
|
744
|
+
style.configure('TEntry', background='black', foreground='white')
|
745
|
+
style.configure('TCheckbutton', background='black', foreground='white')
|
516
746
|
|
517
747
|
#@log_function_call
|
518
748
|
def main_thread_update_function(root, q, fig_queue, canvas_widget, progress_label):
|
spacr/io.py
CHANGED
spacr/mask_app.py
CHANGED
@@ -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 ScrollableFrame, set_dark_style, set_default_font, create_dark_mode
|
16
|
+
from .gui_utils import ScrollableFrame, set_dark_style, set_default_font, create_dark_mode, style_text_boxes, create_menu_bar
|
17
17
|
|
18
18
|
class modify_masks:
|
19
19
|
|
@@ -759,9 +759,12 @@ def initiate_mask_app_root(width, height):
|
|
759
759
|
root = ThemedTk(theme=theme)
|
760
760
|
style = ttk.Style(root)
|
761
761
|
set_dark_style(style)
|
762
|
-
|
762
|
+
|
763
|
+
style_text_boxes(style)
|
764
|
+
set_default_font(root, font_name="Arial", size=8)
|
763
765
|
root.geometry(f"{width}x{height}")
|
764
766
|
root.title("Mask App")
|
767
|
+
create_menu_bar(root)
|
765
768
|
|
766
769
|
container = tk.PanedWindow(root, orient=tk.HORIZONTAL)
|
767
770
|
container.pack(fill=tk.BOTH, expand=True)
|
@@ -806,7 +809,7 @@ def initiate_mask_app_root(width, height):
|
|
806
809
|
create_dark_mode(root, style, console_output=None)
|
807
810
|
|
808
811
|
run_button = ttk.Button(scrollable_frame.scrollable_frame, text="Run", command=run_app)
|
809
|
-
run_button.grid(row=row, column=0, columnspan=2, pady=10)
|
812
|
+
run_button.grid(row=row, column=0, columnspan=2, pady=10, padx=10)
|
810
813
|
|
811
814
|
return root
|
812
815
|
|
spacr/utils.py
CHANGED
@@ -46,12 +46,6 @@ from torchvision.models.resnet import ResNet18_Weights, ResNet34_Weights, ResNet
|
|
46
46
|
|
47
47
|
from .logger import log_function_call
|
48
48
|
|
49
|
-
#from .io import _read_and_join_tables, _save_figure
|
50
|
-
#from .timelapse import _btrack_track_cells, _trackpy_track_cells
|
51
|
-
#from .plot import _plot_images_on_grid, plot_masks, _plot_histograms_and_stats, plot_resize, _plot_plates, _reg_v_plot, plot_masks
|
52
|
-
#from .core import identify_masks
|
53
|
-
|
54
|
-
|
55
49
|
def _gen_rgb_image(image, cahnnels):
|
56
50
|
rgb_image = np.take(image, cahnnels, axis=-1)
|
57
51
|
rgb_image = rgb_image.astype(float)
|
@@ -1,21 +1,23 @@
|
|
1
1
|
spacr/__init__.py,sha256=mDi-Qu5r1vZnqIbUBV1JAoSq-mxmMEOmni1JSG2e4Wo,879
|
2
2
|
spacr/__main__.py,sha256=_qRkhbFrH_cXr7AZs6KHL8Hh4VApqNdpNCtiKn2ePTo,285
|
3
3
|
spacr/alpha.py,sha256=1LUtTaeVHqcTMxoCMA7mlsNYyaR0KEaXglwXsUQLwKo,13776
|
4
|
-
spacr/annotate_app.py,sha256=
|
4
|
+
spacr/annotate_app.py,sha256=8ziG6HZ6Kvany2yYDR15jtW84OnPFe8SZXykIrrNfX0,20031
|
5
|
+
spacr/chris.py,sha256=YlBjSgeZaY8HPy6jkrT_ISAnCMAKVfvCxF0I9eAZLFM,2418
|
5
6
|
spacr/cli.py,sha256=507jfOOEV8BoL4eeUcblvH-iiDHdBrEVJLu1ghAAPSc,1800
|
6
7
|
spacr/core.py,sha256=_R8gXNnjf680yrnbCi2piWQUz7PDbqWYn7SL5MACLfo,156457
|
7
8
|
spacr/foldseek.py,sha256=cWtLzvFF2O_mq5I71UMiuU9DTvDCp7wl6aaWAZRrBZc,33970
|
8
9
|
spacr/get_alfafold_structures.py,sha256=n0g8gne-oyAV3Uo6qxZoJq5X1cUUyD8u0pOC_W2PX40,3541
|
9
10
|
spacr/graph_learning.py,sha256=sD4eOC7Q16rr7WO20mCi_E16_LqioGUUgPamAHIIeNI,12568
|
10
11
|
spacr/graph_learning_lap.py,sha256=MyNRLb63gsjBlui-ByZ0anHugYulL6M-OsGm8rnGBmE,3385
|
11
|
-
spacr/
|
12
|
-
spacr/
|
13
|
-
spacr/
|
12
|
+
spacr/gui.py,sha256=2d2JHYVWhEFUkB3u_2OarCV_V07eLtJKUMKVKuJ7nAo,6430
|
13
|
+
spacr/gui_classify_app.py,sha256=RqVC5Ac0GiFhKg1qUyU-xfbSVMwSTjySkReWCvmsZ1U,7917
|
14
|
+
spacr/gui_mask_app.py,sha256=c0NwgzzMSYx7xE60sp6zLE1h7ct3pnT7n7gz1SqmWbs,9750
|
15
|
+
spacr/gui_measure_app.py,sha256=I6OXPJZZ0sG3OqRO4l7Fr9Sb_5jr6X1Y2LXLgPW_Q_4,9675
|
14
16
|
spacr/gui_sim_app.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
|
-
spacr/gui_utils.py,sha256=
|
16
|
-
spacr/io.py,sha256
|
17
|
+
spacr/gui_utils.py,sha256=URyEUfDn7RSE8iWBDwmC1jXWNA2Vl1oA2GsSjbSbuFU,40715
|
18
|
+
spacr/io.py,sha256=-Ho1Rw46s5DfutcTAtp0RhEs3I-GPgXIphOpjJHutPU,108688
|
17
19
|
spacr/logger.py,sha256=7Zqr3TuuOQLWT32gYr2q1qvv7x0a2JhLANmZcnBXAW8,670
|
18
|
-
spacr/mask_app.py,sha256=
|
20
|
+
spacr/mask_app.py,sha256=p9oA0JH0Rcly2Fbsrg-Vye_iThRCZZF9axU6hkE3SAI,39376
|
19
21
|
spacr/measure.py,sha256=_f6UDugw75rILEg0uo2-QsUGUvc4AQdrdHl-BPZk74I,54686
|
20
22
|
spacr/old_code.py,sha256=KxljHpKNsV5EfX9ifN2xJTnUeqAhyabZyfDWd5THOOc,11226
|
21
23
|
spacr/plot.py,sha256=VtDKTJ_zo8CAVC3ILuIN_wUP6197vq089wNZuom7T8g,61655
|
@@ -23,11 +25,11 @@ spacr/sim.py,sha256=2NR5hm--HVcYQnj1SCHoUCVbh_b2XUjjjfoAUIXFwnQ,72997
|
|
23
25
|
spacr/timelapse.py,sha256=plPjR8nZ7_Q50VAvMvHK2TUE4F-vh7R23JnI6tSW02g,39661
|
24
26
|
spacr/train.py,sha256=lp66dWYkiMMlgdYlMjAsJnkIZFWLizKB-xwyVnKgFBs,25904
|
25
27
|
spacr/umap.py,sha256=4QSrQ16Og-Ijq-SwguMQT2f20UWz1LE5HQeSLmzSl8c,29370
|
26
|
-
spacr/utils.py,sha256=
|
28
|
+
spacr/utils.py,sha256=D3WRf_0w0T6dZHh3BfwScGBQjorljgWW6CQUdM0ToN8,120918
|
27
29
|
spacr/version.py,sha256=axH5tnGwtgSnJHb5IDhiu4Zjk5GhLyAEDRe-rnaoFOA,409
|
28
|
-
spacr-0.0.
|
29
|
-
spacr-0.0.
|
30
|
-
spacr-0.0.
|
31
|
-
spacr-0.0.
|
32
|
-
spacr-0.0.
|
33
|
-
spacr-0.0.
|
30
|
+
spacr-0.0.35.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
|
31
|
+
spacr-0.0.35.dist-info/METADATA,sha256=0iEqhFIza7SaHVeYbl0Rc8WocPgGEVtiwMoWsIBBZzQ,4973
|
32
|
+
spacr-0.0.35.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
33
|
+
spacr-0.0.35.dist-info/entry_points.txt,sha256=_khj_UcegrI5N29QcgxECsxVsfpVQzG3U5OUoKdtTcw,288
|
34
|
+
spacr-0.0.35.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
|
35
|
+
spacr-0.0.35.dist-info/RECORD,,
|
@@ -0,0 +1,8 @@
|
|
1
|
+
[console_scripts]
|
2
|
+
annotate = spacr.annotate_app:gui_annotation
|
3
|
+
classify = spacr.gui_classify_app:gui_classify
|
4
|
+
gui = spacr.gui:gui_app
|
5
|
+
make_masks = spacr.mask_app:gui_make_masks
|
6
|
+
mask = spacr.gui_mask_app:gui_mask
|
7
|
+
measure = spacr.gui_measure_app:gui_measure
|
8
|
+
sim = spacr.gui_sim_app:gui_sim
|
@@ -1,7 +0,0 @@
|
|
1
|
-
[console_scripts]
|
2
|
-
gui_annotation = spacr.annotate_app:gui_annotation
|
3
|
-
gui_classify = spacr.gui_classify_app:gui_classify
|
4
|
-
gui_make_masks = spacr.mask_app:gui_make_masks
|
5
|
-
gui_mask = spacr.gui_mask_app:gui_mask
|
6
|
-
gui_measure = spacr.gui_measure_app:gui_measure
|
7
|
-
gui_sim = spacr.gui_sim_app:gui_sim
|
File without changes
|
File without changes
|
File without changes
|