Regression in "How to plot topomaps the way EEGLAB does" example - montage.get_positions() returns different positions than the channel positons in evoked object.
See original GitHub issueHi, I just noticed that the How to plot topomaps the way EEGLAB does example no longer shows correct EEGLAB-like channel layout: the two layouts are the same on the current development and stable versions (0.23), which is incorrect. On version 0.22 these layouts are different (and correct):
The sphere parameters used in the example are not the same as before and this seems due to a change in how channel positions are obtained. Previously they were dug out from .info['chs']
dictionary, now montage.get_positions()
is used. However these two are not exchangable because the applied montage is in head coordinates, while the positions returned by .get_positions()
show ‘unknown’ coord_frame.
In the same example doing:
pos_mntg = biosemi_montage.get_positions()['ch_pos']['Oz']
ch_idx = fake_evoked.ch_names.index('Oz')
pos_evkd = fake_evoked.info['chs'][ch_idx]['loc'][:3]
print([f'{v:0.5f}' for v in pos_mntg])
print([f'{v:0.5f}' for v in pos_evkd])
gives different positions:
['0.00000', '-0.09494', '-0.00332']
['0.00000', '-0.09494', '0.03683']
I’m not sure what the best solution should be - is the intent of montage.get_positions()
is to give channel positions in unknown coord frame? If so, the example should be reverted to use the old and ugly .info['chs'][idx]['loc'][:3]
way of obtaining channel positions.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Yep, that fixed it. Making a PR.
@alexrockhill That makes sense (your previous post about changing default to head) as MNE (as far as I know) defines head coordinates with respect to fiducial positions (z = 0), while the biosemi positions are likely in a coordinate system where Oz is at z=0 (which is exactly what the example tries to do - move the sphere origin a bit higher to be at the z level of Oz channel).