- MNE version: e.g. 1.11.0
- operating system: e.g. Windows 11
I want to plot a 3D topomap using only EEG data and sensor position (64 channels). How to implement? I have no MEG data. Any resources will be highly appreciated. Thanks in advance.
I want to plot a 3D topomap using only EEG data and sensor position (64 channels). How to implement? I have no MEG data. Any resources will be highly appreciated. Thanks in advance.
I’m not sure we currently support that. I was initially thinking to call mne.make_field_map followed by mne.viz.plot_evoked_field, but we would need some sort of 3D mesh of a standard head to draw the topomap on, and we don’t have a good one for this purpose (the “fsaverage” template looks weird without a nose
)
One could use the head from the “sample” dataset I suppose… but beware that this may be inaccurate.
import mne
# Use the "kiloword" EEG dataset for this example. It has 32 channels.
path = mne.datasets.kiloword.data_path()
# Read EEG epochs.
epochs = mne.read_epochs(path / "kword_metadata-epo.fif")
# Set channel positions based on the 10-5 system.
epochs.set_montage("standard_1005")
# Compute the ERP.
evoked = epochs.average()
# Use the "sample" head to draw the topomap on.
sample_path = mne.datasets.sample.data_path()
trans = sample_path / "MEG/sample/sample_audvis_raw-trans.fif"
# Create the 3D topomap.
fieldmap = mne.make_field_map(
evoked,
subject="sample",
subjects_dir=sample_path / "subjects",
trans=trans,
)
evoked.plot_field(fieldmap)
Thanks a ton! It works. I had to apply simple scaling in my case, as my data was not in volts. However, I do see some discrepancies between the topomap and the 3D field map; they are not exactly similar. I may not fully understand the underlying process for generating the 3D field map. Could you enlighten me?
they are not similar, and I warned you it may be inaccurate, because the standard EEG electrodes positions follow a perfect sphere. However, the head is not a perfect sphere. The EEG positions get projected somewhat awkwardly on the head of this particular subject, which also probably doesn’t match the head of the actual subject. I think that, and of course the fact that a different color map is used, explains most of the discrepancy.
I think a word of caution is in order here: do not trust the 3d topomap we are cobbling together here. Do not use this for a figure in a scientific publication.