spacr 0.2.46__py3-none-any.whl → 0.2.53__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 +24 -11
- spacr/gui.py +0 -2
- spacr/gui_core.py +70 -55
- spacr/gui_elements.py +367 -152
- spacr/gui_utils.py +59 -68
- spacr/io.py +2 -3
- spacr/measure.py +196 -145
- spacr/plot.py +2 -42
- spacr/resources/font/open_sans/OFL.txt +93 -0
- spacr/resources/font/open_sans/OpenSans-Italic-VariableFont_wdth,wght.ttf +0 -0
- spacr/resources/font/open_sans/OpenSans-VariableFont_wdth,wght.ttf +0 -0
- spacr/resources/font/open_sans/README.txt +100 -0
- spacr/resources/font/open_sans/static/OpenSans-Bold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-BoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-ExtraBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-ExtraBoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-Italic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-Light.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-LightItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-Medium.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-MediumItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-Regular.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-SemiBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans-SemiBoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-Bold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-BoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-Italic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-Light.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-LightItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-Medium.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-MediumItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-Regular.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Bold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-BoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Italic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Light.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-LightItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Medium.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-MediumItalic.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Regular.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBold.ttf +0 -0
- spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBoldItalic.ttf +0 -0
- spacr/sequencing.py +107 -13
- spacr/settings.py +27 -84
- spacr/utils.py +9 -9
- {spacr-0.2.46.dist-info → spacr-0.2.53.dist-info}/METADATA +6 -4
- spacr-0.2.53.dist-info/RECORD +100 -0
- spacr-0.2.46.dist-info/RECORD +0 -60
- {spacr-0.2.46.dist-info → spacr-0.2.53.dist-info}/LICENSE +0 -0
- {spacr-0.2.46.dist-info → spacr-0.2.53.dist-info}/WHEEL +0 -0
- {spacr-0.2.46.dist-info → spacr-0.2.53.dist-info}/entry_points.txt +0 -0
- {spacr-0.2.46.dist-info → spacr-0.2.53.dist-info}/top_level.txt +0 -0
spacr/core.py
CHANGED
@@ -1729,20 +1729,43 @@ def preprocess_generate_masks(src, settings={}):
|
|
1729
1729
|
|
1730
1730
|
if settings['preprocess']:
|
1731
1731
|
settings, src = preprocess_img_data(settings)
|
1732
|
-
|
1732
|
+
|
1733
|
+
files_to_process = 3
|
1734
|
+
files_processed = 0
|
1733
1735
|
if settings['masks']:
|
1734
1736
|
mask_src = os.path.join(src, 'norm_channel_stack')
|
1735
1737
|
if settings['cell_channel'] != None:
|
1738
|
+
time_ls=[]
|
1736
1739
|
if check_mask_folder(src, 'cell_mask_stack'):
|
1740
|
+
start = time.time()
|
1737
1741
|
generate_cellpose_masks(mask_src, settings, 'cell')
|
1742
|
+
stop = time.time()
|
1743
|
+
duration = (stop - start)
|
1744
|
+
time_ls.append(duration)
|
1745
|
+
files_processed += 1
|
1746
|
+
print_progress(files_processed, files_to_process, n_jobs=1, time_ls=time_ls, batch_size=None, operation_type=f'cell_mask_gen')
|
1738
1747
|
|
1739
1748
|
if settings['nucleus_channel'] != None:
|
1749
|
+
time_ls=[]
|
1740
1750
|
if check_mask_folder(src, 'nucleus_mask_stack'):
|
1751
|
+
start = time.time()
|
1741
1752
|
generate_cellpose_masks(mask_src, settings, 'nucleus')
|
1753
|
+
stop = time.time()
|
1754
|
+
duration = (stop - start)
|
1755
|
+
time_ls.append(duration)
|
1756
|
+
files_processed += 1
|
1757
|
+
print_progress(files_processed, files_to_process, n_jobs=1, time_ls=time_ls, batch_size=None, operation_type=f'nucleus_mask_gen')
|
1742
1758
|
|
1743
1759
|
if settings['pathogen_channel'] != None:
|
1760
|
+
time_ls=[]
|
1744
1761
|
if check_mask_folder(src, 'pathogen_mask_stack'):
|
1762
|
+
start = time.time()
|
1745
1763
|
generate_cellpose_masks(mask_src, settings, 'pathogen')
|
1764
|
+
stop = time.time()
|
1765
|
+
duration = (stop - start)
|
1766
|
+
time_ls.append(duration)
|
1767
|
+
files_processed += 1
|
1768
|
+
print_progress(files_processed, files_to_process, n_jobs=1, time_ls=time_ls, batch_size=None, operation_type=f'pathogen_mask_gen')
|
1746
1769
|
|
1747
1770
|
#if settings['organelle'] != None:
|
1748
1771
|
# if check_mask_folder(src, 'organelle_mask_stack'):
|
@@ -2012,7 +2035,6 @@ def generate_cellpose_masks(src, settings, object_type):
|
|
2012
2035
|
average_sizes = []
|
2013
2036
|
time_ls = []
|
2014
2037
|
|
2015
|
-
files_to_process = len(paths)
|
2016
2038
|
for file_index, path in enumerate(paths):
|
2017
2039
|
name = os.path.basename(path)
|
2018
2040
|
name, ext = os.path.splitext(name)
|
@@ -2050,7 +2072,6 @@ def generate_cellpose_masks(src, settings, object_type):
|
|
2050
2072
|
print(f'Cut batch at indecies: {timelapse_frame_limits}, New batch_size: {batch_size} ')
|
2051
2073
|
|
2052
2074
|
for i in range(0, stack.shape[0], batch_size):
|
2053
|
-
start = time.time()
|
2054
2075
|
mask_stack = []
|
2055
2076
|
if stack.shape[3] == 1:
|
2056
2077
|
batch = stack[i: i+batch_size, :, :, [0,0]].astype(stack.dtype)
|
@@ -2072,14 +2093,6 @@ def generate_cellpose_masks(src, settings, object_type):
|
|
2072
2093
|
save_path = os.path.join(movie_path, f'timelapse_{object_type}_{name}.mp4')
|
2073
2094
|
_npz_to_movie(batch, batch_filenames, save_path, fps=2)
|
2074
2095
|
|
2075
|
-
stop = time.time()
|
2076
|
-
duration = (stop - start)
|
2077
|
-
time_ls.append(duration)
|
2078
|
-
files_processed = (file_index+1)*len(batch_filenames)
|
2079
|
-
files_processed = len(paths)*batch.shape[0]
|
2080
|
-
print('file_index', file_index, 'len(paths)', len(paths), 'batch.shape[0]', batch.shape[0])
|
2081
|
-
print_progress(files_processed, files_to_process, n_jobs=1, time_ls=time_ls, batch_size=batch.shape[0], operation_type=f'{object_type}_mask_gen')
|
2082
|
-
|
2083
2096
|
output = model.eval(x=batch,
|
2084
2097
|
batch_size=cellpose_batch_size,
|
2085
2098
|
normalize=False,
|
spacr/gui.py
CHANGED
spacr/gui_core.py
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
import
|
1
|
+
import traceback, ctypes, csv, re, time
|
2
2
|
import tkinter as tk
|
3
3
|
from tkinter import ttk
|
4
4
|
from tkinter import filedialog
|
5
5
|
from multiprocessing import Process, Value, Queue, set_start_method
|
6
|
-
from multiprocessing.sharedctypes import Synchronized
|
7
6
|
from tkinter import ttk, scrolledtext
|
8
7
|
from matplotlib.figure import Figure
|
9
8
|
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
|
10
9
|
import numpy as np
|
11
10
|
import psutil
|
12
11
|
import GPUtil
|
13
|
-
import tkinter.font as tkFont
|
14
12
|
|
15
13
|
try:
|
16
14
|
ctypes.windll.shcore.SetProcessDpiAwareness(True)
|
@@ -45,13 +43,15 @@ def toggle_settings(button_scrollable_frame):
|
|
45
43
|
def toggle_category(settings):
|
46
44
|
for setting in settings:
|
47
45
|
if setting in vars_dict:
|
48
|
-
label, widget, _ = vars_dict[setting]
|
46
|
+
label, widget, _, frame = vars_dict[setting]
|
49
47
|
if widget.grid_info():
|
50
48
|
label.grid_remove()
|
51
49
|
widget.grid_remove()
|
50
|
+
frame.grid_remove()
|
52
51
|
else:
|
53
52
|
label.grid()
|
54
53
|
widget.grid()
|
54
|
+
frame.grid()
|
55
55
|
|
56
56
|
def on_category_select(selected_category):
|
57
57
|
if selected_category == "Select Category":
|
@@ -81,15 +81,20 @@ def process_fig_queue():
|
|
81
81
|
|
82
82
|
try:
|
83
83
|
while not fig_queue.empty():
|
84
|
+
time.sleep(1)
|
84
85
|
clear_canvas(canvas)
|
85
86
|
fig = fig_queue.get_nowait()
|
87
|
+
|
86
88
|
for ax in fig.get_axes():
|
87
89
|
ax.set_xticks([]) # Remove x-axis ticks
|
88
90
|
ax.set_yticks([]) # Remove y-axis ticks
|
89
91
|
ax.xaxis.set_visible(False) # Hide the x-axis
|
90
92
|
ax.yaxis.set_visible(False) # Hide the y-axis
|
91
|
-
|
93
|
+
|
94
|
+
# Adjust layout to minimize spacing between axes
|
95
|
+
fig.subplots_adjust(left=0, right=1, top=1, bottom=0, wspace=0.01, hspace=0.01)
|
92
96
|
fig.set_facecolor('black')
|
97
|
+
|
93
98
|
canvas.figure = fig
|
94
99
|
fig_width, fig_height = canvas_widget.winfo_width(), canvas_widget.winfo_height()
|
95
100
|
fig.set_size_inches(fig_width / fig.dpi, fig_height / fig.dpi, forward=True)
|
@@ -97,12 +102,9 @@ def process_fig_queue():
|
|
97
102
|
except Exception as e:
|
98
103
|
traceback.print_exc()
|
99
104
|
finally:
|
100
|
-
after_id = canvas_widget.after(
|
105
|
+
after_id = canvas_widget.after(1, process_fig_queue)
|
101
106
|
parent_frame.after_tasks.append(after_id)
|
102
107
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
108
|
def set_globals(thread_control_var, q_var, console_output_var, parent_frame_var, vars_dict_var, canvas_var, canvas_widget_var, scrollable_frame_var, fig_queue_var, progress_bar_var, usage_bars_var):
|
107
109
|
global thread_control, q, console_output, parent_frame, vars_dict, canvas, canvas_widget, scrollable_frame, fig_queue, progress_bar, usage_bars
|
108
110
|
thread_control = thread_control_var
|
@@ -170,13 +172,14 @@ def import_settings(settings_type='mask'):
|
|
170
172
|
def setup_settings_panel(vertical_container, settings_type='mask'):
|
171
173
|
global vars_dict, scrollable_frame
|
172
174
|
from .settings import get_identify_masks_finetune_default_settings, set_default_analyze_screen, set_default_settings_preprocess_generate_masks, get_measure_crop_settings, set_default_train_test_model, get_analyze_reads_default_settings, set_default_umap_image_settings, generate_fields, get_perform_regression_default_settings, get_train_cellpose_default_settings, get_map_barcodes_default_settings, get_analyze_recruitment_default_settings, get_check_cellpose_models_default_settings
|
173
|
-
from .gui_utils import convert_settings_dict_for_gui
|
175
|
+
from .gui_utils import convert_settings_dict_for_gui
|
176
|
+
from .gui_elements import set_element_size
|
174
177
|
|
175
|
-
size_dict = set_element_size(
|
178
|
+
size_dict = set_element_size()
|
176
179
|
settings_width = size_dict['settings_width']
|
177
180
|
|
178
181
|
# Create a PanedWindow for the settings panel
|
179
|
-
settings_paned_window = tk.PanedWindow(vertical_container, orient=tk.HORIZONTAL)
|
182
|
+
settings_paned_window = tk.PanedWindow(vertical_container, orient=tk.HORIZONTAL, width=size_dict['settings_width'])
|
180
183
|
vertical_container.add(settings_paned_window, stretch="always")
|
181
184
|
|
182
185
|
settings_frame = tk.Frame(settings_paned_window, width=settings_width)
|
@@ -230,8 +233,12 @@ def setup_settings_panel(vertical_container, settings_type='mask'):
|
|
230
233
|
|
231
234
|
def setup_plot_section(vertical_container):
|
232
235
|
global canvas, canvas_widget
|
233
|
-
|
236
|
+
|
237
|
+
# Create a frame for the plot section
|
238
|
+
plot_frame = tk.Frame(vertical_container, bg='lightgrey')
|
234
239
|
vertical_container.add(plot_frame, stretch="always")
|
240
|
+
|
241
|
+
# Set up the plot
|
235
242
|
figure = Figure(figsize=(30, 4), dpi=100)
|
236
243
|
plot = figure.add_subplot(111)
|
237
244
|
plot.plot([], []) # This creates an empty plot.
|
@@ -239,7 +246,11 @@ def setup_plot_section(vertical_container):
|
|
239
246
|
canvas = FigureCanvasTkAgg(figure, master=plot_frame)
|
240
247
|
canvas.get_tk_widget().configure(cursor='arrow', highlightthickness=0)
|
241
248
|
canvas_widget = canvas.get_tk_widget()
|
242
|
-
|
249
|
+
canvas_widget.grid(row=0, column=0, sticky="nsew") # Use grid for the canvas widget
|
250
|
+
|
251
|
+
plot_frame.grid_rowconfigure(0, weight=1)
|
252
|
+
plot_frame.grid_columnconfigure(0, weight=1)
|
253
|
+
|
243
254
|
canvas.draw()
|
244
255
|
canvas.figure = figure
|
245
256
|
style_out = set_dark_style(ttk.Style())
|
@@ -250,6 +261,7 @@ def setup_plot_section(vertical_container):
|
|
250
261
|
widgets = [canvas_widget]
|
251
262
|
style = ttk.Style(vertical_container)
|
252
263
|
_ = set_dark_style(style, containers=containers, widgets=widgets)
|
264
|
+
|
253
265
|
return canvas, canvas_widget
|
254
266
|
|
255
267
|
def setup_console(vertical_container):
|
@@ -260,46 +272,47 @@ def setup_console(vertical_container):
|
|
260
272
|
style = ttk.Style()
|
261
273
|
style_out = set_dark_style(style)
|
262
274
|
|
263
|
-
# Create a
|
264
|
-
|
265
|
-
vertical_container.add(
|
266
|
-
|
267
|
-
# Create the main content frame
|
268
|
-
main_content_frame = tk.Frame(main_paned_window, bg=style_out['bg_color'])
|
269
|
-
main_paned_window.add(main_content_frame, stretch="always")
|
275
|
+
# Create a frame for the console section
|
276
|
+
console_frame = tk.Frame(vertical_container, bg=style_out['bg_color'])
|
277
|
+
vertical_container.add(console_frame, stretch="always")
|
270
278
|
|
271
|
-
# Create a frame
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
# Create the main console frame
|
276
|
-
console_frame = tk.Frame(console_button_frame, bg=style_out['bg_color'])
|
277
|
-
console_frame.pack(fill=tk.BOTH, expand=True)
|
279
|
+
# Create a thicker frame at the top for the hover effect
|
280
|
+
top_border = tk.Frame(console_frame, height=5, bg=style_out['bg_color'])
|
281
|
+
top_border.grid(row=0, column=0, sticky="ew", pady=(0, 2))
|
278
282
|
|
279
283
|
# Create the scrollable frame (which is a Text widget) with white text
|
280
284
|
family = style_out['font_family']
|
281
|
-
|
282
|
-
|
283
|
-
console_output = tk.Text(console_frame, bg=style_out['bg_color'], fg=style_out['fg_color'], font=
|
284
|
-
|
285
|
+
font_size = style_out['font_size'] - 2
|
286
|
+
font_loader = style_out['font_loader']
|
287
|
+
console_output = tk.Text(console_frame, bg=style_out['bg_color'], fg=style_out['fg_color'], font=font_loader.get_font(size=font_size), bd=0, highlightthickness=0)
|
288
|
+
|
289
|
+
console_output.grid(row=1, column=0, sticky="nsew") # Use grid for console_output
|
285
290
|
|
286
291
|
# Configure the grid to allow expansion
|
287
|
-
console_frame.grid_rowconfigure(
|
292
|
+
console_frame.grid_rowconfigure(1, weight=1)
|
288
293
|
console_frame.grid_columnconfigure(0, weight=1)
|
289
294
|
|
290
|
-
|
291
|
-
|
292
|
-
|
295
|
+
def on_enter(event):
|
296
|
+
top_border.config(bg=style_out['active_color'])
|
297
|
+
|
298
|
+
def on_leave(event):
|
299
|
+
top_border.config(bg=style_out['bg_color'])
|
300
|
+
|
301
|
+
console_output.bind("<Enter>", on_enter)
|
302
|
+
console_output.bind("<Leave>", on_leave)
|
293
303
|
|
294
304
|
return console_output, console_frame
|
295
305
|
|
296
306
|
def setup_progress_frame(vertical_container):
|
297
307
|
global progress_output
|
308
|
+
style_out = set_dark_style(ttk.Style())
|
309
|
+
font_loader = style_out['font_loader']
|
310
|
+
font_size = style_out['font_size']
|
298
311
|
progress_frame = tk.Frame(vertical_container)
|
299
312
|
vertical_container.add(progress_frame, stretch="always")
|
300
313
|
label_frame = tk.Frame(progress_frame)
|
301
314
|
label_frame.grid(row=0, column=0, sticky="ew", pady=(5, 0), padx=10)
|
302
|
-
progress_label = spacrLabel(label_frame, text="Processing: 0%", font=(
|
315
|
+
progress_label = spacrLabel(label_frame, text="Processing: 0%", font=font_loader.get_font(size=font_size), anchor='w', justify='left', align="left")
|
303
316
|
progress_label.grid(row=0, column=0, sticky="w")
|
304
317
|
progress_output = scrolledtext.ScrolledText(progress_frame, height=10)
|
305
318
|
progress_output.grid(row=1, column=0, sticky="nsew")
|
@@ -313,10 +326,10 @@ def setup_progress_frame(vertical_container):
|
|
313
326
|
|
314
327
|
def setup_button_section(horizontal_container, settings_type='mask', run=True, abort=True, download=True, import_btn=True):
|
315
328
|
global thread_control, parent_frame, button_frame, button_scrollable_frame, run_button, abort_button, download_dataset_button, import_button, q, fig_queue, vars_dict, progress_bar
|
316
|
-
from .gui_utils import
|
317
|
-
from .
|
329
|
+
from .gui_utils import download_hug_dataset
|
330
|
+
from .gui_elements import set_element_size
|
318
331
|
|
319
|
-
size_dict = set_element_size(
|
332
|
+
size_dict = set_element_size()
|
320
333
|
button_section_height = size_dict['panel_height']
|
321
334
|
button_frame = tk.Frame(horizontal_container, height=button_section_height)
|
322
335
|
|
@@ -357,7 +370,7 @@ def setup_button_section(horizontal_container, settings_type='mask', run=True, a
|
|
357
370
|
|
358
371
|
# Add the progress bar under the settings category menu
|
359
372
|
progress_bar = spacrProgressBar(button_scrollable_frame.scrollable_frame, orient='horizontal', mode='determinate')
|
360
|
-
progress_bar.grid(row=btn_row, column=0, columnspan=
|
373
|
+
progress_bar.grid(row=btn_row, column=0, columnspan=7, pady=5, padx=5, sticky='ew')
|
361
374
|
progress_bar.set_label_position() # Set the label position after grid placement
|
362
375
|
widgets.append(progress_bar)
|
363
376
|
|
@@ -371,8 +384,7 @@ def setup_button_section(horizontal_container, settings_type='mask', run=True, a
|
|
371
384
|
|
372
385
|
def setup_usage_panel(horizontal_container, btn_col):
|
373
386
|
global usage_bars
|
374
|
-
from .
|
375
|
-
from .gui_elements import set_dark_style
|
387
|
+
from .gui_elements import set_dark_style, set_element_size
|
376
388
|
|
377
389
|
usg_col = 1
|
378
390
|
|
@@ -398,7 +410,7 @@ def setup_usage_panel(horizontal_container, btn_col):
|
|
398
410
|
# Schedule the function to run again after 1000 ms (1 second)
|
399
411
|
parent_frame.after(1000, update_usage, ram_bar, vram_bar, gpu_bar, usage_bars, parent_frame)
|
400
412
|
|
401
|
-
size_dict = set_element_size(
|
413
|
+
size_dict = set_element_size()
|
402
414
|
usage_panel_height = size_dict['panel_height']
|
403
415
|
usage_frame = tk.Frame(horizontal_container, height=usage_panel_height)
|
404
416
|
horizontal_container.add(usage_frame)
|
@@ -413,7 +425,7 @@ def setup_usage_panel(horizontal_container, btn_col):
|
|
413
425
|
widgets = [usage_scrollable_frame.scrollable_frame]
|
414
426
|
|
415
427
|
usage_bars = []
|
416
|
-
max_elements_per_column =
|
428
|
+
max_elements_per_column = 4
|
417
429
|
row = 0
|
418
430
|
col = 0
|
419
431
|
|
@@ -423,9 +435,9 @@ def setup_usage_panel(horizontal_container, btn_col):
|
|
423
435
|
# Configure the style for the label
|
424
436
|
style = ttk.Style()
|
425
437
|
style_out = set_dark_style(style)
|
426
|
-
|
427
|
-
|
428
|
-
style.configure("usage.TLabel", font=
|
438
|
+
font_loader = style_out['font_loader']
|
439
|
+
font_size = style_out['font_size'] - 2
|
440
|
+
style.configure("usage.TLabel", font=font_loader.get_font(size=font_size), foreground=style_out['fg_color'])
|
429
441
|
|
430
442
|
# Try adding RAM bar
|
431
443
|
try:
|
@@ -525,7 +537,6 @@ def start_process(q=None, fig_queue=None, settings_type='mask'):
|
|
525
537
|
q = Queue()
|
526
538
|
if fig_queue is None:
|
527
539
|
fig_queue = Queue()
|
528
|
-
|
529
540
|
try:
|
530
541
|
settings = check_settings(vars_dict, expected_types, q)
|
531
542
|
except ValueError as e:
|
@@ -573,7 +584,7 @@ def process_console_queue():
|
|
573
584
|
try:
|
574
585
|
# Extract the progress information
|
575
586
|
match = re.search(r'Progress: (\d+)/(\d+), operation_type: ([\w\s]*)(.*)', clean_message)
|
576
|
-
|
587
|
+
|
577
588
|
if match:
|
578
589
|
current_progress = int(match.group(1))
|
579
590
|
total_progress = int(match.group(2))
|
@@ -622,14 +633,18 @@ def process_console_queue():
|
|
622
633
|
|
623
634
|
except Exception as e:
|
624
635
|
print(f"Error parsing progress message: {e}")
|
625
|
-
|
626
|
-
|
636
|
+
#else:
|
637
|
+
# # Only insert messages that do not start with "Progress:"
|
638
|
+
# console_output.insert(tk.END, clean_message + "\n")
|
639
|
+
# console_output.see(tk.END)
|
640
|
+
|
641
|
+
after_id = console_output.after(1, process_console_queue)
|
627
642
|
parent_frame.after_tasks.append(after_id)
|
628
643
|
|
644
|
+
|
629
645
|
def initiate_root(parent, settings_type='mask'):
|
630
646
|
global q, fig_queue, thread_control, parent_frame, scrollable_frame, button_frame, vars_dict, canvas, canvas_widget, button_scrollable_frame, progress_bar
|
631
|
-
from .gui_utils import main_thread_update_function, setup_frame
|
632
|
-
from .gui import gui_app
|
647
|
+
from .gui_utils import main_thread_update_function, setup_frame
|
633
648
|
from .settings import descriptions
|
634
649
|
|
635
650
|
set_start_method('spawn', force=True)
|
@@ -678,4 +693,4 @@ def initiate_root(parent, settings_type='mask'):
|
|
678
693
|
parent_window.after_tasks.append(after_id)
|
679
694
|
|
680
695
|
print("Root initialization complete")
|
681
|
-
return parent_frame, vars_dict
|
696
|
+
return parent_frame, vars_dict
|