Skip to content

METADATA.montage: 9 values MNE cannot build, and 31 loaders declare a montage they never apply #1164

Closed

Description

@bruAristimunha

What

Two related problems with AcquisitionMetadata.montage.

1. Values MNE cannot build. Nine distinct strings across the catalogue are not in mne.channels.get_builtin_montages():

value occurrences
10-10 8
10-20 7
10-5 3
extended 10-20 3
custom 2
af7 af3 afz af4 af8 f7 f5 ... (an entire electrode list) 2
5% grid system, Laplacian, … 1 each

make_standard_montage("10-10") raises ValueError; the real names are standard_1005 / standard_1020. #1161 corrects five of these (10-10 ×3 and standard_1010 ×2 in braininvaders.py) as a side effect of a channel fix, but the rest remain.

2. Declared but never applied. 31 loaders declare montage= in METADATA and contain no set_montage call anywhere, so the raws they return have no channel positions despite advertising a montage. Two spotted while working on #1161:

  • yi2025.py renames channels under the comment "Fix channel name case for standard_1005 montage" and then never applies it
  • yang2025.py sets channel types and never applies its declared standard_1005

Rodrigues2017 and Cattan2019_PHMD were in this state too — gh-700's changelog announced "fixing unit issue and lack of montage" for them, but the commit only scaled units. That went unnoticed for a full release cycle because nothing checks the claim.

Why it matters

Missing positions silently disable anything spatial: interpolation, topographic plots, Laplacian references, and channel-position-aware models. It fails quietly — you get data, just with no coordinates.

Why it cannot simply be automated today

The field is free text with one consumer, bids_interface.py:554, which passes it through as the BIDS EEGPlacementScheme prose. Only ~89 of 124 declarations name a real montage, so a base-class hook that did set_montage(METADATA.montage) would break on the other 35.

Suggested direction

  1. Normalise the field: either restrict it to get_builtin_montages() plus an explicit "custom" sentinel, or split it into a machine-readable montage_name and the free-text placement_scheme BIDS wants.
  2. Add an offline test asserting every non-custom value is buildable — this catches all nine cases with no downloads.
  3. Once (1) holds, consider a BaseDataset hook that applies the declared montage after _get_single_subject_data, so the declaration is the single source of truth rather than something each of ~150 loaders must remember to honour.

(3) is a behaviour change for the 31 loaders and belongs in a minor release; (1) and (2) are cheap and would have caught gh-700's unimplemented half.

Verification

import mne, re, pathlib
builtin = set(mne.channels.get_builtin_montages())
# 9 distinct unbuildable values across moabb/datasets/**.py

Activity

  1. bruAristimunha commented on Aug 26, 2026

    @bruAristimunha
    CollaboratorAuthor

    Correcting half of this issue — I filed it on a wrong premise.

    METADATA.montage is not meant to be an MNE montage name. Its only consumer is bids_interface.py:554, which uses it for the BIDS EEGPlacementScheme field, and the lookup right below it explicitly handles informal scheme names:

    montage_descriptions = {
        "standard_1005": "10-05 system",
        "standard_1020": "10-20 system",
        "10-20": "10-20 system",
        "10-05": "10-05 system",
        "10-10": "10-10 system",
        ...
    }

    So 10-10, 10-20 and 10-05 are correct values, not defects. Scratch those (14 of the 26 I counted). custom, Laplacian, 5% grid system and extended 10-20 are also legitimate prose for that BIDS field.

    What is wrong is narrower: values that look like MNE montage names but aren't. standard_1010 is the clear case — it is not in get_builtin_montages() and not in the lookup above, so it falls through verbatim and emits EEGPlacementScheme: "standard_1010", a name that exists nowhere. That one is fixed in #1161 (it was in alphawaves.py and braininvaders.py). One value is an entire space-separated electrode list, which is also clearly not intended.

    That leaves the genuinely useful half of this issue: 31 loaders declare a montage and never call set_montage, so their raws carry no channel positions. But given the field is prose, a base-class hook keyed on it is the wrong mechanism — it would have to guess which values are buildable. Per-loader set_montage where positions actually matter is the honest fix, and only two of those were biting anyone (Rodrigues2017 / Cattan2019_PHMD / Cattan2019_VR, all fixed in #1161).

    Suggest retitling this to just the missing-positions half, or closing it as low priority until someone needs positions on a specific dataset.

  2. bruAristimunha commented on Aug 26, 2026

    @bruAristimunha
    CollaboratorAuthor

    Closing — I filed this on a wrong premise and the remainder does not justify an open issue.

    The "9 unbuildable montage values" half was not a defect. METADATA.montage is prose, not an MNE montage name: its only consumer is bids_interface.py:554, which feeds it to the BIDS EEGPlacementScheme field, and the lookup immediately below already maps "10-20", "10-10" and "10-05" explicitly. Those are correct values. custom, Laplacian and extended 10-20 are legitimate prose for that field too.

    What was genuinely wrong — values that look like MNE names but are not, i.e. standard_1010 falling through verbatim to emit a scheme name that exists nowhere — is fixed in #1161, along with the three datasets that actually lacked a montage (Rodrigues2017, Cattan2019_PHMD, Cattan2019_VR).

    That leaves "31 loaders declare a montage they never apply". It is real, but since the field is prose a base-class hook keyed on it would have to guess which values are buildable — the wrong mechanism. Per-loader set_montage where positions actually matter is the honest fix, and the only three that were biting anyone are done. Reopen if someone needs positions on a specific dataset.

    Apologies for the noise — I should have read the consumer before filing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions