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:
_MockQMainWindowReal-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_names
listofstr Electrode names in data order.
- sfreq
float Sampling frequency in Hz.
- tmin
float Epoch start (s).
- tmax
float Epoch end (s).
- event_id
dict[str,int] Condition label → marker integer.
- freqs
ndarrayorNone Frequencies of interest (Hz). Default
np.arange(4, 50, 2).- n_cycles
ndarray,float, orNone Number of cycles per frequency for Morlet wavelets. Default
freqs / 2(half-cycle per frequency).- channels
listofstrorNone 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.- baseline
tupleorNone, default (None, 0) Baseline interval
(tmin, tmax)in seconds used for dB normalisation.Noneon either side means epoch edge.- decim
int, default 4 Decimation factor applied along the time axis before display.
- info
mne.InfoorNone Unused at present; reserved for future layout features.
- window_size
tupleofint, default (1440, 900) Initial window size in pixels.
- verbosebool,
str, orNone - .. versionadded:: 1.0.0
- ch_names
See also
mne_rt.RTEpochsDrives 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.