Thanks, @richard ! Iβve modified my script to rename the channels when creating the bids data structure and they are showing as being correctly names in the *channels.tsv. But when I run the pipeline I get the following error message:
(mne) PS C:\> mne_bids_pipeline 'C:\Users\jmarti2\OneDrive - University of Edinburgh\wellcome\scripts\02_mne_bids_config_new.py'
ββββββββββ¬ Welcome aboard MNE-BIDS-Pipeline! π ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β¦09:11:46Β¦ π Using configuration: C:\Users\jmarti2\OneDrive - University of Edinburgh\wellcome\scripts\02_mne_bids_config_new.py
ββββββββββ΄
ββββββββββ¬ init/_01_init_derivatives_dir βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β¦09:11:46Β¦ β³οΈ Initializing output directories.
ββββββββββ΄ done (1s)
ββββββββββ¬ init/_02_find_empty_room ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β¦09:11:46Β¦ β© Skipping, empty-room data only relevant for MEG β¦
ββββββββββ΄ done (1s)
ββββββββββ¬ preprocessing/_01_data_quality ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β¦09:11:50Β¦ β³οΈ sub-1014 Reading experimental recording: sub-1014_task-vep
Β¦09:11:54Β¦ β³οΈ sub-1014 Setting EEG channel locations to template montage: biosemi64.
Β¦09:11:54Β¦ β sub-1014 A critical error occurred. The error message was: DigMontage is only a subset of info. There are 8 channel positions not present in the DigMontage. The channels missing from the montage are:
['EXG1', 'EXG2', 'EXG3', 'EXG4', 'EXG5', 'EXG6', 'EXG7', 'EXG8'].
Consider using inst.rename_channels to match the montage nomenclature, or inst.set_channel_types if these are not EEG channels, or use the on_missing parameter if the channel positions are allowed to be unknown in your analyses.
Aborting pipeline run. The traceback is:
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne_bids_pipeline\steps\preprocessing\_01_data_quality.py", line 98, in assess_data_quality
raw = import_experimental_data(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne_bids_pipeline\_import_data.py", line 384, in import_experimental_data
_set_eeg_montage(cfg=cfg, raw=raw, subject=subject, session=session, run=run)
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne_bids_pipeline\_import_data.py", line 332, in _set_eeg_montage
raw.set_montage(montage, match_case=False, match_alias=True)
File "<decorator-gen-22>", line 12, in set_montage
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne\_fiff\meas_info.py", line 428, in set_montage
_set_montage(info, montage, match_case, match_alias, on_missing)
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne\channels\montage.py", line 1273, in _set_montage
_on_missing(on_missing, missing_coord_msg)
File "C:\Users\jmarti2\AppData\Local\anaconda3\envs\mne\Lib\site-packages\mne\utils\check.py", line 1218, in _on_missing
raise error_klass(msg)
Here is my config.py:
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 15:01:44 2024
@author: jmarti2
MNE-BIDS-Pipeline configuration file for analysing VEP and SSVEP data for the
HELIOS-BD project. Check the documentation online for further options and more
detailed explanations of the configuration parameters.
"""
import mne
##############################################################
# Set these values appropriately before running the pipeline
subjects = ['1014']
task = 'vep'
##############################################################
# Sets the appropriate output directories
bids_root = fr"C:\helios_bids_{task}"
deriv_root = fr"C:\helios_bids_{task}\derivatives\mne-bids-pipeline-{task}"
subjects_dir = None
# Use to exclude subjects
exclude_subjects = []
ch_types = ["eeg"]
data_type = "eeg"
eeg_reference = "average" # EEG reference to use
#montage = mne.channels.read_dig_fif(r"C:\Users\jmarti2\OneDrive - University of Edinburgh\wellcome\scripts\combined_montage.fif")
eeg_template_montage = (
"biosemi64" # Apply 64-channel Biosemi 10/20 template montage:
)
eog_channels = ['HEOG-left','HEOG-right','VEOG-upper','VEOG-lower']
analyze_channels = "ch_types"
plot_psd_for_runs = "all" # For which runs to add a power spectral density (PSD) plot to the generated report.
random_state = (
42 # Passed to ICA and decoding algos to ensure reproduicibility
)
# Break detection
find_breaks = (
True # Automatically find break periods, and annotate them as BAD_break.
)
min_break_duration = 15.0
t_break_annot_start_after_previous_event = 5.0
t_break_annot_stop_before_next_event = 5.0
# Filtering
l_freq = 0.1 # The low-frequency cut-off in the highpass filtering step.
h_freq = 40.0 # The high-frequency cut-off in the highpass filtering step.
notch_freq = (50) # Notch filter frequency. More than one frequency can be supplied
epochs_decim = 4 # Decimate epochs to 256 Hz
conditions = [
"Lum",
"LM",
"S",
"Lum/1",
"Lum/2",
"Lum/3",
"Lum/4",
"LM/1",
"LM/2",
"LM/3",
"LM/4",
"S/1",
"S/2",
"S/3",
"S/4",
]
# Set the task specific parameters
if task == 'vep':
epochs_tmin = -0.2 # The beginning of an epoch, relative to the respective event, in seconds.
epochs_tmax = 0.8 # The end of an epoch, relative to the respective event, in seconds.
elif task == 'ssvep':
epochs_tmin = -0.2
epochs_tmax = 2.5
else:
raise RuntimeError(f"Task {task} not currently supported")
baseline = (-0.1, 0) # Beginning of epoch until time point zero
# Artifact removal
spatial_filter = "ica" # Use ica
ica_reject = "autoreject_local" # Find local (per channel) thresholds and repair epochs before fitting ICA
ica_algorithm = "picard-extended_infomax"
ica_l_freq = 1.0
ica_max_iterations = 500
ica_n_components = 64 - 1
ica_decim = None
reject = "autoreject_local" # Before and after ICA recommended
# Sensor level analysis
contrasts = [("Lum", "S"), ("Lum", "LM"), ("LM", "S")]
if task == 'vep':
decode = True
decoding_time_generalization = True # ?
decoding_time_generalization_decim = 1
elif task =='ssvep':
decode = False
else:
raise RuntimeError(f"Task {task} not currently supported")
# No source estimation
run_source_estimation = False
# Execution
n_jobs = 4
Any ideas what is causing this?