Create a scaled copy of an MRI subject. Parameters ---------- subject_from : str Name of the subject providing the MRI. subject_to : str New subject name for which to save the scaled MRI. scale : float | array_like, shape = (3,) The scaling factor (one or
(
subject_from,
subject_to,
scale,
overwrite=False,
subjects_dir=None,
skip_fiducials=False,
labels=True,
annot=False,
*,
on_defects="raise",
mri_fiducials=None,
verbose=None,
)
| 1019 | |
| 1020 | @verbose |
| 1021 | def scale_mri( |
| 1022 | subject_from, |
| 1023 | subject_to, |
| 1024 | scale, |
| 1025 | overwrite=False, |
| 1026 | subjects_dir=None, |
| 1027 | skip_fiducials=False, |
| 1028 | labels=True, |
| 1029 | annot=False, |
| 1030 | *, |
| 1031 | on_defects="raise", |
| 1032 | mri_fiducials=None, |
| 1033 | verbose=None, |
| 1034 | ): |
| 1035 | """Create a scaled copy of an MRI subject. |
| 1036 | |
| 1037 | Parameters |
| 1038 | ---------- |
| 1039 | subject_from : str |
| 1040 | Name of the subject providing the MRI. |
| 1041 | subject_to : str |
| 1042 | New subject name for which to save the scaled MRI. |
| 1043 | scale : float | array_like, shape = (3,) |
| 1044 | The scaling factor (one or 3 parameters). |
| 1045 | overwrite : bool |
| 1046 | If an MRI already exists for subject_to, overwrite it. |
| 1047 | subjects_dir : None | path-like |
| 1048 | Override the ``SUBJECTS_DIR`` environment variable. |
| 1049 | skip_fiducials : bool |
| 1050 | Do not scale the MRI fiducials. If False (default), an OSError will be |
| 1051 | raised if no fiducials file can be found. |
| 1052 | labels : bool |
| 1053 | Also scale all labels (default True). |
| 1054 | annot : bool |
| 1055 | Copy ``*.annot`` files to the new location (default False). |
| 1056 | %(on_defects)s |
| 1057 | |
| 1058 | .. versionadded:: 1.0 |
| 1059 | mri_fiducials : None | list of dict |
| 1060 | If provided, these fiducials will be used as the originals to scale instead |
| 1061 | of reading from ``{subject_from}/bem/{subject_from}-fiducials.fif``. |
| 1062 | This is useful typically when using ``mne coreg`` or similar and you have |
| 1063 | modified the MRI fiducials interactively, but have not saved them to disk. |
| 1064 | |
| 1065 | .. versionadded:: 1.12 |
| 1066 | %(verbose)s |
| 1067 | |
| 1068 | See Also |
| 1069 | -------- |
| 1070 | scale_bem : Add a scaled BEM to a scaled MRI. |
| 1071 | scale_labels : Add labels to a scaled MRI. |
| 1072 | scale_source_space : Add a source space to a scaled MRI. |
| 1073 | |
| 1074 | Notes |
| 1075 | ----- |
| 1076 | This function will automatically call :func:`scale_bem`, |
| 1077 | :func:`scale_labels`, and :func:`scale_source_space` based on expected |
| 1078 | filename patterns in the subject directory. |