API reference#

ASR#

mne_denoise.asr.ASR

Artifact Subspace Reconstruction (ASR) scikit-learn transformer.

mne_denoise.asr.AdaptiveASR

Adaptive Artifact Subspace Reconstruction (AASR) estimator.

mne_denoise.asr.JugglerASR

Juggler Artifact Subspace Reconstruction (JugglerASR).

mne_denoise.asr.GuidedASR

DSS-biased soft Artifact Subspace Reconstruction (experimental).

mne_denoise.asr.calibrate_asr

Calibrate a standard ASR model from continuous data.

mne_denoise.asr.compute_clean_window_mask

Compute a statistical retained-sample mask for continuous data.

mne_denoise.asr.fit_rms_distribution

Fit robust clean EEG RMS statistics.

mne_denoise.asr.process_asr

Apply a calibrated ASR model to continuous data.

mne_denoise.asr.process_guided_asr

Apply a calibrated ASR state with guided soft reconstruction.

mne_denoise.asr.select_juggler_reference_samples

Select calibration samples using Juggler's ASR rules.

Warning

GuidedASR and process_guided_asr are unpublished, unvalidated experimental research prototypes. Their current evidence is limited to unit tests and synthetic benchmarks; independently validate signal preservation and artifact attenuation before scientific use.

DSS#

mne_denoise.dss.compute_dss

Compute DSS spatial filters from baseline and biased covariances.

mne_denoise.dss.DSS

Denoising Source Separation (DSS) Transformer.

mne_denoise.dss.TimeShiftDSS

Trial-average DSS in a lag-augmented sensor space.

mne_denoise.dss.iterative_dss

Extract multiple DSS components using iterative (nonlinear) algorithm.

mne_denoise.dss.IterativeDSS

Iterative (Nonlinear) Denoising Source Separation Transformer.

ZapLine#

mne_denoise.zapline.ZapLine

ZapLine Transformer for line noise removal.

Spectrum interpolation#

mne_denoise.spectrum_interpolation.SpectrumInterpolation

Remove power-line noise by amplitude spectrum interpolation.

mne_denoise.spectrum_interpolation.interpolate_spectrum

Remove line noise from 2D data by amplitude spectrum interpolation.

iCanClean#

mne_denoise.icanclean.ICanClean

ICanClean Transformer for reference-based artifact removal.

mne_denoise.icanclean.compute_icanclean

Compute one iCanClean pass on continuous NumPy arrays.

BSS-CCA#

mne_denoise.bss_cca.BSSCCA

Reference-free BSS-CCA artifact-attenuation estimator.

mne_denoise.bss_cca.compute_bss_cca

Learn and apply reference-free BSS-CCA to a channel-first array.

SNS#

mne_denoise.sns.SNS

Sensor Noise Suppression estimator.

mne_denoise.sns.compute_sns

Learn and apply Sensor Noise Suppression to a channel-first array.

mne_denoise.sns.compute_sns_weights

Compute the SNS spatial operator from a channel covariance matrix.

SSA#

mne_denoise.ssa.SingularSpectrumAnalysis

Frequency-guided per-channel Basic SSA transformer.

mne_denoise.ssa.LocalSingularSpectrumAnalysis

Local-SSA high-amplitude artifact transformer.

mne_denoise.ssa.ssa_decompose

Decompose a one-dimensional series into additive Basic SSA components.

mne_denoise.ssa.ssa_w_correlation

Compute weighted correlations between SSA reconstructions.

mne_denoise.ssa.compute_basic_ssa

Apply frequency-guided Basic SSA independently to every channel.

mne_denoise.ssa.ssa_clean_channel

Clean one channel by grouping Basic SSA components by frequency.

mne_denoise.ssa.compute_local_ssa

Apply local SSA independently to every input channel.

mne_denoise.ssa.local_ssa_clean_channel

Remove a locally reconstructed high-energy artifact from one channel.

Denoisers#

mne_denoise.dss.denoisers.LinearDenoiser

Base class for linear bias functions.

mne_denoise.dss.denoisers.AverageBias

Bias function for finding repeatable components via averaging.

mne_denoise.dss.denoisers.CycleAverageBias

Fixed-window event-locked averaging bias.

mne_denoise.dss.denoisers.BandpassBias

Bandpass filter bias for narrow-band rhythm extraction.

mne_denoise.dss.denoisers.LineNoiseBias

A bias LinearDenoiser for line noise isolation (Notch/IIR or FFT/Harmonic).

mne_denoise.dss.denoisers.PeakFilterBias

Peak filter bias for single-frequency extraction.

mne_denoise.dss.denoisers.CombFilterBias

Comb filter bias for harmonic frequency extraction.

mne_denoise.dss.denoisers.LagAverageBias

Lag-averaging bias for emphasizing temporally smooth signals.

mne_denoise.dss.denoisers.SmoothingBias

Unified temporal smoothing bias (Moving Average).

mne_denoise.dss.denoisers.SpectrogramBias

Linear spectrogram bias (Section 4.1.3).

mne_denoise.dss.denoisers.NonlinearDenoiser

Base class for nonlinear/adaptive denoiser functions.

mne_denoise.dss.denoisers.TanhMaskDenoiser

Tanh mask denoiser (Standard FastICA nonlinearity).

mne_denoise.dss.denoisers.RobustTanhDenoiser

Robust tanh denoiser (FastICA / RobustICA formulation).

mne_denoise.dss.denoisers.KurtosisDenoiser

Kurtosis maximization denoiser.

mne_denoise.dss.denoisers.SkewDenoiser

Skewness nonlinearity (FastICA 'skew').

mne_denoise.dss.denoisers.GaussDenoiser

Gaussian nonlinearity (FastICA 'gauss').

mne_denoise.dss.denoisers.WienerMaskDenoiser

Adaptive Wiener mask denoiser.

mne_denoise.dss.denoisers.SpectrogramDenoiser

Adaptive/Nonlinear spectrogram denoiser (Section 4.1.3).

mne_denoise.dss.denoisers.DCTDenoiser

DCT domain denoiser (MATLAB denoise_dct.m).

mne_denoise.dss.denoisers.QuasiPeriodicDenoiser

Quasi-periodic denoiser via cycle averaging.

Variants#

mne_denoise.dss.variants.smooth_dss

Create an ordinary DSS configured for temporally smooth sources.

mne_denoise.dss.variants.narrowband_dss

Create a DSS configured for a specific frequency band.

mne_denoise.dss.variants.narrowband_scan

Scan frequencies to find optimal narrowband DSS components.

mne_denoise.dss.variants.ssvep_dss

Create a DSS configured for SSVEP extraction.

Quality Assurance#

mne_denoise.qa.peak_attenuation_db

Attenuation (dB) of the dominant peak around a target frequency.

mne_denoise.qa.suppression_ratio

Suppression ratio (dB) of mean band power around a target frequency.

mne_denoise.qa.noise_surround_ratio

Residual peak-to-surround power ratio around a target frequency.

mne_denoise.qa.below_noise_distortion_db

Broadband spectral distortion (dB) outside excluded noise bands.

mne_denoise.qa.spectral_distortion

Spectral distortion (dB RMS) at non-harmonic frequencies.

mne_denoise.qa.overclean_proportion

Fraction of channels where the spectral floor is over-suppressed.

mne_denoise.qa.underclean_proportion

Fraction of channels where the line-noise peak remains prominent.

mne_denoise.qa.geometric_mean_psd_ratio

Geometric mean of psd_after / psd_before across broadband.

mne_denoise.qa.variance_removed

Percentage of total variance removed after denoising.

mne_denoise.qa.compute_all_qa_metrics

Compute all QA metrics for a line-noise removal benchmark.

mne_denoise.qa.rms_change

Root mean square (RMS) of the difference between before and after signals.

mne_denoise.qa.max_abs_change

Maximum absolute change between before and after signals.

mne_denoise.qa.channel_variance_ratio

Per-channel variance ratio: var(after) / var(before).

Visualization#

mne_denoise.viz.plot_asr_repair_timeline

Plot the per-window count of reconstructed components over time.

mne_denoise.viz.plot_asr_calibration_fraction

Bar chart of the clean calibration fraction for one or more estimators.

mne_denoise.viz.plot_asr_component_reconstruction

Heatmap of per-window component variance relative to rejection thresholds.

mne_denoise.viz.plot_guided_asr_weights

Plot experimental GuidedASR soft weights by window and component.

mne_denoise.viz.plot_component_summary

Plot a compact per-component summary dashboard.

mne_denoise.viz.plot_component_selector

Plot an interactive component selector for DSS or standard ZapLine.

mne_denoise.viz.plot_component_time_series

Plot stacked component time series with fixed vertical offsets.

mne_denoise.viz.plot_component_spectrogram

Plot a time-frequency power view for one component.

mne_denoise.viz.plot_component_score_curve

Plot a 1D component score curve for a fitted estimator.

mne_denoise.viz.plot_window_score_traces

Plot per-window score traces from a 2D score matrix.

mne_denoise.viz.plot_component_patterns

Plot spatial component patterns.

mne_denoise.viz.plot_component_epochs_image

Plot component activity as an epoch-by-time image.

mne_denoise.viz.plot_psd_comparison

Plot PSD comparison for original and denoised data.

mne_denoise.viz.plot_evoked_gfp_comparison

Plot GFP comparison for before/after signals.

mne_denoise.viz.plot_channel_time_course_comparison

Plot before/after channel time courses for explicit channel picks.

mne_denoise.viz.plot_power_ratio_map

Plot a topomap of preserved power ratio after denoising.

mne_denoise.viz.plot_spectrogram_comparison

Compare before/after spectrograms averaged across selected channels.

mne_denoise.viz.plot_signal_overlay

Overlay one before/after trace to inspect reconstruction quality.

mne_denoise.viz.plot_component_psd_comparison

Plot input PSD next to PSDs of selected components.

mne_denoise.viz.plot_grand_average_evokeds

Plot group-mean evoked responses with optional SEM bands.

mne_denoise.viz.plot_narrowband_score_scan

Plot score/eigenvalue profiles from a narrowband scan.

mne_denoise.viz.plot_time_frequency_mask

Visualize a time-frequency mask matrix.

mne_denoise.viz.plot_metric_bars

Plot grouped bar charts for one or more scalar metrics.

mne_denoise.viz.plot_window_count_series

Plot a per-window count or metric series.

mne_denoise.viz.plot_tradeoff_scatter

Plot a grouped x/y trade-off scatter with optional group means.

mne_denoise.viz.plot_metric_comparison

Plot one metric as grouped bars or paired subject trajectories.

mne_denoise.viz.plot_metric_slopes

Plot subject-level paired trajectories for one or more metrics.

mne_denoise.viz.plot_metric_violins

Plot violin + strip distributions with optional paired subject lines.

mne_denoise.viz.plot_null_distribution

Plot a null-distribution histogram with observed statistic and CI.

mne_denoise.viz.plot_forest

Plot per-subject point estimates with confidence intervals.

mne_denoise.viz.plot_harmonic_attenuation

Plot grouped per-harmonic attenuation bars for line-noise studies.

mne_denoise.viz.plot_metric_tradeoff_summary

Plot a two-panel metric trade-off summary.

mne_denoise.viz.plot_denoising_summary

Plot a generic denoising diagnostics dashboard.

mne_denoise.viz.plot_component_cleaning_summary

Plot a generic component-cleaning dashboard.

mne_denoise.viz.plot_signal_diagnostics_summary

Plot grouped time-domain signal diagnostics.

mne_denoise.viz.plot_condition_interaction_summary

Plot condition-by-group interaction traces.

mne_denoise.viz.plot_group_condition_interaction_summary

Plot group-wise condition interaction traces.

mne_denoise.viz.plot_endpoint_metrics_summary

Plot a generic endpoint-metric storyboard.

plot_component_selector return object#

class mne_denoise.viz.ComponentSelector(*, estimator: Any, data: Any, fig: Any, state: _SelectionState, excluded: list[int])[source]#

Selection controller returned by plot_component_selector().

The controller stores the current component selection and the cached data needed by the live preview. Use excluded to inspect the selection and apply() to reconstruct the selected signal.

Notes

This class is a public return type, but direct construction is not part of the public API. Create instances with plot_component_selector().

apply(data: Any = None) Any[source]#

Apply the current selection while preserving the input data type.

Parameters:

data (Raw | Epochs | Evoked | ndarray | None, default=None) – Data to reconstruct. If None, use the cached snapshot supplied to plot_component_selector(). Passing data explicitly computes fresh component sources for that input.

Returns:

cleaned – Reconstructed data with the same type and layout as the input. Channels not used by the fitted estimator are preserved for MNE objects.

Return type:

Raw | Epochs | Evoked | ndarray

property excluded: list[int]#

Return sorted component indices excluded from the clean output.