braindecode.preprocessing.SetMontage#

class braindecode.preprocessing.SetMontage(montage, match_case=True, match_alias=False, on_missing='raise', verbose=None)[source]#

Braindecode preprocessor wrapper for set_montage().

Set EEG/sEEG/ECoG/DBS/fNIRS channel positions and digitization points.

Parameters:
  • montage (None | str | DigMontage) – A montage containing channel positions. If a string or DigMontage is specified, the existing channel information will be updated with the channel positions from the montage. Valid strings are the names of the built-in montages that ship with MNE-Python; you can list those via mne.channels.get_builtin_montages(). If None (default), the channel positions will be removed from the Info.

  • match_case (bool) –

    If True (default), channel name matching will be case sensitive.

    Added in version 0.20.

  • match_alias (bool | dict) –

    Whether to use a lookup table to match unrecognized channel location names to their known aliases. If True, uses the mapping in mne.io.constants.CHANNEL_LOC_ALIASES. If a dict is passed, it will be used instead, and should map from non-standard channel names to names in the specified montage. Default is False.

    Added in version 0.23.

  • on_missing ('raise' | 'warn' | 'ignore') –

    Can be 'raise' (default) to raise an error, 'warn' to emit a warning, or 'ignore' to ignore when channels have missing coordinates.

    Added in version 0.20.1.

  • verbose (bool | str | int | None) – Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:

inst (same type as the input data) – The instance, modified in-place.

Notes

Warning

Only EEG/sEEG/ECoG/DBS/fNIRS channels can have their positions set using a montage. Other channel types (e.g., MEG channels) should have their positions defined properly using their data reading functions.

Warning

Applying a montage will only set locations of channels that exist at the time it is applied. This means when re-referencing make sure to apply the montage only after calling mne.add_reference_channels()

Examples using braindecode.preprocessing.SetMontage#

Comprehensive Preprocessing with MNE-based Classes

Comprehensive Preprocessing with MNE-based Classes