Learn R Programming

RNiftyReg (version 0.4.1)

convertAffine: Convert an affine matrix between different storage conventions

Description

Affine transformation matrices can be stored using a number of different conventions. This function converts between conventions.

Usage

convertAffine(affine, source, target, newType = c("niftyreg", "fsl"), currentType = NULL)

Arguments

affine
A 4x4 matrix representing an affine transformation matrix.
source
A "nifti" object representing the source image for the transformation.
target
A "nifti" object representing the target image for the transformation.
newType
The convention type to convert to. Currently valid values are "niftyreg" (which is believed to correspond to the convention used by the SPM software), and "fsl" (for FSL FLIRT).
currentType
The current type of the affine matrix, which can be either of the valid values for newType. If NULL, the code attempts to determine the current type from the affineType attribute of the matrix.

Value

  • A copy of the affine object provided, converted to the requested storage convention.

Details

The source and target images for the original transformation are required to find the corresponding ``xform'' matrices, which are needed to perform the conversion.

See Also

readAffine, writeAffine