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.

from mayavi import mlab
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 plot_alignment

subjects_dir = op.dirname(fetch_fsaverage())

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

check all montages

for current_montage in get_builtin_montages():

    montage = mne.channels.read_montage(current_montage,
                                        unit='auto',
                                        transform=False)

    info = mne.create_info(ch_names=montage.ch_names,
                           sfreq=1,
                           ch_types='eeg',
                           montage=montage)

    fig = plot_alignment(info, trans=None,
                         subject='fsaverage',
                         subjects_dir=subjects_dir,
                         eeg=['projected'],
                         )
    mlab.view(135, 80)
    mlab.title(montage.kind, figure=fig)
  • ../../_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:

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 30.445 seconds)

Estimated memory usage: 155 MB

Gallery generated by Sphinx-Gallery