meeg_utils.qc.OutlierChannels#

class meeg_utils.qc.OutlierChannels(*, n_neighbors=20, threshold=1.5, l_freq=1.0, min_channels=10)[source]#

Channels whose signal is unlike that of the other channels (LOF).

Uses mne.preprocessing.find_bad_channels_lof() (Local Outlier Factor; Kumaravel et al., 2022) on each channel type separately, after a 1 Hz high-pass on a copy so that slow drifts do not dominate. It complements PREP and Maxwell detection and works for any system.

Parameters:
  • n_neighbors (int) – LOF neighbourhood size (MNE default 20); reduced to the number of channels minus one for small montages.

  • threshold (float) – LOF score above which a channel is an outlier (MNE default 1.5).

  • l_freq (float | None) – High-pass applied to the copy before scoring.

  • min_channels (int) – Channel types with fewer channels are skipped.

metrics_#

Per channel type, the outliers; scores per channel.

Type:

dict

Notes

Figures: "scores" (LOF score per channel with the threshold).

__init__(*, n_neighbors=20, threshold=1.5, l_freq=1.0, min_channels=10)[source]#

Methods

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

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

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