mne_rt.viz.NFPlot#

class mne_rt.viz.NFPlot(modalities: list[str], scales_dict: dict[str, float], sfreq: float, time_window: float = 10.0, display_smoothing: float = 0.3, verbose=None)[source]#

Bases: _MockQMainWindow

Scrolling real-time neurofeedback signal monitor.

Displays one colour-coded trace per active NF modality in a dark-themed pyqtgraph.PlotWidget. Designed to be driven by record_main() via push().

Parameters:
modalitieslist of str

Names of the active NF modalities. One scrolling trace is shown per entry. Names must match entries in _LABELS for a human-readable legend, or the raw string is used as a fallback.

scales_dictdict[str, float]

Mapping from modality name to its physical display scale. The raw NF value is divided by this scale before plotting so that all traces occupy a similar vertical range.

sfreqfloat

Nominal update rate in Hz. Used to size the ring buffer.

time_windowfloat, default 10.0

Visible time range in seconds at startup (can be changed at runtime from the control panel).

verbosebool | str | None, default None

Verbosity level. See set_log_level().

See also

mne_rt.viz.BrainPlot

3D brain activation display.

mne_rt.viz.RawPlot

Scrolling raw M/EEG channel viewer.

mne_rt.RTStream.record_main

Drives both plots from the NF loop.

Notes

The control panel (right sidebar) provides:

  • Playback — pause/resume, clear buffer, screenshot.

  • Display — time-window selector, grid toggle, auto-range.

  • Channel Scales — per-modality amplitude scaling with + / buttons and a live ×N readout.

Status bar shows the latest value for every active modality.

Examples

Minimal offline usage:

>>> app = QApplication([])
>>> plot = NFPlot(["sensor_power"], {"sensor_power": 1e-12}, sfreq=100)
>>> plot.show()
>>> plot.push([3.2e-13])
>>> app.exec()

Added in version 1.0.0.

__init__(modalities: list[str], scales_dict: dict[str, float], sfreq: float, time_window: float = 10.0, display_smoothing: float = 0.3, verbose=None) None[source]#

Methods

__init__(modalities, scales_dict, sfreq[, ...])

closeEvent(event)

push(new_vals)

Append one new sample per modality and refresh all traces.

push(new_vals: list[float]) None[source]#

Append one new sample per modality and refresh all traces.

This is the main update entry point, called at ~30 fps by the Qt pump timer inside record_main().

Parameters:
new_valslist of float

Latest NF value for each active modality, in the same order as the modalities list passed to __init__().

Notes

The call is a no-op when the plot is paused (⏸ button pressed). Each value is normalised by its entry in scales_dict before being written into the ring buffer, so all traces share a common vertical scale.

closeEvent(event) None[source]#