{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Using an automated approach to coregistration\n\nThis example shows how to use the coregistration functions to perform an\nautomated MEG-MRI coregistration via scripting. Generally the results of\nthis approach are consistent with those obtained from manual\ncoregistration :footcite:`HouckClaus2020`.\n\n
The quality of the coregistration depends heavily upon the\n quality of the head shape points (HSP) collected during subject\n prepration and the quality of your T1-weighted MRI. Use with\n caution and check the coregistration error.
Don't forget to save the resulting ``trans`` matrix!\n\n```python\nmne.write_trans('/path/to/filename-trans.fif', coreg.trans)
The :class:`mne.coreg.Coregistration` class has the ability to\n compute MRI scale factors using\n :meth:`~mne.coreg.Coregistration.set_scale_mode` that is useful\n for creating surrogate MRI subjects, i.e., using a template MRI\n (such as one from :func:`mne.datasets.fetch_infant_template`)\n matched to a subject's head digitization. When scaling is desired,\n a scaled surrogate MRI should be created using\n :func:`mne.scale_mri`.