Coregister an atlas volume to a FreeSurfer subject
Source:R/coregister_volume.R
coregister_volume.RdComputes a rigid-plus-scale registration from a volumetric atlas onto
a FreeSurfer subject's T1 grid (e.g. cvs_avg35_inMNI152) using
mri_coreg. The resulting LTA can be reused by mri_vol2vol to
resample the atlas (or any volume in the same source space) onto the
target's grid, which is the first step toward producing subcortical
atlases that show realistic brain-outline anatomical context in their
2D slices.
Usage
coregister_volume(
input_volume,
target_subject = "cvs_avg35_inMNI152",
target_volume = "brain",
output_lta = NULL,
dof = 12,
binarise = TRUE,
subjects_dir = freesurfer::fs_subj_dir(),
skip_existing = FALSE,
verbose = get_verbose()
)Arguments
- input_volume
Path to the atlas volume to coregister, or an
RNiftiobject.- target_subject
FreeSurfer subject name to register to. Defaults to
"cvs_avg35_inMNI152", which is in MNI152 1mm space.- target_volume
Name of the volume in the subject's
mri/directory used as the registration target. Defaults to"brain"(i.e.brain.mgz).- output_lta
Path to write the resulting LTA file. Defaults to a temporary file.
- dof
Degrees of freedom for
mri_coreg(6,9, or12). Defaults to12(rigid + per-axis scale + shear).- binarise
Logical. If
TRUE(default), binarise both volumes before coregistration. Set toFALSEto register on raw intensities.- subjects_dir
FreeSurfer
SUBJECTS_DIR. Defaults tofreesurfer::fs_subj_dir().- skip_existing
Skip generating output files that already exist, allowing interrupted atlas creation to resume. If not specified, uses
options("ggseg.extra.skip_existing")or theGGSEG_EXTRA_SKIP_EXISTINGenvironment variable. Default is TRUE.- verbose
Verbosity level:
0(silent),1(standard progress, default), or2(debug, includes FreeSurfer output). Logical values are accepted (TRUE= 1,FALSE= 0). If not specified, uses the value fromoptions("ggseg.extra.verbose")or theGGSEG_EXTRA_VERBOSEenvironment variable.