cleanup what I just did
This commit is contained in:
+17
-17
@@ -30,13 +30,13 @@ import numpy as np
|
||||
import pandas as pd
|
||||
import psutil
|
||||
|
||||
from src.analysis.a_groupfunctionalconnectivity import GroupFunctionalConnectivityWidget
|
||||
from src.analysis.a_participant import ParticipantViewerWidget
|
||||
from src.analysis.a_participantbrain import ParticipantBrainViewerWidget
|
||||
from src.analysis.a_participantfunctionalconnectivity import ParticipantFunctionalConnectivityWidget
|
||||
from src.shared.s_flaresbasewidget import ParamSection, ParameterInputDialog
|
||||
from src.shared.s_shared import API_URL, API_URL_SECONDARY, APP_NAME, CURRENT_VERSION, PIPELINE_STAGES, PLATFORM_NAME
|
||||
from src.updater import finish_update_if_needed, UpdateManager, LocalPendingUpdateCheckThread
|
||||
from src.analysis.groupfunctionalconnectivity import GroupFunctionalConnectivityWidget
|
||||
from src.analysis.participant import ParticipantViewerWidget
|
||||
from src.analysis.participantbrain import ParticipantBrainViewerWidget
|
||||
from src.analysis.participantfunctionalconnectivity import ParticipantFunctionalConnectivityWidget
|
||||
from src.shared.flaresbasewidget import ParamSection, ParameterInputDialog
|
||||
from src.shared.shareddata import API_URL, API_URL_SECONDARY, APP_NAME, CURRENT_VERSION, PIPELINE_STAGES, PLATFORM_NAME
|
||||
from updater import finish_update_if_needed, UpdateManager, LocalPendingUpdateCheckThread
|
||||
|
||||
from mne.io import read_raw_snirf
|
||||
from mne.preprocessing.nirs import source_detector_distances
|
||||
@@ -54,12 +54,12 @@ from PySide6.QtGui import QAction, QDesktopServices, QKeySequence, QIcon, QIntVa
|
||||
from PySide6.QtSvgWidgets import QSvgWidget # needed to show svgs when app is not frozen
|
||||
from PySide6.QtNetwork import QNetworkAccessManager, QNetworkRequest
|
||||
|
||||
from src.window.w_about import AboutWindow
|
||||
from src.window.w_terminal import TerminalWindow
|
||||
from src.window.w_updateevents import EventUpdateMode, UpdateEventsBlazesWindow, UpdateEventsWindow
|
||||
from src.window.w_updateoptodes import UpdateOptodesWindow
|
||||
from src.window.w_userguide import UserGuideWindow
|
||||
from src.window.w_welcome import WelcomeDialog
|
||||
from src.window.about import AboutWindow
|
||||
from src.window.terminal import TerminalWindow
|
||||
from src.window.updateevents import EventUpdateMode, UpdateEventsBlazesWindow, UpdateEventsWindow
|
||||
from src.window.updateoptodes import UpdateOptodesWindow
|
||||
from src.window.userguide import UserGuideWindow
|
||||
from src.window.welcome import WelcomeDialog
|
||||
|
||||
|
||||
DEFAULT_CONFIG = """
|
||||
@@ -907,7 +907,7 @@ def single_participant_worker(file_path, raw_data, result_queue, progress_queue)
|
||||
""" Runs inside its own dedicated process """
|
||||
p_name = os.path.basename(file_path)
|
||||
try:
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
# Perform the heavy fold_channels logic
|
||||
channel_results = flares.fold_channels(raw_data, p_name, progress_queue)
|
||||
|
||||
@@ -2160,7 +2160,7 @@ class GroupViewerWidget(FlaresBaseWidget):
|
||||
|
||||
|
||||
def show_brain_images(self):
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
|
||||
selected_event = self.event_dropdown.currentText()
|
||||
if selected_event == "<None Selected>":
|
||||
@@ -2518,7 +2518,7 @@ class GroupBrainViewerWidget(FlaresBaseWidget):
|
||||
return file_paths
|
||||
|
||||
def show_brain_images(self):
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
|
||||
selected_event = self.event_dropdown.currentText()
|
||||
if selected_event == "<None Selected>":
|
||||
@@ -4710,7 +4710,7 @@ def run_gui_entry_wrapper(config, gui_queue, progress_queue, ack_queue):
|
||||
"""
|
||||
|
||||
try:
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
flares.gui_entry(config, gui_queue, progress_queue, ack_queue)
|
||||
gui_queue.close()
|
||||
# gui_queue.join_thread()
|
||||
+7
-5
@@ -1,21 +1,23 @@
|
||||
import os
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QGridLayout, QHBoxLayout, QMessageBox, QPushButton, QScrollArea, QWidget, QVBoxLayout, QLabel
|
||||
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QGridLayout, QHBoxLayout, QPushButton, QScrollArea, QWidget, QVBoxLayout, QLabel, QMessageBox
|
||||
from PySide6.QtCore import QSize
|
||||
|
||||
from src.shared.s_flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
from src.shared.flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
|
||||
class GroupFunctionalConnectivityWidget(FlaresBaseWidget):
|
||||
def __init__(self, haemo_dict, group, config_dict):
|
||||
super().__init__("GroupFunctionalConnectivityWidget")
|
||||
self.setWindowTitle("FLARES Group Viewer")
|
||||
self.setWindowTitle(f"{APP_NAME.upper} Group Viewer")
|
||||
self.haemo_dict = haemo_dict
|
||||
self.group = group
|
||||
self.config_dict = config_dict
|
||||
self.show_all_events = True
|
||||
self._updating_checkstates = False
|
||||
|
||||
QMessageBox.warning(self, "Warning - FLARES", f"Functional Connectivity is still in development and the results should currently be taken with a grain of salt. "
|
||||
QMessageBox.warning(self, f"Warning - {APP_NAME.upper}", f"Functional Connectivity is still in development and the results should currently be taken with a grain of salt. "
|
||||
"By clicking OK, you accept that the images generated may not be factual.")
|
||||
|
||||
|
||||
@@ -87,7 +89,7 @@ class GroupFunctionalConnectivityWidget(FlaresBaseWidget):
|
||||
|
||||
|
||||
def show_brain_images(self):
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
|
||||
selected_event = self.event_dropdown.currentText()
|
||||
if selected_event == "<None Selected>":
|
||||
@@ -2,18 +2,19 @@ import os
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from PySide6.QtWidgets import QComboBox, QFrame, QGridLayout, QHBoxLayout, QListView, QMessageBox, QPushButton, QScrollArea, QSpinBox, QWidget, QVBoxLayout, QLabel, QLineEdit
|
||||
from PySide6.QtCore import QThread, Signal, Qt, QTimer, QEvent, QSize, QPoint, QUrl
|
||||
from PySide6.QtGui import QAction, QDesktopServices, QKeySequence, QIcon, QIntValidator, QDoubleValidator, QPixmap, QStandardItemModel, QStandardItem, QImage
|
||||
from PySide6.QtWidgets import QGridLayout, QHBoxLayout, QMessageBox, QPushButton, QScrollArea, QWidget, QVBoxLayout, QLabel
|
||||
from PySide6.QtCore import Qt, QSize
|
||||
from PySide6.QtGui import QPixmap
|
||||
|
||||
from src.shared.s_flaresbasewidget import ClickableLabel, FlaresBaseWidget
|
||||
from src.shared.flaresbasewidget import ClickableLabel, FlaresBaseWidget
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
|
||||
class ParticipantViewerWidget(FlaresBaseWidget):
|
||||
def __init__(self, haemo_dict, fig_bytes_dict):
|
||||
super().__init__("ParticipantViewer")
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
|
||||
self.setWindowTitle("FLARES Participant Viewer")
|
||||
self.setWindowTitle(f"{APP_NAME.upper} Participant Viewer")
|
||||
self.haemo_dict = haemo_dict
|
||||
self.fig_bytes_dict = fig_bytes_dict
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import os
|
||||
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QFrame, QGridLayout, QHBoxLayout, QListView, QMessageBox, QPushButton, QScrollArea, QSpinBox, QWidget, QVBoxLayout, QLabel, QLineEdit
|
||||
from PySide6.QtCore import QThread, Signal, Qt, QTimer, QEvent, QSize, QPoint, QUrl
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QGridLayout, QHBoxLayout, QPushButton, QScrollArea, QWidget, QVBoxLayout, QLabel
|
||||
from PySide6.QtCore import QSize
|
||||
|
||||
from src.shared.s_flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
from src.shared.flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
|
||||
class ParticipantBrainViewerWidget(FlaresBaseWidget):
|
||||
def __init__(self, haemo_dict, cha_dict):
|
||||
super().__init__("ParticipantBrainViewer")
|
||||
self.setWindowTitle("FLARES Participant Brain Viewer")
|
||||
self.setWindowTitle(f"{APP_NAME.upper} Participant Brain Viewer")
|
||||
self.haemo_dict = haemo_dict
|
||||
self.cha_dict = cha_dict
|
||||
|
||||
@@ -67,7 +68,7 @@ class ParticipantBrainViewerWidget(FlaresBaseWidget):
|
||||
|
||||
|
||||
def show_brain_images(self):
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
|
||||
selected_event = self.event_dropdown.currentText()
|
||||
if selected_event == "<None Selected>":
|
||||
+8
-6
@@ -1,18 +1,20 @@
|
||||
import os
|
||||
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QFrame, QGridLayout, QHBoxLayout, QListView, QMessageBox, QPushButton, QScrollArea, QSpinBox, QWidget, QVBoxLayout, QLabel, QLineEdit
|
||||
from PySide6.QtCore import QThread, Signal, Qt, QTimer, QEvent, QSize, QPoint, QUrl
|
||||
from PySide6.QtWidgets import QComboBox, QDialog, QGridLayout, QHBoxLayout, QPushButton, QScrollArea, QWidget, QVBoxLayout, QLabel, QMessageBox
|
||||
from PySide6.QtCore import QSize
|
||||
|
||||
from src.shared.flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
from src.shared.s_flaresbasewidget import FlaresBaseWidget, ParameterInputDialog
|
||||
|
||||
class ParticipantFunctionalConnectivityWidget(FlaresBaseWidget):
|
||||
def __init__(self, haemo_dict, epochs_dict):
|
||||
super().__init__("FunctionalConnectivityWidget")
|
||||
self.setWindowTitle("FLARES Functional Connectivity Viewer [BETA]")
|
||||
self.setWindowTitle(f"{APP_NAME.upper} Functional Connectivity Viewer [BETA]")
|
||||
self.haemo_dict = haemo_dict
|
||||
self.epochs_dict = epochs_dict
|
||||
|
||||
QMessageBox.warning(self, "Warning - FLARES", f"Functional Connectivity is still in development and the results should currently be taken with a grain of salt. "
|
||||
QMessageBox.warning(self, f"Warning - {APP_NAME.upper}", f"Functional Connectivity is still in development and the results should currently be taken with a grain of salt. "
|
||||
"By clicking OK, you accept that the images generated may not be factual.")
|
||||
|
||||
# Create mappings: file_path -> participant label and dropdown display text
|
||||
@@ -69,7 +71,7 @@ class ParticipantFunctionalConnectivityWidget(FlaresBaseWidget):
|
||||
|
||||
|
||||
def show_brain_images(self):
|
||||
import src.flares as flares
|
||||
import flares as flares
|
||||
|
||||
selected_event = self.event_dropdown.currentText()
|
||||
if selected_event == "<None Selected>":
|
||||
@@ -1,9 +1,13 @@
|
||||
import os
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QComboBox, QDialog, QHBoxLayout, QLabel, QLineEdit, QListView, QMessageBox, QPushButton, QVBoxLayout, QWidget
|
||||
from PySide6.QtGui import QStandardItemModel, QStandardItem, QPixmap
|
||||
from PySide6.QtWidgets import QApplication, QComboBox, QDialog, QHBoxLayout, QLabel, QLineEdit, QListView, QMessageBox, QPushButton, QVBoxLayout, QWidget, QFrame, QSpinBox
|
||||
from PySide6.QtGui import QStandardItemModel, QStandardItem, QPixmap, QIntValidator, QDoubleValidator
|
||||
from PySide6.QtCore import QEvent, Qt
|
||||
|
||||
from src.shared.shareddata import APP_NAME
|
||||
from src.shared.flaresbasewidget import FullClickComboBox
|
||||
|
||||
|
||||
class ClickableLabel(QLabel):
|
||||
def __init__(self, full_pixmap: QPixmap, thumbnail_pixmap: QPixmap):
|
||||
super().__init__()
|
||||
@@ -178,14 +182,6 @@ class FullClickComboBox(QComboBox):
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
|
||||
from PySide6.QtWidgets import QComboBox, QFrame, QHBoxLayout, QListView, QMessageBox, QPushButton, QSpinBox, QWidget, QVBoxLayout, QLabel, QLineEdit
|
||||
from PySide6.QtGui import QIntValidator, QDoubleValidator, QStandardItemModel, QStandardItem
|
||||
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from src.shared.s_shared import APP_NAME
|
||||
from src.shared.s_flaresbasewidget import FullClickComboBox
|
||||
|
||||
class ParamSection(QWidget):
|
||||
"""
|
||||
A widget section that dynamically creates labeled input fields from parameter metadata.
|
||||
@@ -1,7 +1,7 @@
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from src.shared.s_shared import APP_NAME, CURRENT_VERSION
|
||||
from src.shared.shareddata import APP_NAME, CURRENT_VERSION
|
||||
|
||||
class AboutWindow(QWidget):
|
||||
"""
|
||||
@@ -1,7 +1,8 @@
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QTextEdit, QLineEdit
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from src.shared.s_shared import APP_NAME, CURRENT_VERSION
|
||||
from src.shared.shareddata import APP_NAME, CURRENT_VERSION
|
||||
|
||||
|
||||
class TerminalWindow(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
@@ -1,22 +1,25 @@
|
||||
import os
|
||||
import json
|
||||
from enum import Enum, auto
|
||||
from datetime import datetime
|
||||
|
||||
import numpy as np
|
||||
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton, QComboBox, QHBoxLayout, QMessageBox, QFileDialog
|
||||
from PySide6.QtCore import Qt
|
||||
from enum import Enum, auto
|
||||
import json
|
||||
import os
|
||||
|
||||
from mne import Annotations
|
||||
from mne.io import read_raw_snirf
|
||||
from mne_nirs.io import write_raw_snirf
|
||||
import numpy as np
|
||||
from datetime import datetime
|
||||
from mne import Annotations
|
||||
|
||||
from src.shared.s_shared import APP_NAME
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
|
||||
class EventUpdateMode(Enum):
|
||||
WRITE_SNIRF = auto() # destructive
|
||||
WRITE_JSON = auto() # non-destructive
|
||||
|
||||
|
||||
|
||||
class UpdateEventsWindow(QWidget):
|
||||
def __init__(self, parent=None, mode=EventUpdateMode.WRITE_SNIRF, caller=None):
|
||||
super().__init__(parent, Qt.WindowType.Window)
|
||||
@@ -1,12 +1,18 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from mne.io import read_raw_snirf
|
||||
from mne_nirs.io import write_raw_snirf
|
||||
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel, QHBoxLayout, QMessageBox, QLineEdit, QPushButton, QFileDialog
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from mne.io import read_raw_snirf
|
||||
from mne_nirs.io import write_raw_snirf
|
||||
|
||||
from src.shared.shareddata import APP_NAME
|
||||
|
||||
|
||||
class UpdateOptodesWindow(QWidget):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@@ -130,7 +136,7 @@ class UpdateOptodesWindow(QWidget):
|
||||
|
||||
def show_help_popup(self, text):
|
||||
msg = QMessageBox(self)
|
||||
msg.setWindowTitle("Parameter Info - FLARES")
|
||||
msg.setWindowTitle(f"Parameter Info - {APP_NAME.upper}")
|
||||
msg.setText(text)
|
||||
msg.exec()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from src.shared.s_shared import APP_NAME, PIPELINE_STAGES
|
||||
from src.shared.shareddata import APP_NAME, PIPELINE_STAGES
|
||||
|
||||
|
||||
class UserGuideWindow(QWidget):
|
||||
@@ -3,7 +3,8 @@ from PySide6.QtGui import QDesktopServices, QIcon
|
||||
from PySide6.QtCore import QUrl
|
||||
from PySide6.QtNetwork import QNetworkAccessManager, QNetworkRequest
|
||||
|
||||
from src.shared.s_shared import APP_NAME, CURRENT_VERSION, resource_path
|
||||
from src.shared.shareddata import APP_NAME, CURRENT_VERSION, resource_path
|
||||
|
||||
|
||||
class WelcomeDialog(QDialog):
|
||||
def __init__(self, parent=None, direct=True):
|
||||
Reference in New Issue
Block a user