meeg_utils.steps.ASR#
- class meeg_utils.steps.ASR(cutoff=20.0, *, picks='eeg', window_length=0.5, max_dims=0.66, calibration='auto')[source]#
Artifact subspace reconstruction: repair high-amplitude bursts in continuous EEG.
Wraps
mne_denoise.asr.ASR(Kothe & Jung, 2016; Chang et al., 2020, IEEE Trans Biomed Eng 67:1114).fitfinds clean calibration windows in the recording and learns the statistics of clean data;transformslides a window over the data and, where components exceedcutoffstandard deviations of the calibration data, reconstructs them from the rest.- Parameters:
cutoff (float) – Threshold in standard deviations (default 20, EEGLAB’s
clean_rawdatadefault; Chang et al. 2020 recommend 20-30). Lower values repair more, and remove more brain signal.picks (str) – Channel type to process (default
"eeg"). Bad channels are left out: detect them first.window_length (float) – Processing window (s).
max_dims (float | int) – Maximum fraction (or number) of dimensions reconstructed per window.
calibration ({"auto", "manual"}) –
"auto"selects clean calibration windows;"manual"uses all of the data passed tofit(e.g. a clean baseline recording).
- asr_#
The fitted model.
- Type:
mne_denoise.asr.ASR
- qc_#
n_channels,fraction_reconstructed_windows,fraction_reconstructed_samples,max_components_reconstructedandvariance_removed_pct(last transform).- Type:
Notes
High-pass filter first (EEGLAB filters at 0.25-0.75 Hz): drifts inflate the calibration statistics. ASR changes the data only where it detects bursts; to mark segments instead, see
BadSegments.Figures (
plot()):"reconstruction"(components reconstructed over time) and"psd".- __init__(cutoff=20.0, *, picks='eeg', window_length=0.5, max_dims=0.66, calibration='auto')[source]#
Methods
__init__([cutoff, picks, window_length, ...])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
fitmethod.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
transformmethod.transform(inst, *[, copy])Apply the fitted step to the data.
Attributes
Data types the step accepts.
adds_annotationsWhether the step may add
BAD_annotations (existing ones are kept).changes_channelsWhether the step may add, drop or reorder channels.
changes_timesWhether the step may change the time axis (e.g. resampling, cropping).
drops_epochsWhether the step may drop epochs (e.g. artifact rejection).
kind -> whether it needs data (
inst).returnsData type the step returns;
Nonemeans the same type as its input.systemsAcquisition systems the step applies to;
Nonemeans all systems.