.. tags:: help, migrating, interoperability
Here we offer some tips on how to migrate from other analysis software.
To read in data exported from EEGLAB, MNE-Python includes an :file:`.edf`
reader :func:`mne.io.read_raw_edf` and a set file reader. To read in
set files containing raw data, use :func:`mne.io.read_raw_eeglab` and
to read in set files containing epochs data, use
:func:`mne.read_epochs_eeglab`.
This table summarizes the 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.
.. cssclass:: table-bordered
.. rst-class:: midvalign
| Processing step | EEGLAB function | MNE-Python |
|---|---|---|
| Get started | addpath(...);eeglab; |
|
| Import data | EEG = pop_fileio(fname); |
|
| Filter data | EEG = pop_eegfiltnew(EEG, l_freq, h_freq); |
|
| Common Average referencing | EEG= pop_averef; |
|
| Remove channels | pop_select.m |
|
| Run ICA | EEG = pop_runica(EEG, 'pca', n);EEG = pop_binica(EEG, 'pca', n); |
|
| Plot ICA properties | pop_compprop( EEG, comp_num, winhandle); |
|
| Plot ICA components | compheads() |
|
| Exclude components | pop_selectcomps() |
ica.exclude = list_of_components_to_exclude |
| Epoch data | event_id = {'cond1', 'cond2'};Epochs = pop_epochs(EEG, event_id, [tmin, tmax]); |
|
| Selecting epochs | Epochs = pop_epochs(EEG_epochs, {cond2}); |
|
| ERP butterfly plot | pop_timtopo(EEG_epochs, ...); |
|
| Contrast ERPs | pop_compareerps(EEG_epochs1, EEG_epochs2); |
|
| Save data | EEG = pop_saveset(EEG, fname); |
- Many of the MNE-Python objects have methods that operate in-place to save
memory (i.e., the data in the :class:`~mne.io.Raw` object is changed when you
call :meth:`raw.filter(lfreq, hfreq) <mne.io.Raw.filter>`). If you do not
want this, it is always possible to first call the object's
:meth:`~mne.io.Raw.copy` method (e.g.,
filtered_raw = raw.copy().filter(lfreq, hfreq)). In addition, some MNE-Python functions have a booleancopyparameter 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 :func:`mne.pick_types`, :meth:`raw.pick() <mne.io.Raw.pick>`, :meth:`epochs.pick() <mne.Epochs.pick>` and :meth:`evoked.pick() <mne.Evoked.pick>`.