eelbrain.pipeline.Pipeline

class eelbrain.pipeline.Pipeline(root, screen_log_level=None, **state)[source]

Analyze an MEG or EEG experiment

Parameters:
  • root (Path | str) – 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.

  • screen_log_level (str | int)

Notes

See also

Guide on using The Pipeline.

Methods

clean_cache([dry_run, delete, revalidate])

Report and delete invalid or stale cache files (garbage collection).

fix_events(data)

Modify event order or timing

format(string, **kwargs)

Format a string with the current state values.

get(key, **state)

get_field_values(field[, exclude])

Find values for a field taking into account exclusion

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

Construct inv string from settings; see set_inv()

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.

label_events(data)

Add event labels to events loaded from raw files

label_groups(subject, groups)

Generate Factor for group membership

label_subjects(data)

Label the subjects in data

load_annot([show_dependencies])

Load a parcellation (from an annot file)

load_bad_channels([noise, show_dependencies])

Load bad channels

load_cov([show_dependencies])

Load the covariance matrix

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

Load a Dataset with epochs for a given epoch definition

load_events([show_dependencies])

Load events from a raw file.

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

Load a Dataset with condition average responses for each subject.

load_fwd([surf_ori, ndvar, show_dependencies])

Load the forward solution

load_head_position([show_dependencies])

Load head position samples for a recording

load_ica([accept_stale, show_dependencies])

Load the mne-python ICA object

load_inv([ndvar, show_dependencies])

Load the inverse operator

load_label(label, **kwargs)

Retrieve a label as mne Label object

load_model_test(x[, tstart, tstop, ...])

Test a difference in predictive power between two TRF models

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

Load sensor neighbor correlation

load_predictor(code[, tstep, n_samples, ...])

Load a file predictor as an NDVar

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

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_source_morph([show_dependencies])

Load the source morph from mrisubject to common_brain

load_src([add_geom, ndvar, show_dependencies])

Load the current source space

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

Create and load spatio-temporal cluster test results

load_trf(x[, tstart, tstop, estimator, ...])

Load (or compute) the TRF for a model and the current subject

load_trf_job(x[, tstart, tstop, estimator, ...])

Load the data and return a picklable TRFJob for fitting this TRF elsewhere

load_trfs(subjects, x[, tstart, tstop, ...])

Load TRFs for a group (or subject) as a Dataset

make_annot(**state)

Ensure that annot files for the current parcellation exist.

make_bad_channels([bad_chs, redo, noise])

Write the bad channel definition file for a raw file

make_bad_channels_auto([meg, eeg, redo, noise])

Automatically detect flat channels and mark them as bad

make_bad_channels_neighbor_correlation(r[, ...])

Iteratively exclude bad channels based on low average neighbor-correlation

make_bad_channels_selection([raw])

GUI for selecting bad channels in continuous M/EEG recordings

make_epoch_rejection([samplingrate, auto, ...])

Open gui.select_epochs() for the current epoch rejection

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

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, hemi])

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, subtract_mean])

Plot raw sensor data

plot_whitened_gfp([s_start, s_stop, run])

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

reset()

Reset all field values to the state at initialization

set([subject])

Set variable values.

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

Set the type of inverse solution used for source estimation

show_bad_channels([tasks])

List bad channels

show_fields([constants])

A table for all iterable fields and their values.

show_head_position_overview([distance, ...])

Overview of head position (dev_head_t) across tasks, subjects and sessions.

show_model_terms(x)

Table showing terms in a TRF model or comparison

show_raw_info(**state)

Display the selected pipeline for raw processing

show_reg_params(**state)

Show the covariance matrix regularization parameters

show_rej_info([flagp, asds, bads])

Information about artifact rejection

show_state([temp, empty, hide])

List field values.

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

Create a Dataset with subject information