Commit bd656af
committed
Use MNE as source of truth for canonical montages
The previous hand-rolled spherical formulas in montages.js were off by up
to 76° for Fp1/Fp2 and 43° for T7/T8 compared to MNE's canonical templates.
The bug: sph(az, el) treated 'el' as elevation from equator, but the
formula's call sites passed values intending polar-from-vertex. Symmetric
54° offset error throughout.
Replacement: scripts/build-canonical-montages.py pulls MNE's 12 canonical
templates (standard_1020, standard_1005 filtered for 10-10 / full 10-05,
biosemi 16/32/64/128/256, GSN-HydroCel 128/256, mgh60, easycap-M1) and
emits a frozen JSON. montages.js becomes a 16-line loader that just
inlines the data.
For BioSemi 256 specifically, A1 is now at (0, 0, 0.095m) = vertex, which
matches BioSemi's published layout and FieldTrip's biosemi256.lay
reference. Previously A1 rendered wherever the dataset-specific TSV
placed it; now the built-in 'BioSemi 256' montage ships MNE's canonical
positions.
Also added biosemi256, egi256, mgh60, and easycap-M1 to the montage
picker (previously only 8 options; now 12).
Regenerate: python3 scripts/build-canonical-montages.py1 parent 15611f7 commit bd656af
4 files changed
Lines changed: 32705 additions & 250 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
0 commit comments