eegdash.io.eeglab module#
MNE’s EEGLAB reader, tolerant of two struct layouts real deposits have.
Each fix wraps one helper of mne/io/eeglab/eeglab.py (MNE 1.13, unchanged on
main as of 2026-10-15) and is the diff proposed upstream (upstream/eeglab.md):
A
chanlocsfield empty on every channel comes back from pymatreader as one empty array, not one per channel (on004166:chanlocs.typeand.ref)._dol_to_lodthen raisesIndexErroror, when the empty field happens to come first, returns no channels at all (default namesEEG 000…).Events without a
typefield (on008496: one event,latencyonly) break_read_annotations_eeglab; they get the description"n/a".Events with an empty latency (on004350: a trailing event with every field empty) make
np.array(EEG.event.latency)ragged, and events before the first sample (on004851: latency -1.3e9) make_check_latenciesraise althoughset_annotationshas already cropped them away. Both are dropped with a warning, as EEGLAB’seeg_checksetdrops out-of-range events.
One more fix picks the data file at read time (_check_load_mat). It replaces
EEGDash’s old rewrite of the cached .set (savemat), which made every new
session download the .set again and let a second process read it half
written. When EEG.data names another file than <set stem>.fdt while that
file exists, the own .fdt is read. MNE trusts EEG.data whenever the file
it names exists, and on004348 has 7 *_task-wake_eeg.set that name the same
subject’s *_task-sleep_eeg.fdt. (MNE already falls back to the own .fdt
when the named one is missing.)
- eegdash.io.eeglab.fixes()[source]
Patch MNE’s EEGLAB helpers while reading.
- eegdash.io.eeglab.own_data_file(set_fname, dataname)[source]
Return the
.fdtto read forset_fnamewhoseEEG.dataisdataname.<set stem>.fdtwhen it exists, else the fileEEG.datanames (which may not exist). Adatanamethat is the.setitself (samples stored in the.set) is kept.
- eegdash.io.eeglab.read_raw_eeglab(input_fname, **kwargs)[source]
Read an EEGLAB file with
mne.io.read_raw_eeglab()underfixes().