mne_rt.modalities.ModalityMixin#

class mne_rt.modalities.ModalityMixin[source]#

Bases: object

Feature-extraction engine for all MNE-RT NF modalities.

ModalityMixin is mixed into RTStream and provides the prep / compute pair for every modality:

  • Prep (_<modality>_prep()) — runs once before the main loop. Returns a dict of pre-computed artefacts (filter coefficients, index arrays, connectivity indices, …) that are passed as keyword arguments to the compute step.

  • Compute (_<modality>(data, **prep_kwargs)) — runs every window inside a thread-pool worker. Decorated with timed() so it returns (value, elapsed_seconds).

Supported modalities (20 total)

Sensor-space power & time-domain

sensor_power, band_ratio, erd_ers, laterality, laterality_erd_ers, hjorth, spectral_centroid, argmax_freq, individual_peak_power, entropy, instantaneous_phase, scp, peak_alpha_freq

Sensor-space connectivity & graph

sensor_connectivity, connectivity_ratio, cfc_sensor, sensor_graph

Source-space

source_power, source_connectivity, source_graph

Notes

All methods are private (single-underscore prefix) and are called internally by record_main(). To extend MNE-RT with a custom modality, sub-class RTStream and add a matching _<name>_prep / _<name> pair following the same pattern.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)