Remove artifacts using regression based on reference channels.
Epochs
| Raw
The instance to process.
str
| list
| slice
| None
Channels to include. Slices and lists of integers will be interpreted as
channel indices. In lists, channel type strings (e.g., ['meg',
'eeg']
) will pick channels of those types, channel name strings (e.g.,
['MEG0111', 'MEG2623']
will pick the given channels. Can also be the
string values “all” to pick all channels, or “data” to pick data
channels. None (default) will pick good data channels. Note that channels
in info['bads']
will be included if their names or indices are
explicitly provided.
str
Channel picks to use as predictor/explanatory variables capturing the artifact of interest (default is “eog”).
ndarray
, shape (n_picks, n_picks_ref) | None
The regression coefficients to use. If None (default), they will be estimated from the data.
If True (default), copy the instance before modifying it.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
Notes
To implement the method outlined in [1],
remove the evoked response from epochs before estimating the
regression coefficients, then apply those regression coefficients to the
original data in two calls like (here for a single-condition epochs
only):
>>> epochs_no_ave = epochs.copy().subtract_evoked()
>>> _, betas = mne.preprocessing.regress(epochs_no_ave)
>>> epochs_clean, _ = mne.preprocessing.regress(epochs, betas=betas)
References
mne.preprocessing.regress_artifact
#Repairing artifacts with regression