meeg_utils.steps.SNS#

class meeg_utils.steps.SNS(n_neighbors=10, *, skip=0, n_iter=1)[source]#

Sensor noise suppression: replace each channel by its projection on its neighbours.

Wraps mne_denoise.sns.SNS (de Cheveigné & Simon, 2008, J Neurosci Methods 168:195). Noise specific to single sensors (e.g. sensor or amplifier noise, a loose electrode) is not shared with other channels and is removed; activity seen by several sensors (brain signal, and also shared artifacts, which SNS does not remove) is kept. Each data channel type is processed separately; the operator is learned in fit.

Parameters:
  • n_neighbors (int) – Number of most correlated channels each channel is projected on (10 in de Cheveigné & Simon, 2008); 0 uses all channels.

  • skip (int) – Number of most correlated neighbours to leave out (e.g. to keep a channel’s own noise from leaking through near-duplicates).

  • n_iter (int) – Number of times the projection is applied.

models_#

Channel type mapped to the fitted mne_denoise.sns.SNS.

Type:

dict

qc_#

Per channel type: n_channels and variance_removed_pct (last transform).

Type:

dict

Notes

Bad channels are left out and unchanged. SNS lowers the rank of the data only slightly, but channels become more correlated; run it before ICA.

Figures (plot()): "psd", spectra before and after.

__init__(n_neighbors=10, *, skip=0, n_iter=1)[source]#

Methods

__init__([n_neighbors, skip, n_iter])

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'>, <class 'mne.epochs.BaseEpochs'>, <class 'mne.evoked.Evoked'>)#

Data types the step accepts.

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