CLI#
MNE-RT provides an mne-rt shell command with five sub-commands.
mne-rt --help
mne-rt --version
mne-rt info
mne-rt demo [options]
mne-rt demo-erp [options]
mne-rt baseline --subject ID --subjects-dir DIR [options]
mne-rt run --subject ID --subjects-dir DIR --duration N [options]
Global options:
Flag |
Default |
Description |
|---|---|---|
|
WARNING |
Logging verbosity level: |
mne-rt info#
Print the installed MNE-RT version and all key dependency versions.
$ mne-rt info
MNE-RT — Real-Time M/EEG Analysis
──────────────────────────────────
mne-rt version : 1.0.0
Python : 3.11.9
mne : 1.8.0
...
mne-rt demo#
Launch a full demo real-time session from simulated EEG (no amplifier needed).
The real-time scalp topomap (δ/θ/α/β/γ) is shown by default. The 3-D brain
display is enabled automatically when a FreeSurfer fsaverage5 directory
is found (via FREESURFER_HOME or --subjects-fs-dir).
$ mne-rt demo
$ mne-rt demo --duration 120 --modality sensor_power erd_ers
$ mne-rt demo --no-topomap
$ mne-rt demo --no-brain
Options:
Flag |
Default |
Description |
|---|---|---|
|
120 |
Session duration in seconds |
|
sensor_power band_ratio entropy hjorth |
Feature modality(ies) to demonstrate |
|
1.0 |
Analysis window length (s) |
|
— |
Disable the scrolling real-time NF signal plot ( |
|
— |
Disable the scrolling raw M/EEG viewer ( |
|
— |
Disable the real-time scalp topomap (enabled by default) |
|
— |
Disable 3-D brain display (auto-enabled when FreeSurfer is found) |
|
— |
FreeSurfer subjects directory (auto-detected from |
|
inflated |
Brain surface geometry ( |
|
0.25 |
EMA smoothing factor applied to each feature value ( |
|
— |
Skip saving session data and report |
mne-rt demo-erp#
Launch an ERP demo that streams MNE sample-dataset EEG through a mock LSL
player, collects auditory epochs trial-by-trial via RTEpochs,
and drives the four epoch visualisation windows.
Downloads the MNE sample dataset on first run (~1.5 GB).
$ mne-rt demo-erp # all four plot windows
$ mne-rt demo-erp --n-trials 50 # stop after 50 trials
$ mne-rt demo-erp --no-tfr # skip the TFR heatmap
$ mne-rt demo-erp --no-compare --no-tfr # TopoPlot + ButterflyPlot only
Options:
Flag |
Default |
Description |
|---|---|---|
|
70 |
Number of EEG trials to collect before stopping |
|
— |
Disable the scalp-layout |
|
— |
Disable the |
|
— |
Disable |
|
— |
Disable the |
mne-rt baseline#
Record a resting-state baseline and compute the noise covariance and inverse operator needed for source-space modalities.
$ mne-rt baseline --subject sub01 --subjects-dir /data/subjects
$ mne-rt baseline --subject sub01 --subjects-dir /data --duration 180 --mock
$ mne-rt baseline --subject sub01 --subjects-dir /data --mock \
--fname /path/to/recording.fif
Required:
--subject ID— subject identifier string--subjects-dir DIR— root directory with one folder per subject
Options:
Flag |
Default |
Description |
|---|---|---|
|
120 |
Baseline duration in seconds |
|
01 |
BIDS session label (e.g. |
|
— |
Use simulated data instead of live LSL |
|
— |
Any MNE-readable file ( |
|
easycap-M1 |
EEG montage name or |
|
eeg |
|
|
— |
FreeSurfer subjects directory (required for source-space modalities) |
mne-rt run#
Run a real-time M/EEG session with feature extraction, feedback protocols, and live visualisation.
$ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
--modality sensor_power erd_ers
# With epoch plots (requires a stimulus channel in the recording)
$ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
--modality sensor_power \
--topo --tfr --stim-ch "STI 014" \
--event-id left=1 right=2
# With topomap display
$ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
--modality sensor_power --topomap
# With OSC output to Max/MSP
$ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
--modality sensor_power --osc-host 127.0.0.1 --osc-port 9000
# With LSL output (faster, same-machine integration)
$ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
--modality sensor_power --lsl-output
# From a mock file with artifact correction
$ mne-rt run --subject sub01 --subjects-dir /data --duration 300 \
--mock --fname /data/sub01/session.fif \
--artifact-correction asr --topo
Options (inherits all baseline flags above, plus):
Flag |
Default |
Description |
|---|---|---|
|
required |
Session duration in seconds |
|
sensor_power |
One or more feature modalities (space-separated). See table below. |
|
1.0 |
Analysis window length (s) |
|
— |
|
|
— |
Disable the scrolling real-time NF signal plot ( |
|
— |
Disable the scrolling raw M/EEG viewer ( |
|
— |
Enable real-time scalp topomap (δ/θ/α/β/γ bands) |
|
— |
Enable 3-D brain display (requires inverse operator) |
|
— |
Enable |
|
— |
Enable |
|
— |
Enable |
|
— |
Enable |
|
— |
Stimulus/trigger channel name, e.g. |
|
-0.1 |
Epoch start relative to stimulus (s) |
|
0.5 |
Epoch end relative to stimulus (s) |
|
stimulus=1 |
Condition definitions as |
|
inflated |
Brain surface geometry |
|
— |
Enable OSC output; target hostname (e.g. |
|
9000 |
OSC destination port |
|
/mne_rt |
OSC address prefix |
|
— |
Push feature values into an LSL stream outlet (faster than OSC for same-machine integration; readable by PsychoPy, Psychtoolbox, …) |
|
MNE_RT |
LSL stream name (only with |
|
0.25 |
EMA smoothing factor applied to each feature value ( |
Available feature modalities#
Modality key |
Description |
|---|---|
|
Mean band power across channels |
|
Power ratio between two frequency bands (e.g. θ/β) |
|
Event-related de/synchronisation (baseline normalised) |
|
Log power asymmetry between right and left hemispheres |
|
ERD/ERS computed separately per hemisphere |
|
Hjorth activity, mobility, complexity (time-domain) |
|
Frequency-weighted spectral centroid |
|
Spectral, approximate, or sample entropy |
|
Dominant frequency peak |
|
Power at the individualised spectral peak |
|
Cross-frequency coupling (sensor space) |
|
Instantaneous phase and amplitude envelope via Hilbert analytic signal |
|
Slow cortical potential — low-pass mean amplitude shift (DC-coupled) |
|
Real-time peak alpha frequency tracker with EMA smoothing |
|
Functional connectivity (coh, plv, pli, wpli, corr, …); method set in config |
|
Ratio of connectivity between two channel pairs (e.g. C3–C4 / F3–F4) |
|
Graph-Laplacian learning from sensor connectivity |
|
Source-space band power (requires inverse operator) |
|
Source-space functional connectivity |
|
Graph-Laplacian learning from source connectivity |
For the mathematical background of every modality, see Real-time Feature Modalities.
Real-time visualisation#
All eight plot windows are available as CLI flags and can be combined freely:
Flag |
Plot class |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The first four (--nf, --raw, --topomap, --brain) work with
continuous feature extraction (mne-rt run). The epoch-based windows
(--epoch-plot, --erp, --butterfly, --compare-evoked, --tfr)
require --stim-ch. Use mne-rt demo-erp to try them without a live recording.
See Visualisation for screenshots and feature descriptions of each plot.