eelbrain.pipeline.MneExperiment

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

Analyze an MEG or EEG experiment

Parameters
  • 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.

Notes

See also

Guide on using The MneExperiment Pipeline.

Methods

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.

fix_events(ds)

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.

label_events(ds)

Add event labels to events loaded from raw files

label_groups(subject, groups)

Generate Factor for group membership

label_subjects(ds)

Label the subjects in ds

load_annot(**state)

Load a parcellation (from an annot file)

load_bad_channels(**kwargs)

Load bad channels

load_cov(**kwargs)

Load the covariance matrix

load_edf(**kwargs)

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_ica(**state)

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_morph_matrix(**state)

Load the morph matrix from mrisubject to common_brain

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_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_annot(**state)

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[, …])

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_cov()

Make a noise covariance (cov) file

make_epoch_selection([samplingrate, data, …])

Open gui.select_epochs() for manual epoch selection

make_fwd()

Make the forward model

make_ica(**state)

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)

make_mrat_evoked(**kwargs)

Produce the sensor data fiff files needed for MRAT sensor analysis

make_mrat_stcs(**kwargs)

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_raw(**kwargs)

Make a raw file

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

Create an HTML report on spatio-temporal clusters

make_report_coreg([file_name])

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_src(**kwargs)

Make the source space

merge_bad_channels()

Merge bad channel definitions for different sessions

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

Move files to a different root folder

next([field])

Change field to the next value

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

Plot the annot file on which the current parcellation is based

plot_brain([common_brain])

Plot the brain model

plot_coreg([dig, parallel])

Plot the coregistration (Head shape and MEG helmet)

plot_evoked([subjects, separate, baseline, …])

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()

Reset all field values to the state at initialization

rm(temp[, inclusive, confirm])

Remove all files corresponding to a template

run_mne_analyze([modal])

Run mne_analyze

run_mne_browse_raw([modal])

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

show_bad_channels([sessions])

List bad channels

show_fields([str_out])

Generate a table for all iterable fields and ther values.

show_file_status(temp[, col, row])

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.

show_input_tree()

Print a tree of the files needed as input

show_raw_info(**state)

Display the selected pipeline for raw processing

show_reg_params([asds])

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([mri, mrisubject, caption, asds])

Create a Dataset with subject information

show_tree([root, fields])

Print a tree of the filehierarchy implicit in the templates