mne.viz.plot_alignment(info, trans=None, subject=None, subjects_dir=None, surfaces=('head', ), coord_frame='head', meg=('helmet', 'sensors'), eeg='original', dig=False, ecog=True, src=None, mri_fiducials=False, bem=None, verbose=None)[source]

Plot head, sensor, and source space alignment in 3D.


info : dict

The measurement info.

trans : str | ‘auto’ | dict | None

The full path to the head<->MRI transform *-trans.fif file produced during coregistration. If trans is None, an identity matrix is assumed.

subject : str | None

The subject name corresponding to FreeSurfer environment variable SUBJECT. Can be omitted if src is provided.

subjects_dir : str | None

The path to the freesurfer subjects reconstructions. It corresponds to Freesurfer environment variable SUBJECTS_DIR.

surfaces : str | list

Surfaces to plot. Supported values: ‘head’, ‘outer_skin’, ‘outer_skull’, ‘inner_skull’, ‘brain’, ‘pial’, ‘white’, ‘inflated’. Defaults to (‘head’,).


For single layer BEMs it is recommended to use ‘brain’.

coord_frame : str

Coordinate frame to use, ‘head’, ‘meg’, or ‘mri’.

meg : str | list | bool

Can be “helmet”, “sensors” or “ref” to show the MEG helmet, sensors or reference sensors respectively, or a combination like ['helmet', 'sensors']. True translates to ('helmet', 'sensors', 'ref').

eeg : bool | str | list

Can be “original” (default; equivalent to True) or “projected” to show EEG sensors in their digitized locations or projected onto the scalp, or a list of these options including [] (equivalent of False).

dig : bool | ‘fiducials’

If True, plot the digitization points; ‘fiducials’ to plot fiducial points only.

ecog : bool

If True (default), show ECoG sensors.

src : instance of SourceSpaces | None

If not None, also plot the source space points.

mri_fiducials : bool | str

Plot MRI fiducials (default False). If True, look for a file with the canonical name (bem/{subject}-fiducials.fif). If str it should provide the full path to the fiducials file.

bem : list of dict | Instance of ConductorModel | None

Can be either the BEM surfaces (list of dict), a BEM solution or a sphere model. If None, we first try loading ‘$SUBJECTS_DIR/$SUBJECT/bem/$SUBJECT-$SOURCE.fif’, and then look for ‘$SUBJECT*$SOURCE.fif’ in the same directory. For ‘outer_skin’, the subjects bem and bem/flash folders are searched. Defaults to None.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).


fig : instance of mlab.Figure

The mayavi figure.

See also



This function serves the purpose of checking the validity of the many different steps of source reconstruction:

  • Transform matrix (keywords trans, meg and mri_fiducials),
  • BEM surfaces (keywords bem and surfaces),
  • sphere conductor model (keywords bem and surfaces) and
  • source space (keywords surfaces and src).

New in version 0.15.