Migrating from other analysis software¶
Here we offer some tips on how to migrate from other analysis software.
EEGLAB¶
To read in data exported from EEGLAB, MNE-Python includes an .edf
reader mne.io.read_raw_edf()
and a set
file reader. To read in
set
files containing raw
data, use mne.io.read_raw_eeglab()
and
to read in set
files containing epochs
data, use
mne.read_epochs_eeglab()
.
This table summarizes equivalent EEGLAB and MNE-Python code for some of the
most common analysis tasks. For the sake of clarity, the table below assumes
the following variables exist: the file name fname
, time interval of the
epochs tmin
and tmax
, and the experimental conditions cond1
and
cond2
. The variables l_freq
and h_freq
are the frequencies (in Hz)
below which and above which to filter out data.
Processing step |
EEGLAB function |
MNE-Python |
---|---|---|
Get started |
addpath(...); eeglab; |
|
Import data |
|
|
Filter data |
|
|
Run ICA |
|
|
Epoch data |
event_id = {'cond1', 'cond2'}; Epochs = pop_epochs(EEG, event_id, [tmin, tmax]); |
|
Selecting epochs |
|
|
ERP butterfly plot |
|
|
Contrast ERPs |
|
|
Save data |
|
Potential pitfalls¶
Many of the MNE-Python objects have methods that operate in-place to save memory (i.e., the data in the
Raw
object is changed when you callraw.filter(lfreq, hfreq)
). If you do not want this, it is always possible to first call the object’scopy()
method (e.g.,filtered_raw = raw.copy().filter(lfreq, hfreq)
). In addition, some MNE-Python functions have a booleancopy
parameter that achieves the same purpose.The concept of channel types is critical in MNE because it supports analysis of multimodal data (e.g., EEG, MEG, EOG, Stim channel, etc) whereas most EEGLAB functions assume all channels are of the same type (EEG). To restrict channels to a single type, see
mne.pick_types()
,raw.pick_types
,epochs.pick_types
,evoked.pick_types
, etc.