mne_rt.combiners.FeatureCombiner#

class mne_rt.combiners.FeatureCombiner(features: list[str] | None = None)[source]#

Bases: object

Abstract base class for multi-feature NF combiners.

Subclass this and implement combine() to define a custom mixing strategy. All combiners share the same one-method interface so they can be swapped in without changing the surrounding pipeline code.

Parameters:
featureslist of str | None, default None

Ordered list of modality names this combiner expects. If None the combiner accepts any keys present in the dict passed to combine(). Subclasses may require this to be set at construction time (e.g. WeightedSumCombiner).

Notes

Pass an instance to record_main() as combiner=. It then receives a snapshot dict {modality_name: float} once per analysis window, after z-scoring and EMA smoothing. The returned scalar is appended as an additional trace (combined_name, "combined" by default) — the per-modality values are kept, not replaced — and that trace is plotted, saved, broadcast over OSC/LSL, and can drive its own protocol.

Only ZScoredNormCombiner normalises internally. For the others, use record_main(zscore_normalize=True) when mixing features whose units differ in scale, or one will dominate the result.

__init__(features: list[str] | None = None) None[source]#

Methods

__init__([features])

combine(values)

Reduce a dict of per-modality NF values to one scalar.

combine(values: dict[str, float]) float[source]#

Reduce a dict of per-modality NF values to one scalar.

Parameters:
valuesdict[str, float]

Mapping of {modality_name: current_value} for all active modalities in the current window.

Returns:
mixedfloat

Single combined NF value passed downstream to the protocol and display.