class eelbrain.pipeline.MneExperiment(root=None, find_subjects=True, **state)

Analyze an MEG or EEG experiment

  • root (str | None) – the root directory for the experiment (usually the directory containing the ‘meg’ and ‘mri’ directories). The experiment can be initialized without the root for testing purposes.

  • find_subjects (bool) – Automatically look for subjects in the MEG-directory (default True). Set find_subjects=False to initialize the experiment without any files.

  • ... – Initial state parameters.


See also

Guide on using The MneExperiment Pipeline.


copy(temp[, dst_root, inclusive, confirm, ...])

Copy files to a different root folder

expand_template(temp[, keep])

Expand all constant variables in a template

find_keys(temp[, root])

Find all terminal field names that are relevant for a template.


Modify event order or timing

format(string[, vmatch])

Format a string (i.e., replace any '{xxx}' fields with their values)

get(temp[, fmatch, vmatch, match, mkdir, make])

Retrieve a formatted template

get_field_values(field[, exclude])

Find values for a field taking into account exclusion

glob(temp[, inclusive])

Find all files matching a certain pattern

iter([fields, exclude, values, progress_bar])

Cycle the experiment's state through all values on the given fields

iter_range([start, stop, field])

Iterate through a range on a field with ordered values.

iter_temp(temp[, exclude, values])

Iterate through all paths conforming to a template given in temp.


Add event labels to events loaded from raw files

label_groups(subject, groups)

Generate Factor for group membership


Label the subjects in ds


Load a parcellation (from an annot file)


Load bad channels


Load the covariance matrix


Load the edf file ("edf-file" template)

load_epochs([subjects, baseline, ndvar, ...])

Load a Dataset with epochs for a given epoch definition

load_epochs_stc([subjects, baseline, ...])

Load a Dataset with stcs for single epochs

load_epochs_stf([subjects, baseline, mask, ...])

Load frequency space single trial data

load_events([subject, add_bads, data_raw])

Load events from a raw file.

load_evoked([subjects, baseline, ndvar, ...])

Load a Dataset with the evoked responses for each subject.

load_evoked_stc([subjects, baseline, ...])

Load evoked source estimates.

load_evoked_stf([subjects, baseline, mask, ...])

Load frequency space evoked data

load_fwd([surf_ori, ndvar, mask])

Load the forward solution


Load the mne-python ICA object

load_induced_stc([subjects, frequencies, ...])

Morlet wavelet induced power and phase in source space.

load_inv([fiff, ndvar, mask])

Load the inverse operator

load_label(label, **kwargs)

Retrieve a label as mne Label object

load_neighbor_correlation([subjects, epoch, ...])

Load sensor neighbor correlation

load_raw([add_bads, preload, ndvar, ...])

Load a raw file as mne Raw object.

load_raw_stc([mask, morph, ndvar, ...])

Load a raw file as mne Raw object.

load_selected_events([subjects, reject, ...])

Load events and return a subset based on epoch and rejection


Load the morph matrix from mrisubject to common_brain

load_src([add_geom, ndvar])

Load the current source space

load_test(test[, tstart, tstop, pmin, parc, ...])

Create and load spatio-temporal cluster test results


Make sure the annot files for both hemispheres exist

make_bad_channels([bad_chs, redo])

Write the bad channel definition file for a raw file

make_bad_channels_auto([flat, redo])

Automatically detect bad channels

make_bad_channels_neighbor_correlation(r[, ...])

Iteratively exclude bad channels based on low average neighbor-correlation

make_copy(temp, field, src, dst[, overwrite])

Make a copy of a file to a new path by substituting one field value


Make a noise covariance (cov) file

make_epoch_selection([samplingrate, data, ...])

Open gui.select_epochs() for manual epoch selection


Make the forward model


Compute ICA decomposition for a pipeline.RawICA preprocessing step

make_ica_selection([epoch, samplingrate, ...])

Select ICA components to remove through a GUI

make_link(temp, field, src, dst[, redo])

Make a hard link

make_mov_ga_dspm([subjects, baseline, ...])

Make a grand average movie from dSPM values (requires PySurfer 0.6)

make_mov_ttest([subjects, model, c1, c0, p, ...])

Make a t-test movie (requires PySurfer 0.6)


Produce the sensor data fiff files needed for MRAT sensor analysis


Produce the STC files needed for the MRAT analysis tool

make_plot_annot([surf, redo])

Create a figure for the contents of an annotation file

make_plot_label(label[, surf, redo])

make_plots_labels([surf, redo])


Make a raw file

make_report(test[, parc, mask, pmin, ...])

Create an HTML report on spatio-temporal clusters


Create HTML report with plots of the MEG/MRI coregistration

make_report_rois(test[, parc, pmin, tstart, ...])

Create an HTML report on ROI time courses


Make the source space


Merge bad channel definitions for different sessions

move(temp[, dst_root, inclusive, confirm, ...])

Move files to a different root folder


Change field to the next value

plot_annot([parc, surf, views, hemi, ...])

Plot the annot file on which the current parcellation is based


Plot the brain model

plot_coregistration([surfaces, meg, dig, ...])

Plot the coregistration (Head shape and MEG helmet)

plot_evoked([subjects, data, separate, ...])

Plot evoked sensor data

plot_label(label[, surf, views, w])

Plot a label

plot_raw([decim, xlim, add_bads, subtract_mean])

Plot raw sensor data

plot_whitened_gfp([s_start, s_stop, run])

Plot the GFP of the whitened evoked to evaluate the the covariance matrix

rename(old, new[, exclude])

Rename all files corresponding to a pattern (or template)

rename_field(temp, field, old, new[, exclude])

Change the value of one field in paths corresponding to a template


Reset all field values to the state at initialization

rm(temp[, inclusive, confirm])

Remove all files corresponding to a template


Run mne_analyze


Run mne_analyze

set([subject, match, allow_asterisk])

Set variable values.

set_inv([ori, snr, method, depth, pick_normal])

Set the type of inverse solution used for source estimation


List bad channels


Generate a table for all iterable fields and ther values.

show_file_status(temp[, col, row, count, ...])

Compile a table about the existence of files

show_file_status_mult(files, fields[, ...])

Compile a table about the existence of multiple files

show_in_finder(temp, **kwargs)

Reveal the file corresponding to the temp template in the Finder.


Print a tree of the files needed as input


Display the selected pipeline for raw processing


Show the covariance matrix regularization parameters

show_rej_info([flagp, asds, bads])

Information about artifact rejection

show_state([temp, empty, hide])

List all top-level fields and their values

show_subjects([raw, mri, mrisubject, ...])

Create a Dataset with subject information

show_tree([root, fields])

Print a tree of the filehierarchy implicit in the templates