EEG sensors in montage visualization appear outside of the head circle

Hi, I am having an undesired visualization of the EEG montage

import mne
montage = mne.channels.make_standard_montage('standard_1020')
montage.plot()

The output is:
eeg_montage

However, another montage is fine

montage = mne.channels.make_standard_montage('biosemi64')
montage.plot()

eeg_montage2

Is it windows or MNE itself ?

My system is:

  • operating system : Windows 10
  • Python : 3.8.13
  • MNE : 1.0.3

Hello @joekid,

this is an excellent question and observation you’re reporting here.

I recently worked on some montage-related stuff in the MNE code, and it turned out that even in the core development team, there was (and probably still is, to some extent) quite some confusion or at least surprise in regards to how we deal with those “standard montages”.

Here is the gist:

Choice of built-in montages

  • The standard_* montages are based on idealized electrode placement but fitted to the fsaverage head. Use these montages if you intend to perform source localization.
  • Other montages, like biosemi64 in your example, are template montages provided by EEG cap manufacturers (in this case, Biosemi) and are usually placed on a perfect sphere (i.e., not on an actual or average head).

2D-visualization of montages

Because we store 3D coordinates for each EEG electrode, visualizing a montage in 2D is complicated, as there is not just one way to do it.

By default, MNE makes it such that the head circle represents the plane that goes through Nasion and Inion. This is why in the plot for your Biosemi montage, all electrodes are placed inside the head circle – which is a bit of an uncommon sight, at least for users coming from other EEG toolboxes like EEGLAB.

I believe the reason why this seems to be different for standard_1020 is that the electrodes there are placed on fsaverage. So be careful when directly comparing standard_* with the other built-in montages.

In MNE-Python 1.1 (to be released very soon), in all functions that produce topographic plots – including montage.plot() – you will be able to pass the parameter sphere='eeglab', which will make it such that the head circle is on the plane through Fpz and Oz. Please see the updated tutorial here:

https://mne.tools/dev/auto_tutorials/intro/40_sensor_locations.html#plotting-2d-sensor-locations-like-eeglab

Taken from this tutorial, this is an EEG montage plotted with the default settings:

And here with sphere='eeglab':

Again, this will only become available with MNE-Python 1.1.

I hope this helped clarify things a little bit!

Best wishes,
Richard

1 Like

Looking at this figure again, something doesn’t quite add up with my response above:

I said that the head circle is placed on the plane that is determined by Nasion and Inion; but here, it can be clearly seen that Iz – which I believe to be the Inion – is placed inside of the head circle.

@sappelhoff @cbrnr @larsoner Is there a bug in our code – or in my statement?

I have actually noticed that my code in “eeg_positions” for achieving Fpz,T7,Oz,T8 to lie on the head outline stopped working with some changes in mne. I used to use this code (taken from Mikolaj’s example):

# MNE always scales the electrode positions as if the equator were on the
# "Nz-T10-Iz-T9" contour.
# We need to counteract this with a few computations
chs = ["Oz", "Fpz", "T7", "T8"]
pos = np.stack([montage.get_positions()["ch_pos"][ch] for ch in chs])

radius = np.abs(pos[[2, 3], 0]).mean()

x = pos[0, 0]
y = pos[-1, 1]
z = pos[:, -1].mean()


montage.plot(sphere=(x, y, z, radius))

What it looks like (it’s not as expected):

However given that you nicely implemented this for mne 1.1 with sphere="eeglab" @richard, I just prepared a PR that I’ll merge once mne 1.1 is released … and there your code works perfectly well → use new sphere=eeglab by sappelhoff · Pull Request #13 · sappelhoff/eeg_positions · GitHub

I am just at a loss why Mikolaj’s code still seems to work in the mne stable release example and not in my eeg_positions :person_shrugging: :slightly_smiling_face:

2 Likes

Now I’m more confused than before – we are now talking about two different problems, right?

I think so, yes … :smiley:

yeah sorry, you can completely ignore my post :sweat:

I see the problem with Iz not lying on the head outline now.

1 Like