Learn R Programming

RNiftyReg (version 0.4.1)

decomposeAffine: Decompose an affine matrix into its constituent transformations

Description

An affine matrix is composed of translation, scale, skew and rotation transformations. This function extracts these components.

Usage

decomposeAffine(affine, source = NULL, target = NULL, type = NULL)

Arguments

affine
A 4x4 matrix representing an affine transformation matrix.
source
A "nifti" object representing the source image for the transformation. Only required if type (or the matrix's affineType attribute) is "niftyreg", in which case it is passed to
target
A "nifti" object representing the target image for the transformation. Only required if type (or the matrix's affineType attribute) is "niftyreg", in which case it is passed to
type
The storage convention type of the affine matrix, if it is not stored in the affineType attribute of the matrix.

Value

  • A list with components
  • scaleMatrixA 3x3 matrix representing only the scale operation embodied in the full affine transformation.
  • skewMatrixA 3x3 matrix representing only the skew operation embodied in the full affine transformation.
  • rotationMatrixA 3x3 matrix representing only the rotation operation embodied in the full affine transformation.
  • translationA length-3 named numeric vector representing the translations (generally in mm) in each of the X, Y and Z directions.
  • scalesA length-3 named numeric vector representing the scale factors in each of the X, Y and Z directions. Scale factors of 1 represent no effect.
  • skewsA length-3 named numeric vector representing the skews in each of the XY, XZ and YZ planes.
  • anglesA length-3 named numeric vector representing the rotation angles (in radians) about each of the X, Y and Z directions; i.e. roll, pitch and yaw.

See Also

convertAffine, niftyreg