spm12_coregister.RdPerforms SPM12 coregistration estimation and reslicing on an Image
build_spm12_coregister(
fixed,
moving,
other.files = NULL,
cost_fun = c("nmi", "ecc", "ncc"),
separation = c(4, 2),
tol = c(0.02, 0.02, 0.02, 0.001, 0.001, 0.001, 0.01, 0.01, 0.01, 0.001, 0.001, 0.001),
fwhm = c(7, 7),
interp = c("bspline4", "nearestneighbor", "trilinear", paste0("bspline", 2:3),
paste0("bspline", 5:7)),
wrap_x = FALSE,
wrap_y = FALSE,
wrap_z = FALSE,
mask = FALSE,
prefix = "r",
verbose = TRUE,
...
)
build_spm12_coregister_estimate(
fixed,
moving,
other.files = NULL,
cost_fun = c("nmi", "ecc", "ncc"),
separation = c(4, 2),
tol = c(0.02, 0.02, 0.02, 0.001, 0.001, 0.001, 0.01, 0.01, 0.01, 0.001, 0.001, 0.001),
fwhm = c(7, 7),
verbose = TRUE,
...
)
build_spm12_coregister_reslice(
fixed,
moving,
interp = c("bspline4", "nearestneighbor", "trilinear", paste0("bspline", 2:3),
paste0("bspline", 5:7)),
wrap_x = FALSE,
wrap_y = FALSE,
wrap_z = FALSE,
mask = FALSE,
prefix = "r",
verbose = TRUE,
...
)
spm12_coregister_wrapper(
...,
func = c("build_spm12_coregister", "build_spm12_coregister_reslice",
"build_spm12_coregister_estimate"),
add_spm_dir = TRUE,
spmdir = spm_dir(verbose = verbose, install_dir = install_dir),
clean = TRUE,
verbose = TRUE,
outdir = NULL,
install_dir = NULL
)
spm12_coregister(
...,
add_spm_dir = TRUE,
spmdir = spm_dir(verbose = verbose, install_dir = install_dir),
clean = TRUE,
verbose = TRUE,
outdir = NULL,
install_dir = NULL
)
spm12_coregister_estimate(
...,
add_spm_dir = TRUE,
spmdir = spm_dir(verbose = verbose, install_dir = install_dir),
clean = TRUE,
verbose = TRUE,
outdir = NULL,
install_dir = NULL
)
spm12_coregister_reslice(
...,
add_spm_dir = TRUE,
spmdir = spm_dir(verbose = verbose, install_dir = install_dir),
clean = TRUE,
verbose = TRUE,
outdir = NULL,
install_dir = NULL
)File that is assumed fixed
moving file to be registered to fixed space
Other files to register to fixed, in same space as moving file
Cost function
The average distance between sampled points (in mm). Can be a vector to allow a coarse registration followed by increasingly fine
The accuracy for each parameter. Iterations stop when differences between successive estimates are less than the required
Gaussian smoothing to apply to the 256x256 joint histogram. Other information theoretic coregistration methods use fewer bins,
Interpolator for sampling in fixed space
wrap in x-direction
wrap in y-direction
wrap in z-direction
Mask the data. With masking enabled, the program searches through the whole time series looking for voxels which need to be sampled from outside the original images. Where this occurs, that voxel is set to zero for the whole set of images
Prefix to append to front of image filename
Print diagnostic messages
Additional arguments to pass to
run_matlabbatch
not used
Add SPM12 directory from this package
SPM dir to add, will use package default directory
Remove scripts from temporary directory after running
Directory to copy results. If full filename
given, then results will
be in dirname(filename)
directory to download SPM12
List of output files, the matlabbatch object,
and the script
if (FALSE) { # \dontrun{
fname = paste0("~/Desktop/D2/scratch/",
"100-318_20070723_0957_CT_3_CT_Head-_SS_0.01_SyN_ROI.nii.gz")
spm = spm12_coregister(
fixed = fname,
moving = fname,
other.files = fname,
execute = FALSE)
} # }
if (matlabr::have_matlab()) {
install_dir = tempdir()
dims = rep(10, 3)
fixed = array(rnorm(prod(dims)), dim = dims)
fixed = oro.nifti::nifti(fixed)
moving = array(rnorm(prod(dims)), dim = dims)
moving = oro.nifti::nifti(moving)
res = build_spm12_coregister(
fixed = fixed, moving = moving,
install_dir = install_dir)
}