EEGLAB Migration Notes#
EEGPrep is a Python port, not a MATLAB compatibility layer. Use these notes when translating EEGLAB habits into EEGPrep scripts and GUI workflows.
What Carries Over#
EEGLAB habit |
EEGPrep equivalent |
|---|---|
|
Same public names, Python arguments, and replayable command strings. |
|
Same workspace names inside |
GUI menu action then command history |
GUI actions update |
|
Same dictionary field names. |
Bundled plugins |
clean_rawdata, FIRFilt, ICLabel, DIPFIT, and EEG-BIDS are in-package Python ports or explicit standalone boundaries. |
STUDY |
Implemented as EEGPrep-owned dictionaries and JSON-safe measure caches. |
What Changes#
Topic |
Migration rule |
|---|---|
Arrays |
Use Python/NumPy zero-based indexing when slicing data. |
User-facing selectors |
Keep channel, component, dataset, and epoch numbers one-based in GUI dialogs and command strings unless a function documents otherwise. |
Globals |
EEGPrep functions take explicit inputs. The shared console namespace is session state, not a hidden global dependency. |
Runtime EEGLAB checkout |
Installed EEGPrep does not read from |
Optional toolboxes |
MATLAB-only LIMO, FieldTrip STUDY source statistics, MRI BEM creation, AFNI atlas clipping, and unavailable ICLabel network artifacts fail clearly instead of being faked. |
Scripts |
Assign return values explicitly outside |
Command Translation Examples#
Migration intent |
EEGPrep Python |
|---|---|
Load a dataset |
|
Filter |
|
Resample |
|
Average reference |
|
Epoch |
|
Run ICA |
|
Classify ICs |
|
Create a STUDY |
|
History Replay#
In MATLAB EEGLAB, menu commands appear in the MATLAB command window. In
EEGPrep, use LASTCOM and ALLCOM:
EEG, LASTCOM = pop_resample(EEG, 64, return_com=True)
ALLCOM.append(LASTCOM)
Inside eegprep-console, a bare call can update the current dataset:
pop_resample(EEG, 64)
In normal Python, assign the return value:
EEG = pop_resample(EEG, 64)
Indexing Boundaries#
EEGPrep intentionally keeps both conventions visible:
Python arrays are zero-based:
EEG["data"][0, :]is the first channel.GUI channel/component/dataset selectors are one-based.
abspeak,matcorr,mapcorr,matperm,hungarian,getchanlist,shuffle, andeeg_amplitudeareause 1-based indices, includingshuffle’s dimension. Subtract 1 before indexing a NumPy array.Event
latencyfields are sample positions in the EEGLAB-facing event model.icachansindis normalized after loading so internal indexing is consistent, then converted back when saving.
MATLAB Structure Transport#
When passing lists of dictionaries through the MATLAB bridge, numeric and text
values in the same field retain their individual types regardless of record
order. For example, 42.0 remains a MATLAB double when another record holds
"boundary"; it does not become "42.0". EEGLAB’s eeg_checkset may
subsequently normalize mixed event types to strings as part of event validation.
Known Differences from EEGLAB#
These are intentional. EEGPrep does not reproduce the EEGLAB result.
Topic |
What EEGPrep does |
|---|---|
BIDS TSV bytes |
TSV sidecars are decoded as UTF-8, and a leading UTF-8 BOM is removed.
A file that is not valid UTF-8 is decoded as Latin-1, so |
BIDS JSON bytes |
JSON sidecars must be UTF-8. A leading UTF-8 BOM is removed and the
file is accepted. Bytes that are not UTF-8 raise
|
STUDY |
EEGLAB calls |
STUDY clustering dialog |
EEGLAB’s dialog calls |
ASR calibration on a short recording |
|
ASR on a very short recording |
With calibration reference selection off, |
One ASR calibration window |
|
ASR at a low sampling rate |
|
NaNs during re-referencing |
|
BDF |
|
BDF |
|
BDF window shorter than the channel count |
|
BDF trigger codes |
|
BioSemi Status channel |
|
BDF event modes 3 and 5 |
|
EGI |
|
EGI |
|
Epoched event sort |
|
Continuous rejection with |
|
Numeric boundary types |
Consecutive equal-latency boundaries are merged whether |
Plugin Migration#
Bundled plugins are importable from eegprep:
from eegprep import pop_clean_rawdata, pop_eegfiltnew, pop_iclabel, pop_dipfit_settings
External EEGLAB MATLAB plugins are not loaded by path. EEGPrep extensions are
normal Python packages discovered through the eegprep.extensions entry
point. See Bundled Plugins and Extensions and External Extensions for the package format.
When to Stay in MNE or MATLAB#
Use MNE-Python when your analysis depends on MNE-native object workflows, forward models, reports, or statistics. Use MATLAB EEGLAB when you need an unported MATLAB-only plugin or toolbox today. Use EEGPrep when you want familiar preprocessing and review workflows in Python with standalone package behavior.