fixes before release

This commit is contained in:
2026-08-10 16:47:32 -07:00
parent 074a0681b9
commit 1e7fca49f2
6 changed files with 35 additions and 21 deletions
+5 -3
View File
@@ -5,7 +5,7 @@
- Optimized calculations being performed when calculating the Heart Rate to speed up step 5 by up to ~35% on a per-file basis - Optimized calculations being performed when calculating the Heart Rate to speed up step 5 by up to ~35% on a per-file basis
- Optimized calculations being performed when running the General Linear Model to speed up step 5 by up to ~35% on a per-file basis - Optimized calculations being performed when running the General Linear Model to speed up step 5 by up to ~35% on a per-file basis
- The Group Stats Viewer windows will now properly load the Right/Left or Front/Back fallback ROIs if JSON_LOCATION is not set - The Group Stats Viewer windows will now properly load the Right/Left or Front/Back fallback ROIs if JSON_LOCATION is not set
- Changed the warning message for lots of short channels to be percentage based (25%) instead of numerical based (6) - Changed the warning message for lots of short channels and changed when it shows to be percentage based (35%) instead of numerical based (6)
- Renames GENDER to SEX to better represent the values that the field expects and to be more BIDS compliant - Renames GENDER to SEX to better represent the values that the field expects and to be more BIDS compliant
- Changed the Assign Groups by AGE window to now be the Assign Groups by Metadata window and added support for grouping by other metadata values - Changed the Assign Groups by AGE window to now be the Assign Groups by Metadata window and added support for grouping by other metadata values
- Added a new metadata value of HAND to allow for grouping participants based on their handiness - Added a new metadata value of HAND to allow for grouping participants based on their handiness
@@ -24,8 +24,10 @@
- Fixed an issue where when loading a save file some list dropdowns could go blue and bold even if the value was default - Fixed an issue where when loading a save file some list dropdowns could go blue and bold even if the value was default
- Fixed an issue where the Analysis button would not be clickable if the user had previously pushed Clear. Fixes [Issue 83](https://git.research.dezeeuw.ca/tyler/flares/issues/83) - Fixed an issue where the Analysis button would not be clickable if the user had previously pushed Clear. Fixes [Issue 83](https://git.research.dezeeuw.ca/tyler/flares/issues/83)
- Fixed an issue where some popup windows would not properly display the application name when they would open - Fixed an issue where some popup windows would not properly display the application name when they would open
- Fixed instances of the word MacOS to now read macOS to match Apple branding - Fixed an issue where the welcome dialog image would not display correctly on macOS
- Fixed welcom dialog application image not displaying correctly on macOS - Fixed an issue where the Linux version would fail at 0 seconds when attempting to process files
- Fixed an issue where fOLDing channels could cause the same channels to be repeated misaligning the labels
- Fixed all instances of the word MacOS to now read macOS to match Apple branding
# Version 1.5.2 # Version 1.5.2
+9 -2
View File
@@ -1840,7 +1840,8 @@ def fold_channels(raw: BaseRaw, p_name: str, atlas: str='Brodmann', progress_que
channel_results = {} channel_results = {}
step_idx = 0 step_idx = 0
for cidx, channel_name in enumerate(hbo_channel_names): for channel_name in hbo_channel_names:
cidx = raw.ch_names.index(channel_name)
tbl = _source_detector_fold_table( tbl = _source_detector_fold_table(
raw, cidx, reference_locations, fold_tbl, interpolate=True raw, cidx, reference_locations, fold_tbl, interpolate=True
) )
@@ -2179,8 +2180,14 @@ def brain_3d_visualization(
def brain_landmarks_3d(raw_haemo: BaseRaw, show_optodes: Literal['sensors', 'labels', 'none', 'all'] = 'all', show_brodmann: bool = True) -> None: def brain_landmarks_3d(raw_haemo: BaseRaw, show_optodes: Literal['sensors', 'labels', 'none', 'all'] = 'all', show_brodmann: bool = True, subjects_dir = None) -> None:
if subjects_dir is None:
subjects_dir = os.environ.get("SUBJECTS_DIR")
if subjects_dir is None:
subjects_dir = str(data_path()) + "/subjects" # type: ignore
os.environ["SUBJECTS_DIR"] = subjects_dir
brain = Brain("fsaverage", background="white", size=(800, 700)) # type: ignore brain = Brain("fsaverage", background="white", size=(800, 700)) # type: ignore
distances = source_detector_distances(raw_haemo.info) distances = source_detector_distances(raw_haemo.info)
+17 -12
View File
@@ -19,7 +19,7 @@ from queue import Empty
from copy import deepcopy from copy import deepcopy
from pathlib import Path from pathlib import Path
from datetime import datetime from datetime import datetime
from multiprocessing import Process, current_process, freeze_support, Queue from multiprocessing import Process, current_process, freeze_support, Queue, set_start_method
# External library imports # External library imports
import psutil import psutil
@@ -2038,7 +2038,7 @@ class MainApplication(QMainWindow):
msgbox.setWindowTitle(f"Warning - {APP_NAME.upper()}") msgbox.setWindowTitle(f"Warning - {APP_NAME.upper()}")
message = ( message = (
f"{APP_NAME.upper} has encountered an error processing the file {title}.<br><br>" f"{APP_NAME.upper()} has encountered an error processing the file {title}.<br><br>"
"This error was likely due to incorrect parameters on the right side of the screen and not an error with your data. " "This error was likely due to incorrect parameters on the right side of the screen and not an error with your data. "
"Processing of the remaining files continues in the background and this participant will be ignored in the analysis. " "Processing of the remaining files continues in the background and this participant will be ignored in the analysis. "
f"If you think the parameters on the right side are correct for your data, raise an issue <a href='https://git.research.dezeeuw.ca/tyler/{APP_NAME}/issues'>here</a>.<br><br>" f"If you think the parameters on the right side are correct for your data, raise an issue <a href='https://git.research.dezeeuw.ca/tyler/{APP_NAME}/issues'>here</a>.<br><br>"
@@ -2449,8 +2449,9 @@ def exception_hook(exc_type, exc_value, exc_traceback):
show_critical_error(error_msg) show_critical_error(error_msg)
# Exit the app after user acknowledges # Exit the app after user acknowledges
sys.exit(1) if getattr(sys, 'frozen', False):
sys.exit(1)
def show_critical_error(error_msg): def show_critical_error(error_msg):
msg_box = QMessageBox() msg_box = QMessageBox()
@@ -2459,22 +2460,25 @@ def show_critical_error(error_msg):
if PLATFORM_NAME == "darwin": if PLATFORM_NAME == "darwin":
log_path = os.path.join(os.path.dirname(sys.executable), "../../../flares.log") log_path = os.path.join(os.path.dirname(sys.executable), "../../../flares.log")
log_path2 = os.path.join(os.path.dirname(sys.executable), "../../../flares_error.log") error_path = os.path.join(os.path.dirname(sys.executable), "../../../flares_error.log")
save_path = os.path.join(os.path.dirname(sys.executable), "../../../flares_autosave.flare") save_path = os.path.join(os.path.dirname(sys.executable), "../../../flares_autosave.flare")
else: else:
log_path = os.path.join(os.getcwd(), "flares.log") log_path = os.path.join(os.getcwd(), "flares.log")
log_path2 = os.path.join(os.getcwd(), "flares_error.log") error_path = os.path.join(os.getcwd(), "flares_error.log")
save_path = os.path.join(os.getcwd(), "flares_autosave.flare") save_path = os.path.join(os.getcwd(), "flares_autosave.flare")
shutil.copy(log_path, log_path2) shutil.copy(log_path, error_path)
log_path2 = Path(log_path2).absolute().as_posix() error_path = Path(error_path).absolute().as_posix()
autosave_path = Path(save_path).absolute().as_posix() autosave_path = Path(save_path).absolute().as_posix()
log_link = f"file:///{log_path2}" error_link = f"file:///{error_path}"
autosave_link = f"file:///{autosave_path}" autosave_link = f"file:///{autosave_path}"
window.save_project(True) #TODO: If the window is the one to crash, the file can't get saved. Could be fine as the window is what was storing the data to begin with? try:
window.project_manager.save_project(True)
except:
pass
message = ( message = (
f"{APP_NAME.upper()} has encountered an unrecoverable error and needs to close.<br><br>" f"{APP_NAME.upper()} has encountered an unrecoverable error and needs to close.<br><br>"
@@ -2482,7 +2486,7 @@ def show_critical_error(error_msg):
"If the file was saved, it still may not be intact, openable, or contain the correct data. Use the autosave at your own discretion.<br><br>" "If the file was saved, it still may not be intact, openable, or contain the correct data. Use the autosave at your own discretion.<br><br>"
f"This unrecoverable error was due to an error with {APP_NAME.upper()} and not your data.<br>" f"This unrecoverable error was due to an error with {APP_NAME.upper()} and not your data.<br>"
f"If this crash occured inside a [BETA] branch, it is likely to eventually be fixed.<br>" f"If this crash occured inside a [BETA] branch, it is likely to eventually be fixed.<br>"
f"Please raise an issue <a href='https://git.research.dezeeuw.ca/tyler/{APP_NAME}/issues'>here</a> and attach the error file located at <a href='{log_link}'>{log_path2}</a><br><br>" f"Please raise an issue <a href='https://git.research.dezeeuw.ca/tyler/{APP_NAME}/issues'>here</a> and attach the error file located at <a href='{error_link}'>{error_path}</a><br><br>"
f"<pre>{error_msg}</pre>" f"<pre>{error_msg}</pre>"
) )
@@ -2583,6 +2587,7 @@ if __name__ == "__main__":
config_init() config_init()
freeze_support() # Required for PyInstaller + multiprocessing freeze_support() # Required for PyInstaller + multiprocessing
set_start_method('spawn', force=True)
# Only run GUI in the main process # Only run GUI in the main process
if current_process().name == 'MainProcess': if current_process().name == 'MainProcess':
+2 -2
View File
@@ -776,8 +776,8 @@ def extract_metadata_worker(file_name):
snirf_info['Short Channels'] = f"Likely - {names}" snirf_info['Short Channels'] = f"Likely - {names}"
total_chans = len(raw.ch_names) total_chans = len(raw.ch_names)
pct_short = (len(names) / total_chans * 100) if total_chans else 0 pct_short = (len(names) / total_chans * 100) if total_chans else 0
if pct_short > 25: if pct_short > 35:
snirf_info['Short Channels'] += "\n There are a lot of short channels. Optode distances are likely incorrect!" snirf_info['Short Channels'] += "\n There are a lot of short channels. Perhaps the optode distances are incorrect?"
except: except:
snirf_info['Short Channels'] = "Unlikely" snirf_info['Short Channels'] = "Unlikely"
+1 -1
View File
@@ -99,7 +99,7 @@ class InterGroupBrainImageWidget(InterGroupUIMixin, FlaresBaseWidget):
self.df_ind_dict = df_ind_dict self.df_ind_dict = df_ind_dict
self.design_matrix_dict = design_matrix_dict self.design_matrix_dict = design_matrix_dict
self.contrast_results_dict = contrast_results_dict self.contrast_results_dict = contrast_results_dict
# self.group_dict = group_dict self.group_dict = group_dict
self.setup_inter_group_ui(["0 (GLM Results)", "1 (Significance)", "2 (Brain Activity Visualization)",]) self.setup_inter_group_ui(["0 (GLM Results)", "1 (Significance)", "2 (Brain Activity Visualization)",])
+1 -1
View File
@@ -50,7 +50,7 @@ class ClickableLabel(QLabel):
def mousePressEvent(self, event): def mousePressEvent(self, event):
viewer = QWidget() viewer = QWidget()
viewer.setWindowTitle(f"Expanded View" - {APP_NAME.upper()}) viewer.setWindowTitle(f"Expanded View - {APP_NAME.upper()}")
layout = QVBoxLayout(viewer) layout = QVBoxLayout(viewer)
label = QLabel() label = QLabel()
label.setPixmap(self._pixmap_full) label.setPixmap(self._pixmap_full)