# mne.viz.plot_bem¶

mne.viz.plot_bem(subject=None, subjects_dir=None, orientation='coronal', slices=None, brain_surfaces=None, src=None, show=True, show_indices=True)[source]

Plot BEM contours on anatomical slices.

Parameters
subjectstr

Subject name.

subjects_dir

Path to the SUBJECTS_DIR. If None, the path is obtained by using the environment variable SUBJECTS_DIR.

orientationstr

‘coronal’ or ‘axial’ or ‘sagittal’.

slices

Slice indices.

brain_surfaces

One or more brain surface to plot (optional). Entries should correspond to files in the subject’s surf directory (e.g. "white").

src

SourceSpaces instance or path to a source space to plot individual sources as scatter-plot. Sources will be shown on exactly one slice (whichever slice is closest to each source in the given orientation plane). Path can be absolute or relative to the subject’s bem folder.

Changed in version 0.20: All sources are shown on the nearest slice rather than some being omitted.

showbool

Show figure if True.

show_indicesbool

Show slice indices if True.

New in version 0.20.

Returns
figinstance of matplotlib.figure.Figure

The figure.

Notes

Images are plotted in MRI voxel coordinates.

If src is not None, for a given slice index, all source points are shown that are halfway between the previous slice and the given slice, and halfway between the given slice and the next slice. For large slice decimations, this can make some source points appear outside the BEM contour, which is shown for the given slice index. For example, in the case where the single midpoint slice is used slices=[128], all source points will be shown on top of the midpoint MRI slice with the BEM boundary drawn for that slice.