Montage
- class gpype.common.montage.Montage[source]
Bases:
objectOrdered electrode labels for the EEG channels of a source.
A montage names the signal channels of an acquisition device. It describes which electrode sits on which channel, and is supplied by the user because amplifiers do not report electrode names.
A montage covers the signal channels only. Auxiliary channels a device may stream alongside EEG - counter, saturation, battery, validity - are labelled by the source itself and are not part of the montage.
Positions are resolved from a built-in table of standard electrode names rather than stored per instance, so a montage stays cheap to serialise. Labels outside the table simply have no position.
Example
>>> m = Montage(["Fz", "Cz", "Pz", "C3", "C4", "O1", "O2", "Oz"]) >>> len(m) 8 >>> m.index_of("Cz") 1 >>> m.position_of("Cz") (0.0, 0.0)
- __init__(labels, reference=None)[source]
Initialize a montage from an ordered list of electrode labels.
- Parameters:
labels (
list[str]) – Electrode labels, in channel order. Historical names (T3, T4, T5, T6) are normalised to their 10-20 equivalents.reference (
Optional[str]) – Label or description of the hardware reference, e.g. “Cz” or “linked_mastoids”. Recorded as metadata only; re-referencing is a separate processing step.
- Raises:
ValueError – If labels is empty, contains non-strings, blank entries, or duplicates.
- classmethod standard_1020(labels, reference=None)[source]
Create a montage and require every label to be a 10-20 name.
Use this when a typo should be an error rather than an unnamed channel.
- property labels
Electrode labels in channel order.
- property reference
Hardware reference electrode or description, if known.
- property system
Name of the electrode system, if all labels belong to one.