mne_rt.viz.TFRPlot#

class mne_rt.viz.TFRPlot(ch_names: list[str], sfreq: float, tmin: float, tmax: float, event_id: dict[str, int], freqs: ndarray | None = None, n_cycles: ndarray | float | None = None, channels: list[str] | None = None, mode: str = 'induced', baseline: tuple | None = (None, 0), decim: int = 4, info=None, montage: str = 'standard_1020', window_size: tuple[int, int] = (1440, 900), verbose: bool | str | None = None)[source]#

Bases: _MockQMainWindow

Real-time time-frequency representation (TFR).

Computes Morlet wavelet power for selected channels and displays as colour-coded heatmaps (time × frequency) after each new batch of epochs arrives via update().

Two modes:

  • induced: average of per-epoch TFR → total power (including non-phase-locked oscillations).

  • evoked: TFR of the trial average → only phase-locked power.

Baseline correction uses dB change: 10 * log10(power / baseline_mean).

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.

freqsndarray or None

Frequencies of interest (Hz). Default np.arange(4, 50, 2).

n_cyclesndarray, float, or None

Number of cycles per frequency for Morlet wavelets. Default freqs / 2 (half-cycle per frequency).

channelslist of str or None

Channels to display. When None, up to 4 channels are auto-selected (see _auto_channels()).

mode{‘induced’, ‘evoked’}

Computation mode. 'induced' averages per-epoch TFRs; 'evoked' computes the TFR of the trial average.

baselinetuple or None, default (None, 0)

Baseline interval (tmin, tmax) in seconds used for dB normalisation. None on either side means epoch edge.

decimint, default 4

Decimation factor applied along the time axis before display.

infomne.Info or None

Unused at present; reserved for future layout features.

window_sizetuple of int, default (1440, 900)

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], freqs: ndarray | None = None, n_cycles: ndarray | float | None = None, channels: list[str] | None = None, mode: str = 'induced', baseline: tuple | None = (None, 0), decim: int = 4, info=None, montage: str = 'standard_1020', window_size: tuple[int, int] = (1440, 900), verbose: bool | str | None = None) None[source]#

Methods

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

update(data, conditions)

Receive new epoch data and schedule a TFR recompute.

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

Receive new epoch data and schedule a TFR recompute.

Thread-safe. If a computation is already running the new data is stored and will be used at the next opportunity; the current run is not interrupted.

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

All accepted epochs accumulated so far.

conditionslist of str

Condition label for each epoch; len(conditions) == data.shape[0].