I’m encountering an issue while trying to load an EEGLAB .set
file using mne.io.read_raw_eeglab
. Here’s the relevant code snippet:
import mne
file_path = "s01_061102n.set"
raw = mne.io.read_raw_eeglab(file_path, preload=True)
When I run this, I receive the following error:
Traceback (most recent call last):
File "main.py", line 8, in <module>
raw = mne.io.read_raw_eeglab(file_path, preload=True)
File "...\site-packages\mne\io\eeglab\eeglab.py", line 328, in read_raw_eeglab
return RawEEGLAB(
File "<decorator-gen-267>", line 12, in __init__
File "...\site-packages\mne\io\eeglab\eeglab.py", line 459, in __init__
info, eeg_montage, _ = _get_info(eeg, eog=eog, montage_units=montage_units)
File "...\site-packages\mne\io\eeglab\eeglab.py", line 230, in _get_info
ch_names, ch_types, eeg_montage = _get_montage_information(
File "...\site-packages\mne\io\eeglab\eeglab.py", line 165, in _get_montage_information
if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo["nodatchans"], dict):
KeyError: 'nodatchans'
Process finished with exit code 1
The error seems to be caused by the absence of the chaninfo["nodatchans"]
key in the data structure. May I know if there is a way to bypass or handle the missing chaninfo["nodatchans"]
key to successfully load the file?
The dataset I’m working with includes EEG signals obtained using the Scan SynAmps2 Express system (Compumedics Ltd., VIC, Australia). The signals were recorded using a wired EEG cap with 32 Ag/AgCl electrodes, including 30 EEG electrodes and 2 reference electrodes (opposite lateral mastoids). These details are provided in the dataset’s README file.
The specific file used in this example can be downloaded here: figshare.