meeg_utils.qc.Muscle#

class meeg_utils.qc.Muscle(*, threshold=4.0, filter_freq=(110.0, 140.0), ch_type=None, warn_fraction=None)[source]#

Share of the recording contaminated by muscle activity.

Uses mne.preprocessing.annotate_muscle_zscore() with MNE’s defaults: the 110-140 Hz envelope, z-scored and averaged over channels, above 4.

Parameters:
  • threshold (float) – z-score threshold (MNE default 4).

  • filter_freq (tuple of float) – Band in which muscle activity is measured (MNE default 110-140 Hz).

  • ch_type (str | None) – Channel type to use; None lets MNE choose (mag, then grad, then eeg).

  • warn_fraction (float | None) – Fraction of time above which the recording is flagged. There is no established limit, and how much muscle activity is acceptable depends on the task (speaking, movement) and the analysis (high-frequency activity is affected most). None (default) reports the fraction without a verdict.

metrics_#

fraction (of the recording), n_segments and ch_type.

Type:

dict

Notes

Figures: "scores" (muscle z-score over time with the threshold).

__init__(*, threshold=4.0, filter_freq=(110.0, 140.0), ch_type=None, warn_fraction=None)[source]#

Methods

__init__(*[, threshold, filter_freq, ...])

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] = 'muscle'#

Key of the check in reports.

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