Adapt electrode montage to fsaverage head model


I want to use a standard electrode montage with the fsaverage template to build a forward model. I have seen in the documentation that only some electrode montages are in the fsaverage MRI space. Unfortunately the two I’m interested in are not :cry:
I also checked with the mne.viz.plot_alignment function the positions of the electrodes with respect to the source space and the scalp, and some electrodes are completely inside the head (under the scalp, very close to the sources).

So my question would be how can I use one of these electrode montages with fsaverage?
I saw some related posts using the gui, I am not used to this, is there a solution not using it?

Here is the code I used to load the montage and head model and check is the electrode positions are consistent with the head model.

import mne
import os
import numpy as np
import matplotlib.pyplot as plt
from mne.datasets import fetch_fsaverage

fs_dir = fetch_fsaverage(verbose=True)
sibjects_dir = os.path.dirname(fs_dir)

subject = "fsaverage"
trans = "fsaverage"
src = os.path.join(fs_dir, "bem", "fsaverage-ico-5-src.fif")
bem = os.path.join(fs_dir, "bem", "fsaverage-5120-5120-5120-bem-sel.fif")

montage = mne.channels.make_standard_montage('easycap-M10')
info = mne.create_info(
    ch_types=['eeg']*len(montage.ch_names), verbose=0)

mne.viz.plot_alignment(info, src=src, eeg='original', trans=trans)

Thank you very much for your help,

Hello @Sarah, simply use the standard_1005 montage.

Even though the topoplots might look a little different from what you’re used to from working with other template montages, this one is actually co-registered to the fsaverage head — no need for you to perform any coregistration! When you use this montage and some function demands a trans parameter, you can simply pass 'fsaverage' and you’ll be good.

Since you don’t have measured electrode locations, this is really the easiest and “safest” approach.

Best wishes,

Hello @richard,

Thank you for your answer. I tried using the standard_1020 montage (if I understood properly it is also co-registered to the fsaverage head).
Is it normal that in the topoplot it looks as if the electrodes where not “centered” on the head (I joined an image of what I get) ? Is this what you mentioned ?

This solution is enough for what I am doing, thanks again, however I would have liked to understand how to do with other electrode montage, because it proves the notion of coregistration and coordinate space are not very clear to me. What I would need is to register the electrode locations to the MRI frame of the head ?

Best regards,