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:
_MockQMainWindowScrolling real-time neurofeedback signal monitor.
Displays one colour-coded trace per active NF modality in a dark-themed
pyqtgraph.PlotWidget. Designed to be driven byrecord_main()viapush().- Parameters:
- modalities
listofstr Names of the active NF modalities. One scrolling trace is shown per entry. Names must match entries in
_LABELSfor a human-readable legend, or the raw string is used as a fallback.- scales_dict
dict[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.
- sfreq
float Nominal update rate in Hz. Used to size the ring buffer.
- time_window
float, default 10.0 Visible time range in seconds at startup (can be changed at runtime from the control panel).
- verbosebool |
str|None, defaultNone Verbosity level. See
set_log_level().
- modalities
See also
mne_rt.viz.BrainPlot3D brain activation display.
mne_rt.viz.RawPlotScrolling raw M/EEG channel viewer.
mne_rt.RTStream.record_mainDrives 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×Nreadout.
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_vals
listoffloat Latest NF value for each active modality, in the same order as the
modalitieslist passed to__init__().
- new_vals
Notes
The call is a no-op when the plot is paused (⏸ button pressed). Each value is normalised by its entry in
scales_dictbefore being written into the ring buffer, so all traces share a common vertical scale.