further variable changes

This commit is contained in:
2026-01-23 11:25:01 -08:00
parent 9779a63a9c
commit 1b78f1904d
3 changed files with 239 additions and 107 deletions

View File

@@ -90,7 +90,7 @@ from mne_nirs.io.fold import fold_channel_specificity # type: ignore
from mne_nirs.preprocessing import peak_power # type: ignore
from mne_nirs.statistics._glm_level_first import RegressionResults # type: ignore
# Needs to be set for men
# Needs to be set for mne
os.environ["SUBJECTS_DIR"] = str(data_path()) + "/subjects" # type: ignore
# TODO: Tidy this up
@@ -167,6 +167,8 @@ H_FREQ: float
L_TRANS_BANDWIDTH: float
H_TRANS_BANDWIDTH: float
RESAMPLE: bool
RESAMPLE_FREQ: int
STIM_DUR: float
HRF_MODEL: str
DRIFT_MODEL: str
@@ -184,8 +186,8 @@ N_JOBS: int
TIME_WINDOW_START: int
TIME_WINDOW_END: int
VERBOSITY = True
MAX_WORKERS: int
VERBOSITY: bool
AGE = 25 # Assume 25 if not set from the GUI. This will result in a reasonable PPF
GENDER = ""
@@ -1252,7 +1254,7 @@ def epochs_calculations(raw_haemo, events, event_dict):
continue
data = evoked.data[picks_idx, :].mean(axis=0)
t_start, t_end = 0, 15
t_start, t_end = 0, 15 #TODO: Is this in seconds? or is it 1hz input that makes it 15s?
times_mask = (evoked.times >= t_start) & (evoked.times <= t_end)
data_segment = data[times_mask]
times_segment = evoked.times[times_mask]
@@ -1314,11 +1316,16 @@ def make_design_matrix(raw_haemo, short_chans):
# Set the new annotations
raw_haemo.set_annotations(new_annot)
raw_haemo.resample(1, npad="auto")
raw_haemo._data = raw_haemo._data * 1e6
if RESAMPLE:
raw_haemo.resample(RESAMPLE_FREQ, npad="auto")
raw_haemo._data = raw_haemo._data * 1e6
try:
short_chans.resample(RESAMPLE_FREQ)
except:
pass
# 2) Create design matrix
if SHORT_CHANNEL:
short_chans.resample(1)
if SHORT_CHANNEL_REGRESSION:
design_matrix = make_first_level_design_matrix(
raw=raw_haemo,
stim_dur=STIM_DUR,