mne_rt.viz.EpochPlot#

class mne_rt.viz.EpochPlot(ch_names: list[str], sfreq: float, tmin: float = -0.1, tmax: float = 0.5, n_shown: int = 20, time_window: float = 10.0, scale_uv: float = 100.0, event_id: dict[str, int] | None = None, info=None, verbose=None)[source]#

Bases: _MockQMainWindow

Real-time scrolling M/EEG viewer with epoch / trigger overlays.

Displays all channels stacked vertically (identical layout to RawPlot) with coloured event markers overlaid on the signal. For each trigger event a solid vertical line marks t = 0, a semi-transparent shaded band spans the epoch window [tmin, tmax], and dashed boundary lines sit at the epoch edges.

Parameters:
ch_nameslist of str

Channel names. One row per channel.

sfreqfloat

Sampling frequency in Hz.

tminfloat, default -0.1

Epoch start in seconds relative to each trigger.

tmaxfloat, default 0.5

Epoch end in seconds relative to each trigger.

n_shownint, default 20

Number of channels visible simultaneously.

time_windowfloat, default 10.0

Visible time range in seconds at startup.

scale_uvfloat, default 100.0

Amplitude scale in µV (half of per-channel row height).

event_iddict[str, int] | None, default None

Maps condition names to integer trigger codes. Each code gets a distinct colour; unmapped codes use the first colour.

infomne.Info | None, default None

If provided, used for channel-type detection and right-click sensor position.

verbosebool | str | None, default None

See also

mne_rt.viz.RawPlot

Continuous raw viewer without epoch overlays.

mne_rt.RTEpochs

Event-triggered epoch accumulator.

Notes

Feed data with push() (shape (n_ch, n_times)) and trigger events with push_trigger(). Both calls are safe to make from an acquisition thread.

Added in version 1.1.0.

__init__(ch_names: list[str], sfreq: float, tmin: float = -0.1, tmax: float = 0.5, n_shown: int = 20, time_window: float = 10.0, scale_uv: float = 100.0, event_id: dict[str, int] | None = None, info=None, verbose=None) None[source]#

Methods

__init__(ch_names, sfreq[, tmin, tmax, ...])

closeEvent(event)

push(data)

Enqueue a raw data chunk for display.

push_trigger([code])

Enqueue a trigger event at the current stream position.

push(data: ndarray) None[source]#

Enqueue a raw data chunk for display.

Thread-safe: may be called from any thread. The data is written into the circular buffer and rendered by the main-thread timer at ~30 Hz.

Parameters:
datandarray, shape (n_channels, n_samples)

New raw data chunk. No-op when paused.

push_trigger(code: int = 1) None[source]#

Enqueue a trigger event at the current stream position.

Thread-safe: may be called from any thread. The trigger is placed after all data chunks already in the queue, so the sample index is computed correctly in the main thread.

Parameters:
codeint, default 1

Integer event code matched against event_id.

closeEvent(event) None[source]#