meeg_utils.steps.FixedLengthEpochs#

class meeg_utils.steps.FixedLengthEpochs(duration=2.0, *, overlap=0.0, reject_by_annotation=True)[source]#

Cut a continuous recording into consecutive epochs of equal length (e.g. resting state).

Wraps mne.make_fixed_length_epochs(). Epochs overlapping BAD annotations are dropped.

Parameters:
  • duration (float) – Epoch length in seconds.

  • overlap (float) – Overlap between consecutive epochs in seconds.

  • reject_by_annotation (bool) – Drop epochs overlapping BAD annotations.

qc_#

n_epochs (before dropping), n_kept, fraction_kept and duration_kept_s.

Type:

dict

Notes

Figures (plot()): "drop_log".

__init__(duration=2.0, *, overlap=0.0, reject_by_annotation=True)[source]#

Methods

__init__([duration, overlap, ...])

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

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.

returns#

alias of BaseEpochs

changes_times: ClassVar[bool] = True#

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

plot_kinds: ClassVar[dict[str, bool]] = {'drop_log': 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