Repository navigation
Description
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.pyrenames channels under the comment "Fix channel name case for standard_1005 montage" and then never applies ityang2025.pysets channel types and never applies its declaredstandard_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
- Normalise the field: either restrict it to
get_builtin_montages()plus an explicit"custom"sentinel, or split it into a machine-readablemontage_nameand the free-textplacement_schemeBIDS wants. - Add an offline test asserting every non-
customvalue is buildable — this catches all nine cases with no downloads. - Once (1) holds, consider a
BaseDatasethook 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
bruAristimunha commentedon Aug 26, 2026
Correcting half of this issue — I filed it on a wrong premise.
METADATA.montageis not meant to be an MNE montage name. Its only consumer isbids_interface.py:554, which uses it for the BIDSEEGPlacementSchemefield, and the lookup right below it explicitly handles informal scheme names:So
10-10,10-20and10-05are correct values, not defects. Scratch those (14 of the 26 I counted).custom,Laplacian,5% grid systemandextended 10-20are also legitimate prose for that BIDS field.What is wrong is narrower: values that look like MNE montage names but aren't.
standard_1010is the clear case — it is not inget_builtin_montages()and not in the lookup above, so it falls through verbatim and emitsEEGPlacementScheme: "standard_1010", a name that exists nowhere. That one is fixed in #1161 (it was inalphawaves.pyandbraininvaders.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-loaderset_montagewhere 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.
Derive n_channels from channel_types, and fix the download job's path
Derive n_channels from channel_types, and fix the download job's path
bruAristimunha commentedon Aug 26, 2026
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.montageis prose, not an MNE montage name: its only consumer isbids_interface.py:554, which feeds it to the BIDSEEGPlacementSchemefield, and the lookup immediately below already maps"10-20","10-10"and"10-05"explicitly. Those are correct values.custom,Laplacianandextended 10-20are legitimate prose for that field too.What was genuinely wrong — values that look like MNE names but are not, i.e.
standard_1010falling 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_montagewhere 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.