meeg_utils.qc.Events#

class meeg_utils.qc.Events(*, expected=None, stim_channel=None, min_interval=None)[source]#

Event counts and timing, compared with what the experiment should produce.

Events come from the annotations (excluding BAD/EDGE annotations), or, if there are none, from the stimulus channel (mne.find_events()).

Parameters:
  • expected (dict | None) – Event name (annotation description, or trigger code as a string) mapped to the expected count. A different count is a "fail".

  • stim_channel (str | None) – Stimulus channel; None uses MNE’s default channels.

  • min_interval (float | None) – Shortest plausible interval between consecutive events, in seconds; shorter intervals are flagged (e.g. trigger bouncing).

metrics_#

source ("annotations" or the stimulus channel), counts, n_events, min_interval_s, n_simultaneous (events sharing a sample) and n_in_bad (events inside BAD segments).

Type:

dict

Notes

Figures: "timeline" (mne.viz.plot_events()).

__init__(*, expected=None, stim_channel=None, min_interval=None)[source]#

Methods

__init__(*[, expected, stim_channel, ...])

compute(raw)

Measure the recording.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

not_applicable(raw)

Return why the check cannot run on raw, or None if it can.

plot([kind, inst])

Draw quality-control figures.

set_params(**params)

Set the parameters of this estimator.

Attributes

level

The worst verdict of the findings ("ok" if there are none).

modalities

Data types the check needs at least one of ("meg", "eeg").

name

Key of the check in reports.

plot_kinds

kind -> whether it needs data (inst).

systems

Acquisition systems the check applies to; None means all.

name: ClassVar[str] = 'events'#

Key of the check in reports.

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

not_applicable(raw)[source]#

Return why the check cannot run on raw, or None if it can.

Parameters:

raw (Raw) – The recording.

Returns:

The reason, or None.

Return type:

str | None