changes to macos misbehaving
This commit is contained in:
15
main.py
15
main.py
@@ -23,8 +23,10 @@ from datetime import datetime
|
|||||||
from multiprocessing import Process, current_process, freeze_support, Manager
|
from multiprocessing import Process, current_process, freeze_support, Manager
|
||||||
|
|
||||||
# External library imports
|
# External library imports
|
||||||
|
import mne
|
||||||
import psutil
|
import psutil
|
||||||
import requests
|
import requests
|
||||||
|
from mne.preprocessing.nirs import source_detector_distances
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QApplication, QWidget, QMessageBox, QVBoxLayout, QHBoxLayout, QTextEdit, QScrollArea, QComboBox, QGridLayout,
|
QApplication, QWidget, QMessageBox, QVBoxLayout, QHBoxLayout, QTextEdit, QScrollArea, QComboBox, QGridLayout,
|
||||||
QPushButton, QMainWindow, QFileDialog, QLabel, QLineEdit, QFrame, QSizePolicy, QGroupBox
|
QPushButton, QMainWindow, QFileDialog, QLabel, QLineEdit, QFrame, QSizePolicy, QGroupBox
|
||||||
@@ -1172,7 +1174,7 @@ class MainApplication(QMainWindow):
|
|||||||
Full Path: {file_path}
|
Full Path: {file_path}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if "Error" in snirf_info:
|
if snirf_info is None:
|
||||||
info += f"\nSNIRF Metadata could not be loaded: {snirf_info['Error']}"
|
info += f"\nSNIRF Metadata could not be loaded: {snirf_info['Error']}"
|
||||||
else:
|
else:
|
||||||
info += "\nSNIRF Metadata:\n"
|
info += "\nSNIRF Metadata:\n"
|
||||||
@@ -1544,9 +1546,14 @@ class MainApplication(QMainWindow):
|
|||||||
return (normalize(v1) > normalize(v2)) - (normalize(v1) < normalize(v2))
|
return (normalize(v1) > normalize(v2)) - (normalize(v1) < normalize(v2))
|
||||||
|
|
||||||
def get_snirf_metadata_mne(self, file_name):
|
def get_snirf_metadata_mne(self, file_name):
|
||||||
import mne
|
|
||||||
from mne.preprocessing.nirs import source_detector_distances
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import h5py
|
||||||
|
print("h5py version:", h5py.__version__)
|
||||||
|
except Exception as e:
|
||||||
|
print("Failed to import h5py:", e)
|
||||||
|
|
||||||
|
try:
|
||||||
raw = mne.io.read_raw_snirf(file_name, preload=True)
|
raw = mne.io.read_raw_snirf(file_name, preload=True)
|
||||||
|
|
||||||
snirf_info = {}
|
snirf_info = {}
|
||||||
@@ -1575,6 +1582,8 @@ class MainApplication(QMainWindow):
|
|||||||
snirf_info['Digitization Points'] = "Not found"
|
snirf_info['Digitization Points'] = "Not found"
|
||||||
|
|
||||||
return snirf_info
|
return snirf_info
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
|
|||||||
Reference in New Issue
Block a user