Learn R Programming

RNiftyReg (version 2.0.0)

xform: Obtain an affine matrix corresponding to the ``xform'' of an image

Description

This function converts the ``qform'' or ``sform'' information in a NIfTI header into its corresponding affine matrix. These two ``xform'' mechanisms are defined by the NIfTI standard and may both be in use in a particular image header.

Usage

xform(image, useQuaternionFirst = TRUE)

Arguments

image
An image, in any acceptable form (see isImage).
useQuaternionFirst
A single logical value. If TRUE, the ``qform'' matrix will be used first, if it is defined; otherwise the ``sform'' matrix will take priority.

Value

  • A affine matrix corresponding to the ``qform'' or ``sform'' information in the image header. This is a plain matrix, which does not have the "affine" class or source and target attributes.

References

The NIfTI-1 standard (http://nifti.nimh.nih.gov/nifti-1) is the definitive reference on ``xform'' conventions.