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:
_MockQMainWindowReal-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_names
listofstr Channel names. One row per channel.
- sfreq
float Sampling frequency in Hz.
- tmin
float, default -0.1 Epoch start in seconds relative to each trigger.
- tmax
float, default 0.5 Epoch end in seconds relative to each trigger.
- n_shown
int, default 20 Number of channels visible simultaneously.
- time_window
float, default 10.0 Visible time range in seconds at startup.
- scale_uv
float, default 100.0 Amplitude scale in µV (half of per-channel row height).
- event_id
dict[str,int] |None, defaultNone Maps condition names to integer trigger codes. Each code gets a distinct colour; unmapped codes use the first colour.
- info
mne.Info|None, defaultNone If provided, used for channel-type detection and right-click sensor position.
- verbosebool |
str|None, defaultNone
- ch_names
See also
mne_rt.viz.RawPlotContinuous raw viewer without epoch overlays.
mne_rt.RTEpochsEvent-triggered epoch accumulator.
Notes
Feed data with
push()(shape(n_ch, n_times)) and trigger events withpush_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:
- data
ndarray,shape(n_channels,n_samples) New raw data chunk. No-op when paused.
- data
- 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:
- code
int, default 1 Integer event code matched against
event_id.
- code