meeg_utils.steps.Interpolate#

class meeg_utils.steps.Interpolate(method=None, *, origin='auto', reset_bads=True, exclude=())[source]#

Interpolate the channels marked bad.

Thin wrapper of mne.io.Raw.interpolate_bads(): spherical splines for EEG (needs electrode positions) and minimum-norm field mapping for MEG by default.

Parameters:
  • method (dict | None) – Interpolation method per channel type; None uses {"eeg": "spline", "meg": "MNE"}.

  • origin (str | tuple) – Head origin; "auto" fits it to the digitization (or uses (0, 0, 0.04) with a warning when there are no head-shape points).

  • reset_bads (bool) – Whether to clear the interpolated channels from info["bads"].

  • exclude (list of str) – Bad channels to leave as they are.

qc_#

interpolated (channel names) and fraction of channels.

Type:

dict

Notes

Figures (plot()): "sensors", the sensor layout with the interpolated channels highlighted.

__init__(method=None, *, origin='auto', reset_bads=True, exclude=())[source]#

Methods

__init__([method, origin, reset_bads, exclude])

fit(inst[, y, system])

Learn the step's state from the data.

fit_transform(inst[, y, system, copy])

Fit the step on the data and transform the same data.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

plot([kind, inst])

Draw quality-control figures.

set_fit_request(*[, inst, system])

Configure whether metadata should be requested to be passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

set_transform_request(*[, copy, inst])

Configure whether metadata should be requested to be passed to the transform method.

transform(inst, *[, copy])

Apply the fitted step to the data.

Attributes

accepts

Data types the step accepts.

adds_annotations

Whether the step may add BAD_ annotations (existing ones are kept).

changes_channels

Whether the step may add, drop or reorder channels.

changes_times

Whether the step may change the time axis (e.g. resampling, cropping).

drops_epochs

Whether the step may drop epochs (e.g. artifact rejection).

plot_kinds

kind -> whether it needs data (inst).

returns

Data type the step returns; None means the same type as its input.

systems

Acquisition systems the step applies to; None means all systems.

accepts: ClassVar[tuple[type, ...]] = (<class 'mne.io.base.BaseRaw'>,)#

Data types the step accepts.

plot_kinds: ClassVar[dict[str, bool]] = {'sensors': False}#

kind -> whether it needs data (inst). Each kind is drawn by a _plot_<kind>(inst, **kwargs) method.

Type:

Figures the object can draw once fitted