Hi all,
For what I hope to be a new addition to the MNE ecosystem (GitHub - GWeindel/hsmm_mvpy: Repository for the hsmm-mvpy package) I am looking to extract and use x,y position of EEG electrodes and feed them to plot_topomap()
. I want users to be able to specify positions without having to read raw data and apply a montage on it (e.g. if someone has channel locations from another source than MNE).
It works nicely with EEGLAB channel output but when I try using only x,y positions from an mne.montage I fail to reproduce the result from plot_topomap()
when using the raw.info with the same montage
I guess this is my misunderstanding of the way topomap and montages work and not a bug so I only post an example of how I do it but can provide a minimal working example if needed
raw = mne.io.read_raw_brainvision("MD3-%s.vhdr"%subj_num, preload =False)
raw.set_montage('easycap-M1')#Standard 1020 electrode montage
montage = raw.info.get_montage().get_positions()['ch_pos']
positions = np.array([montage[x][:2] for x in eeg_data['electrodes'].values])#Extract x and y positions of each electrode
When plotting, feeding raw.info
to plot_topomap()
gives the expected result:
but feeding positions
does not
What am I missing?
Best,
Gabriel
- MNE version: 1.0.3
- operating system: Ubuntu 20.04