niftyreg function performs linear or nonlinear registration for
two and three dimensional images. 4D images may also be registered
volumewise to a 3D image, or 3D images slicewise to a 2D image. This
function is a common wrapper for niftyreg.linear and
niftyreg.nonlinear.niftyreg(source, target, scope = c("affine", "rigid", "nonlinear"),
init = NULL, sourceMask = NULL, targetMask = NULL, symmetric = TRUE,
estimateOnly = FALSE, ...)## S3 method for class 'niftyreg':
as.array(x, ...)
"nifti" or
"internalImage", or a plain array, or a NIfTI-1 filename. Must have
2, 3 or 4 dimensions."nifti" or
"internalImage", or a plain array, or a NIfTI-1 filename. Must have
2 or 3 dimensions."affine" (12 DOF), "rigid" (6 DOF) or "nonlinear"
(high DOF, with the exact number dependiNULL, for no initialisation, or an affine matrix or control point
image (nonlinear only). For multiple registration, where the source image
has one more dimension than the target, symmetric is FALSE.TRUE, transformations will be
estimated, but images will not be resampled.niftyreg.linear or
niftyreg.nonlinear."niftyreg" object."niftyreg" with components:source image in the space of the target image. This
element is NULL if the estimateOnly parameter is
TRUE.as.array method for this class returns the image
element.niftyreg.linear or
niftyreg.nonlinear for references relating to each type of
registration.niftyreg.linear and niftyreg.nonlinear,
which do most of the work. Also, forward and
reverse to extract transformations, and
applyTransform to apply them to new images or points.source <- readNifti(system.file("extdata", "epi_t2.nii.gz",
package="RNiftyReg"))
target <- readNifti(system.file("extdata", "flash_t1.nii.gz",
package="RNiftyReg"))
result <- niftyreg(source, target, scope="affine")Run the code above in your browser using DataLab