How can I change the style of my topographic maps?

MNE 1.3.0
MacOS BigSur 11.6.7

My topographic maps are looking a little weird, for example when visualizing ICA components with the following code:

raw = mne.io.read_raw_eeglab('data/participant/sub-01_task-rsvp_continuous.set', preload=True)
filt_raw = raw.copy().filter(l_freq=1., h_freq=None)
ica = ICA(n_components=62, max_iter='auto', random_state=97)
ica.fit(filt_raw)

They look like this:

I’m not familiar with this type of topographic map and don’t know how to interpret it. I would like to generate maps of the type in the tutorials which I’m familiar with, which look like this:

Does anyone know how to change this? Thanks in advance :slight_smile:

Hello,

That’s some very artistic maps :slight_smile:
Could you share a complete code snippet all the way to the plot and the data file that is causing these plots?
I suspect a scaling issue on the electrode location (montage) which then messes up the interpolation on the maps.

Mathieu

Hi! Thanks for the quick response!

Here is the minimal code to recreate the weirdo maps:

import mne
from mne.preprocessing import (ICA)

raw = mne.io.read_raw_eeglab('data/participant/sub-01_task-rsvp_continuous.set', preload=True)
filt_raw = raw.copy().filter(l_freq=1., h_freq=None)
ica = ICA(n_components=62, max_iter='auto', random_state=97)
ica.fit(filt_raw)
ica.plot_components()

How can I also upload the data? I can tell you where it’s from, which is here:
https://openneuro.org/datasets/ds003825/versions/1.2.0
If you navigate to derivatives/eeglab then you have a collection of .set and .fdt files. My example uses the first one.

Cheers!

So, it’s a bit difficult to reproduce because those files tend to crash my interpreter for some reason… especially when trying to plot the raw time-series. But anyway, it is a scaling issue of the montage (the electrode location).

When loading the file, you are greeted with:

RuntimeWarning: Estimated head radius (0.2 cm) is below the 3rd percentile for infant head size. Check if the montage_units argument is correct (the default is “mm”, but your channel positions may be in different units).

And indeed, here is the loaded montage compared to the default head:

raw.get_montage().plot()

Instead, you should provide the argument montage_units to the reader to correctly load the montage.

from mne.io import read_raw_eeglab

raw = read_raw_eeglab(file, montage_units="dm")
raw.get_montage().plot()


Note that I’m not convinced that "dm" is the correct unit, and since:

  • the montage seems to be a template and not an actual measured montage (which are usually not that symmetric)
  • the electrode seems to respect the standard 10/05

You could simply replace the loaded montage with a template provided by MNE.

from mne.io import read_raw_eeglab

raw = read_raw_eeglab(file, montage_units="dm")
raw.set_montage("standard_1005")
raw.get_montage().plot()

That should fix the topographic maps produce from those files.

Mathieu

1 Like

Thanks! This has fixed it!