mne.gui.coregistration(tabbed=False, split=True, width=None, inst=None, subject=None, subjects_dir=None, guess_mri_subject=None, height=None, head_opacity=None, head_high_res=None, trans=None, scrollable=True, *, orient_to_surface=True, scale_by_distance=True, mark_inside=True, interaction=None, scale=None, advanced_rendering=None, head_inside=True, fullscreen=None, show=True, block=False, verbose=None)[source]#

Coregister an MRI with a subject’s head shape.

The GUI can be launched through the command line interface:

$ mne coreg

or using a python interpreter as shown in Source alignment and coordinate frames.


Combine the data source panel and the coregistration panel into a single panel with tabs.


Split the main panels with a movable splitter (good for QT4 but unnecessary for wx backend).

widthint | None

Specify the width for window (in logical pixels). Default is None, which uses MNE_COREG_WINDOW_WIDTH config value (which defaults to 800).

instNone | str

Path to an instance file containing the digitizer data. Compatible for Raw, Epochs, and Evoked files.

subjectNone | str

Name of the mri subject.

subjects_dirpath-like | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.


When selecting a new head shape file, guess the subject’s name based on the filename and change the MRI subject accordingly (default True).

heightint | None

Specify a height for window (in logical pixels). Default is None, which uses MNE_COREG_WINDOW_WIDTH config value (which defaults to 400).

head_opacityfloat | None

The opacity of the head surface in the range [0., 1.]. Default is None, which uses MNE_COREG_HEAD_OPACITY config value (which defaults to 1.).

head_high_resbool | None

Use a high resolution head surface. Default is None, which uses MNE_COREG_HEAD_HIGH_RES config value (which defaults to True).

transpath-like | None

The transform file to use.


Make the coregistration panel vertically scrollable (default True).

orient_to_surfacebool | None

If True (default), orient EEG electrode and head shape points to the head surface.

New in version 0.16.

scale_by_distancebool | None

If True (default), scale the digitization points by their distance from the scalp surface.

New in version 0.16.

mark_insidebool | None

If True (default), mark points inside the head surface in a different color.

New in version 0.16.

interaction‘trackball’ | ‘terrain’ | None

How interactions with the scene via an input device (e.g., mouse or trackpad) modify the camera position. If 'terrain', one axis is fixed, enabling “turntable-style” rotations. If 'trackball', movement along all axes is possible, which provides more freedom of movement, but you may incidentally perform unintentional rotations along some axes. If None, the setting stored in the MNE-Python configuration file is used. Defaults to 'terrain'.

New in version 0.16.

Changed in version 1.0: Default interaction mode if None and no config setting found changed from 'trackball' to 'terrain'.

scalefloat | None

The scaling for the scene.

New in version 0.16.


Use advanced OpenGL rendering techniques (default True). For some renderers (such as MESA software) this can cause rendering bugs.

New in version 0.18.


If True (default), add opaque inner scalp head surface to help occlude points behind the head.

New in version 0.23.


Whether to start in fullscreen (True) or windowed mode (False). Default is None, which uses MNE_COREG_FULLSCREEN config value (which defaults to False).

New in version 1.1.


Show the GUI if True.


Whether to halt program execution until the figure is closed.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

frameinstance of CoregistrationUI

The coregistration frame.


Many parameters (e.g., head_opacity) take None as a parameter, which means that the default will be read from the MNE-Python configuration file (which gets saved when exiting).

Step by step instructions for the coregistrations are shown below:

Examples using mne.gui.coregistration#

Source alignment and coordinate frames

Source alignment and coordinate frames