mne_rt.viz.CompareEvoked#

class mne_rt.viz.CompareEvoked(ch_names: list[str], sfreq: float, tmin: float, tmax: float, event_id: dict[str, int], channels: list[str] | None = None, info=None, montage: str = 'standard_1020', baseline: tuple | None = (None, 0), window_size: tuple[int, int] = (1200, 800), verbose: bool | str | None = None)[source]#

Bases: _MockQMainWindow

Real-time per-channel condition overlay with SEM shading and peak markers.

Shows N user-selected channels as large individual pyqtgraph.PlotItem rows. Each plot overlays all conditions with solid curves, ±1 SEM shading, and a scatter point marking the peak latency in the post-stimulus window.

Channels are chosen interactively via a clickable mini scalp-topomap in the sidebar: click any electrode dot to add or remove it from the display (up to _MAX_DISP_CH channels simultaneously).

Parameters:
ch_nameslist of str

Electrode names in data order.

sfreqfloat

Sampling frequency in Hz.

tminfloat

Epoch start (s).

tmaxfloat

Epoch end (s).

event_iddict[str, int]

Condition label → marker integer.

channelslist of str or None

Channels shown on startup. If None, auto-selects from ['Cz','Pz','Oz','Fz','FCz','CPz'] or the first 3 channels.

infomne.Info or None

Used for unit/scale detection and scalp layout.

montagestr, default "standard_1020"

Fallback montage for electrode positions when info has no dig.

baselinetuple or None, default (None, 0)

Baseline correction interval (informational only).

window_sizetuple of int, default (1200, 800)

Initial window size in pixels.

verbosebool, str, or None
.. versionadded:: 1.0.0

See also

mne_rt.RTEpochs

Drives this plot via update().

__init__(ch_names: list[str], sfreq: float, tmin: float, tmax: float, event_id: dict[str, int], channels: list[str] | None = None, info=None, montage: str = 'standard_1020', baseline: tuple | None = (None, 0), window_size: tuple[int, int] = (1200, 800), verbose: bool | str | None = None) None[source]#

Methods

__init__(ch_names, sfreq, tmin, tmax, event_id)

update(data, conditions)

Redraw all channel plots with updated condition averages.

update(data: ndarray, conditions: list[str]) None[source]#

Redraw all channel plots with updated condition averages.

Thread-safe — may be called from the acquisition thread.

Parameters:
datandarray, shape (n_epochs, n_channels, n_times)

All accepted epochs so far.

conditionslist of str

Condition label for each epoch; length == data.shape[0].