Create a SourceMorph from one subject to another. Method is based on spherical morphing by FreeSurfer for surface cortical estimates :footcite:`GreveEtAl2013` and Symmetric Diffeomorphic Registration for volumic data :footcite:`AvantsEtAl2008`. Parameters ---------- src
(
src,
subject_from=None,
subject_to="fsaverage",
subjects_dir=None,
zooms="auto",
niter_affine=(100, 100, 10),
niter_sdr=(5, 5, 3),
spacing=5,
smooth=None,
warn=True,
xhemi=False,
sparse=False,
src_to=None,
precompute=False,
verbose=None,
)
| 45 | |
| 46 | @verbose |
| 47 | def compute_source_morph( |
| 48 | src, |
| 49 | subject_from=None, |
| 50 | subject_to="fsaverage", |
| 51 | subjects_dir=None, |
| 52 | zooms="auto", |
| 53 | niter_affine=(100, 100, 10), |
| 54 | niter_sdr=(5, 5, 3), |
| 55 | spacing=5, |
| 56 | smooth=None, |
| 57 | warn=True, |
| 58 | xhemi=False, |
| 59 | sparse=False, |
| 60 | src_to=None, |
| 61 | precompute=False, |
| 62 | verbose=None, |
| 63 | ): |
| 64 | """Create a SourceMorph from one subject to another. |
| 65 | |
| 66 | Method is based on spherical morphing by FreeSurfer for surface |
| 67 | cortical estimates :footcite:`GreveEtAl2013` and |
| 68 | Symmetric Diffeomorphic Registration for volumic data |
| 69 | :footcite:`AvantsEtAl2008`. |
| 70 | |
| 71 | Parameters |
| 72 | ---------- |
| 73 | src : instance of SourceSpaces | instance of SourceEstimate |
| 74 | The SourceSpaces of subject_from (can be a |
| 75 | SourceEstimate if only using a surface source space). |
| 76 | subject_from : str | None |
| 77 | Name of the original subject as named in the SUBJECTS_DIR. |
| 78 | If None (default), then ``src[0]['subject_his_id]'`` will be used. |
| 79 | subject_to : str | None |
| 80 | Name of the subject to which to morph as named in the SUBJECTS_DIR. |
| 81 | Default is ``'fsaverage'``. If None, ``src_to[0]['subject_his_id']`` |
| 82 | will be used. |
| 83 | |
| 84 | .. versionchanged:: 0.20 |
| 85 | Support for subject_to=None. |
| 86 | %(subjects_dir)s |
| 87 | zooms : float | tuple | str | None |
| 88 | The voxel size of volume for each spatial dimension in mm. |
| 89 | If spacing is None, MRIs won't be resliced, and both volumes |
| 90 | must have the same number of spatial dimensions. |
| 91 | Can also be ``'auto'`` to use ``5.`` if ``src_to is None`` and |
| 92 | the zooms from ``src_to`` otherwise. |
| 93 | |
| 94 | .. versionchanged:: 0.20 |
| 95 | Support for 'auto' mode. |
| 96 | niter_affine : tuple of int |
| 97 | Number of levels (``len(niter_affine)``) and number of |
| 98 | iterations per level - for each successive stage of iterative |
| 99 | refinement - to perform the affine transform. |
| 100 | Default is niter_affine=(100, 100, 10). |
| 101 | niter_sdr : tuple of int |
| 102 | Number of levels (``len(niter_sdr)``) and number of |
| 103 | iterations per level - for each successive stage of iterative |
| 104 | refinement - to perform the Symmetric Diffeomorphic Registration (sdr) |