Montage Matching Q.

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: e.g. 1.42
  • operating system: Windows 11

When I created a montage suitable for me from the standard 1020 montage, I found that the position of the leads did not match the head very well. How to make electrodes appear reasonably sparse in the human head? Instead of still having a large blank in the occipital lobe.

My code following:(The raw file has 68 channels,but I just need 60 of them.)

#drop some channels
channels_to_drop = [‘EMG’, ‘VEO’,‘M1’,‘M2’,‘EKG’,‘HEO’,‘CB1’,‘CB2’]
raw.drop_channels(channels_to_drop)

#replacement
new_channels = [‘Fp1’,‘Fpz’,‘Fp2’,‘AF3’,‘AF4’,‘F7’,‘F5’,‘F3’,‘F1’, ‘Fz’,
‘F2’,‘F4’,‘F6’,‘F8’,‘FT7’,‘FC5’,‘FC3’,‘FC1’,‘FCz’,‘FC2’,
‘FC4’,‘FC6’,‘FT8’,‘T7’,‘C5’,‘C3’,‘C1’,‘Cz’,‘C2’,‘C4’,‘C6’,
‘T8’,‘TP7’,‘CP5’,‘CP3’,‘CP1’,‘CPz’,‘CP2’,‘CP4’,‘CP6’,‘TP8’,
‘P7’,‘P5’,‘P3’,‘P1’,‘Pz’,‘P2’,‘P4’,‘P6’,‘P8’,‘PO7’,‘PO5’,‘PO3’,
‘POz’,‘PO4’,‘PO6’,‘PO8’,‘O1’,‘Oz’,‘O2’]
original_channels = raw.ch_names

mapping

channel_mapping = {original_channels[i]: new_channels[i] for i in range(len(original_channels))}

rename

raw.rename_channels(channel_mapping)

#set montage

Form the 10-20 montage

mont1020 = mne.channels.make_standard_montage(‘standard_1020’)

Choose what channels you want to keep

Make sure that these channels exist e.g. T1 does not exist in the standard 10-20 EEG system!

kept_channels = [‘Fp1’,‘Fpz’,‘Fp2’,‘AF3’,‘AF4’,‘F7’,‘F5’,‘F3’,‘F1’, ‘Fz’,
‘F2’,‘F4’,‘F6’,‘F8’,‘FT7’,‘FC5’,‘FC3’,‘FC1’,‘FCz’,‘FC2’,
‘FC4’,‘FC6’,‘FT8’,‘T7’,‘C5’,‘C3’,‘C1’,‘Cz’,‘C2’,‘C4’,‘C6’,
‘T8’,‘TP7’,‘CP5’,‘CP3’,‘CP1’,‘CPz’,‘CP2’,‘CP4’,‘CP6’,‘TP8’,
‘P7’,‘P5’,‘P3’,‘P1’,‘Pz’,‘P2’,‘P4’,‘P6’,‘P8’,‘PO7’,‘PO5’,‘PO3’,
‘POz’,‘PO4’,‘PO6’,‘PO8’,‘O1’,‘Oz’,‘O2’]
ind = [i for (i, channel) in enumerate(mont1020.ch_names) if channel in kept_channels]
mont1020_new = mont1020.copy()

Keep only the desired channels

mont1020_new.ch_names = [mont1020.ch_names for x in ind]
kept_channel_info = [mont1020.dig[x+3] for x in ind]

Keep the first three rows as they are the fiducial points information

mont1020_new.dig = mont1020.dig[0:3]+kept_channel_info

replacement

raw.set_montage(mont1020_new)

!!! when I set ‘sphere = (0.0,0.0,0.0,0.09)’,the topomap was:
image

This is due to the projection of the electrode location (3D) on a plane. You can tune this to your liking by changing the sphere argument in the topomap plotting function.

e.g.

from matplotlib import pyplot as plt
from mne.channels import make_standard_montage


f, ax = plt.subplots(1, 3, figsize=(20, 5))
montage = make_standard_montage("standard_1020")
ax[0].set_title("sphere=None")
montage.plot(kind="topomap", sphere=None, axes=ax[0])
ax[1].set_title("sphere='eeglab'")
montage.plot(kind="topomap", sphere="eeglab", axes=ax[1])
ax[2].set_title("sphere=(0, 0.02, 0, 0.095)")
montage.plot(kind="topomap", sphere=(0, 0.02, 0, 0.095), axes=ax[2])

Mathieu

2 Likes

Thank you so much~