xformToAffine: Create 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
xformToAffine(image, useQuaternionFirst = TRUE)
Arguments
image
A object of class "nifti" from which to take the information.
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.
References
The NIfTI-1 standard (http://nifti.nimh.nih.gov/nifti-1) is the definitive reference on ``xform'' conventions.