Skip to content

BEM surface

use_template_mri module-attribute

Python
use_template_mri: str | None = None

Whether to use a template MRI subject such as FreeSurfer's fsaverage subject. This may come in handy if you don't have individual MR scans of your participants, as is often the case in EEG studies.

Note that the template MRI subject must be available as a subject in your subjects_dir. You can use for example a scaled version of fsaverage that could get with mne.scale_mri. Scaling fsaverage can be a solution to problems that occur when the head of a subject is small compared to fsaverage and, therefore, the default coregistration mislocalizes MEG sensors inside the head.

Example
Python
use_template_mri = "fsaverage"
Pipeline steps using this setting

The following steps are directly affected by changes to use_template_mri:

  • source/_01_make_bem_surfaces
  • source/_02_make_bem_solution
  • source/_03_setup_source_space
  • source/_04_make_forward
  • source/_05_make_inverse
  • source/_99_group_average
  • freesurfer/_02_coreg_surfaces

adjust_coreg module-attribute

Python
adjust_coreg: bool = False

Whether to adjust the coregistration between the MRI and the channels locations, possibly combined with the digitized head shape points. Setting it to True is mandatory if you use a template MRI subject that is different from fsaverage.

Example
Python
adjust_coreg = True
Pipeline steps using this setting

The following steps are directly affected by changes to adjust_coreg:

  • source/_04_make_forward

bem_mri_images module-attribute

Python
bem_mri_images: Literal['FLASH', 'T1', 'auto'] = 'auto'

Which types of MRI images to use when creating the BEM model. If 'FLASH', use FLASH MRI images, and raise an exception if they cannot be found.

Advice

It is recommended to use the FLASH images if available, as the quality of the extracted BEM surfaces will be higher.

If 'T1', create the BEM surfaces from the T1-weighted images using the watershed algorithm.

If 'auto', use FLASH images if available, and use the `watershed`` algorithm with the T1-weighted images otherwise.

Pipeline steps using this setting

The following steps are directly affected by changes to bem_mri_images:

  • source/_01_make_bem_surfaces

recreate_bem module-attribute

Python
recreate_bem: bool = False

Whether to re-create the BEM surfaces, even if existing surfaces have been found. If False, the BEM surfaces are only created if they do not exist already. True forces their recreation, overwriting existing BEM surfaces.

Pipeline steps using this setting

The following steps are directly affected by changes to recreate_bem:

  • source/_01_make_bem_surfaces
  • source/_02_make_bem_solution

recreate_scalp_surface module-attribute

Python
recreate_scalp_surface: bool = False

Whether to re-create the scalp surfaces used for visualization of the coregistration in the report and the lower-density coregistration surfaces. If False, the scalp surface is only created if it does not exist already. If True, forces a re-computation.

Pipeline steps using this setting

The following steps are directly affected by changes to recreate_scalp_surface:

  • freesurfer/_02_coreg_surfaces

freesurfer_verbose module-attribute

Python
freesurfer_verbose: bool = False

Whether to print the complete output of FreeSurfer commands. Note that if False, no FreeSurfer output might be displayed at all!

Pipeline steps using this setting

The following steps are directly affected by changes to freesurfer_verbose:

  • source/_01_make_bem_surfaces