mne_denoise.viz.plot_component_cleaning_summary#
- mne_denoise.viz.plot_component_cleaning_summary(scores=None, selected_count=0, patterns=None, info=None, channel_names=None, removed=None, sources=None, sfreq=None, freqs=None, psd_before=None, psd_after=None, line_freq=None, fmax=100.0, segment_info=None, summary_rows=None, title='Component Cleaning Summary', figsize=None, dpi=200, show=True, fname=None)[source]#
Plot a generic component-cleaning dashboard.
- Parameters:
scores (array-like | None) – Component score vector.
selected_count (int) – Number of selected/removed components.
patterns (array-like | None) – Component patterns with shape
(n_channels, n_components).info (mne.Info | None) – Optional MNE info for topomap rendering.
channel_names (sequence of str | None) – Channel labels used by non-topomap fallback panels.
removed (array-like | None) – Removed signal with shape
(n_channels, n_times)or(n_epochs, n_channels, n_times).sources (array-like | None) – Component source traces with shape
(n_components, n_times)or(n_epochs, n_components, n_times).sfreq (float | None) – Sampling frequency for source/segment time axes.
freqs (array-like | None) – Frequency axis for PSD panel.
psd_before (array-like | None) – PSD values for before/after comparison.
psd_after (array-like | None) – PSD values for before/after comparison.
line_freq (float | None) – Optional line frequency marker in PSD panel.
fmax (float) – Upper frequency bound for PSD panel.
segment_info (list[dict] | None) – Optional segmented metadata. If provided, segmented panels replace score/removed/source panels.
summary_rows (list[tuple[str, object]] | None) – Optional explicit table rows.
title (str) – Figure title.
dpi (int) – Figure resolution.
show (bool) – Whether to show the figure.
fname (path-like | None) – Optional output path.
- Returns:
fig – Figure handle.
- Return type:
- Raises:
ValueError – If panel inputs are incompatible with expected dimensions or metadata requirements (for example invalid source/pattern/segment shapes).
Notes
This function is a thin composer around internal panel painters in
mne_denoise.viz._summary_panels. It does not run fitting or denoising; all inputs are expected to be precomputed by the caller.Examples
>>> import numpy as np >>> from mne_denoise.viz import plot_component_cleaning_summary >>> rng = np.random.default_rng(0) >>> freqs = np.linspace(0, 80, 161) >>> fig = plot_component_cleaning_summary( ... scores=np.array([2.0, 1.2, 0.7]), ... selected_count=1, ... patterns=rng.standard_normal((5, 3)), ... removed=rng.standard_normal((5, 200)), ... sources=rng.standard_normal((3, 200)), ... sfreq=200.0, ... freqs=freqs, ... psd_before=rng.random((5, freqs.size)), ... psd_after=rng.random((5, freqs.size)), ... show=False, ... )