Plotting sensor layouts of EEG Systems

This example illustrates how to load all the EEG system montages shipped in MNE-python, and display it on fsaverage template.

# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#          Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.

import os.path as op

import mne
from mne.channels.montage import get_builtin_montages
from mne.datasets import fetch_fsaverage
from mne.viz import set_3d_title, set_3d_view

Check all montages against a sphere

for current_montage in get_builtin_montages():
    montage = mne.channels.make_standard_montage(current_montage)
    info = mne.create_info(
        ch_names=montage.ch_names, sfreq=100., ch_types='eeg', montage=montage)
    sphere = mne.make_sphere_model(r0='auto', head_radius='auto', info=info)
    fig = mne.viz.plot_alignment(
        # Plot options
        show_axes=True, dig='fiducials', surfaces='head',
        bem=sphere, info=info)
    set_3d_view(figure=fig, azimuth=135, elevation=80)
    set_3d_title(figure=fig, title=current_montage)
  • ../../_images/sphx_glr_plot_montage_001.png
  • ../../_images/sphx_glr_plot_montage_002.png
  • ../../_images/sphx_glr_plot_montage_003.png
  • ../../_images/sphx_glr_plot_montage_004.png
  • ../../_images/sphx_glr_plot_montage_005.png
  • ../../_images/sphx_glr_plot_montage_006.png
  • ../../_images/sphx_glr_plot_montage_007.png
  • ../../_images/sphx_glr_plot_montage_008.png
  • ../../_images/sphx_glr_plot_montage_009.png
  • ../../_images/sphx_glr_plot_montage_010.png
  • ../../_images/sphx_glr_plot_montage_011.png
  • ../../_images/sphx_glr_plot_montage_012.png
  • ../../_images/sphx_glr_plot_montage_013.png
  • ../../_images/sphx_glr_plot_montage_014.png
  • ../../_images/sphx_glr_plot_montage_015.png
  • ../../_images/sphx_glr_plot_montage_016.png
  • ../../_images/sphx_glr_plot_montage_017.png
  • ../../_images/sphx_glr_plot_montage_018.png
  • ../../_images/sphx_glr_plot_montage_019.png
  • ../../_images/sphx_glr_plot_montage_020.png
  • ../../_images/sphx_glr_plot_montage_021.png
  • ../../_images/sphx_glr_plot_montage_022.png
  • ../../_images/sphx_glr_plot_montage_023.png
  • ../../_images/sphx_glr_plot_montage_024.png

Out:

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 8.9 41.8 mm
Origin device coordinates:    -0.0 8.9 41.8 mm

Equiv. model fitting -> RV = 0.00409037 %
mu1 = 0.943564    lambda1 = 0.140094
mu2 = 0.664147    lambda2 = 0.686908
mu3 = 0.042879    lambda3 = -0.016632
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         94.0 mm
Origin head coordinates:      -0.0 3.0 36.1 mm
Origin device coordinates:    -0.0 3.0 36.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.0 mm

Fitted sphere radius:         94.0 mm
Origin head coordinates:      0.0 3.0 36.1 mm
Origin device coordinates:    0.0 3.0 36.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.0 mm

Fitted sphere radius:         95.5 mm
Origin head coordinates:      0.0 0.5 31.9 mm
Origin device coordinates:    0.0 0.5 31.9 mm

Equiv. model fitting -> RV = 0.0037285 %
mu1 = 0.943943    lambda1 = 0.139085
mu2 = 0.665517    lambda2 = 0.684836
mu3 = -0.0972643    lambda3 = -0.0135513
Set up EEG sphere model with scalp radius    95.5 mm

Fitted sphere radius:         95.5 mm
Origin head coordinates:      0.0 0.6 31.9 mm
Origin device coordinates:    0.0 0.6 31.9 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.5 mm

Fitted sphere radius:         94.1 mm
Origin head coordinates:      -0.0 3.8 35.8 mm
Origin device coordinates:    -0.0 3.8 35.8 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.1 mm

Fitted sphere radius:         94.3 mm
Origin head coordinates:      -0.0 3.4 41.0 mm
Origin device coordinates:    -0.0 3.4 41.0 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.3 mm

Fitted sphere radius:         94.1 mm
Origin head coordinates:      -0.0 3.4 41.0 mm
Origin device coordinates:    -0.0 3.4 41.0 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.1 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 0.0 40.1 mm
Origin device coordinates:    -0.0 0.0 40.1 mm

Equiv. model fitting -> RV = 0.00409037 %
mu1 = 0.943564    lambda1 = 0.140094
mu2 = 0.664147    lambda2 = 0.686908
mu3 = 0.042879    lambda3 = -0.016632
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 0.0 40.1 mm
Origin device coordinates:    -0.0 0.0 40.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 -0.0 40.1 mm
Origin device coordinates:    -0.0 -0.0 40.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 0.0 40.1 mm
Origin device coordinates:    -0.0 0.0 40.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      -0.0 0.0 40.1 mm
Origin device coordinates:    -0.0 0.0 40.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      0.0 -0.0 40.1 mm
Origin device coordinates:    0.0 -0.0 40.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      0.0 15.7 38.8 mm
Origin device coordinates:    0.0 15.7 38.8 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         95.0 mm
Origin head coordinates:      0.0 15.7 38.8 mm
Origin device coordinates:    0.0 15.7 38.8 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.0 mm

Fitted sphere radius:         94.2 mm
Origin head coordinates:      0.9 6.9 48.9 mm
Origin device coordinates:    0.9 6.9 48.9 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.2 mm

Fitted sphere radius:         94.4 mm
Origin head coordinates:      1.0 6.6 48.1 mm
Origin device coordinates:    1.0 6.6 48.1 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.4 mm

Fitted sphere radius:         95.9 mm
Origin head coordinates:      0.9 6.8 46.5 mm
Origin device coordinates:    0.9 6.8 46.5 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.9 mm

Fitted sphere radius:         94.6 mm
Origin head coordinates:      0.8 6.1 43.2 mm
Origin device coordinates:    0.8 6.1 43.2 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.6 mm

Fitted sphere radius:         96.5 mm
Origin head coordinates:      0.9 6.5 45.0 mm
Origin device coordinates:    0.9 6.5 45.0 mm

Equiv. model fitting -> RV = 0.0037285 %
mu1 = 0.943943    lambda1 = 0.139085
mu2 = 0.665517    lambda2 = 0.684836
mu3 = -0.0972643    lambda3 = -0.0135513
Set up EEG sphere model with scalp radius    96.5 mm

Fitted sphere radius:         95.9 mm
Origin head coordinates:      0.9 5.6 45.0 mm
Origin device coordinates:    0.9 5.6 45.0 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.9 mm

Fitted sphere radius:         94.7 mm
Origin head coordinates:      1.0 5.7 42.9 mm
Origin device coordinates:    1.0 5.7 42.9 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    94.7 mm

Fitted sphere radius:         95.9 mm
Origin head coordinates:      0.9 5.6 45.0 mm
Origin device coordinates:    0.9 5.6 45.0 mm

Equiv. model fitting -> RV = 0.0034856 %
mu1 = 0.944754    lambda1 = 0.137089
mu2 = 0.667504    lambda2 = 0.683819
mu3 = -0.26966    lambda3 = -0.0105378
Set up EEG sphere model with scalp radius    95.9 mm

Check all montages against fsaverage

subjects_dir = op.dirname(fetch_fsaverage())

for current_montage in get_builtin_montages():
    montage = mne.channels.make_standard_montage(current_montage)
    # Create dummy info
    info = mne.create_info(
        ch_names=montage.ch_names, sfreq=100., ch_types='eeg', montage=montage)
    fig = mne.viz.plot_alignment(
        # Plot options
        show_axes=True, dig='fiducials', surfaces='head', mri_fiducials=True,
        subject='fsaverage', subjects_dir=subjects_dir, info=info,
        coord_frame='mri',
        trans='fsaverage',  # transform from head coords to fsaverage's MRI
    )
    set_3d_view(figure=fig, azimuth=135, elevation=80)
    set_3d_title(figure=fig, title=current_montage)
  • ../../_images/sphx_glr_plot_montage_025.png
  • ../../_images/sphx_glr_plot_montage_026.png
  • ../../_images/sphx_glr_plot_montage_027.png
  • ../../_images/sphx_glr_plot_montage_028.png
  • ../../_images/sphx_glr_plot_montage_029.png
  • ../../_images/sphx_glr_plot_montage_030.png
  • ../../_images/sphx_glr_plot_montage_031.png
  • ../../_images/sphx_glr_plot_montage_032.png
  • ../../_images/sphx_glr_plot_montage_033.png
  • ../../_images/sphx_glr_plot_montage_034.png
  • ../../_images/sphx_glr_plot_montage_035.png
  • ../../_images/sphx_glr_plot_montage_036.png
  • ../../_images/sphx_glr_plot_montage_037.png
  • ../../_images/sphx_glr_plot_montage_038.png
  • ../../_images/sphx_glr_plot_montage_039.png
  • ../../_images/sphx_glr_plot_montage_040.png
  • ../../_images/sphx_glr_plot_montage_041.png
  • ../../_images/sphx_glr_plot_montage_042.png
  • ../../_images/sphx_glr_plot_montage_043.png
  • ../../_images/sphx_glr_plot_montage_044.png
  • ../../_images/sphx_glr_plot_montage_045.png
  • ../../_images/sphx_glr_plot_montage_046.png
  • ../../_images/sphx_glr_plot_montage_047.png
  • ../../_images/sphx_glr_plot_montage_048.png

Out:

0 files missing from /home/circleci/project/mne/datasets/_fsaverage/root.txt in /home/circleci/mne_data/MNE-sample-data/subjects
0 files missing from /home/circleci/project/mne/datasets/_fsaverage/bem.txt in /home/circleci/mne_data/MNE-sample-data/subjects/fsaverage
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.
Using outer_skin.surf for head surface.

Total running time of the script: ( 0 minutes 56.377 seconds)

Estimated memory usage: 480 MB

Gallery generated by Sphinx-Gallery