Reading BEM surfaces from a forward solutionΒΆ

Plot BEM surfaces used for forward solution generation.

# Author: Jaakko Leppakangas <jaeilepp@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from mayavi import mlab

import mne
from mne.datasets.sample import data_path

print(__doc__)

data_path = data_path()
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(fname)
subjects_dir = op.join(data_path, 'subjects')

Out:

Opening raw data file /home/ubuntu/mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fif...
    Read a total of 3 projection items:
        PCA-v1 (1 x 102)  idle
        PCA-v2 (1 x 102)  idle
        PCA-v3 (1 x 102)  idle
    Range : 25800 ... 192599 =     42.956 ...   320.670 secs
Ready.
Current compensation grade : 0

Here we use mne.viz.plot_trans() with trans=None to plot only the surfaces without any transformations. For plotting transformation, see Head model and forward computation.

mne.viz.plot_trans(raw.info, trans=None, subject='sample',
                   subjects_dir=subjects_dir, meg_sensors=[], eeg_sensors=[],
                   head='outer_skin', skull=['inner_skull', 'outer_skull'])
mlab.view(40, 60)
../../_images/sphx_glr_plot_read_bem_surfaces_001.png

Out:

Using surface from /home/ubuntu/mne_data/MNE-sample-data/subjects/sample/bem/sample-5120-5120-5120-bem.fif.
Using /home/ubuntu/mne_data/MNE-sample-data/subjects/sample/bem/flash/inner_skull.surf for head surface.
Using /home/ubuntu/mne_data/MNE-sample-data/subjects/sample/bem/flash/outer_skull.surf for head surface.

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

Generated by Sphinx-Gallery