| nifti.header.to.vox2ras | R Documentation |
The NIFTI v1 header can store up to two descriptions of the mapping from voxel indices to world
coordinates: the sform (a full affine matrix in the srow_x, srow_y and srow_z fields) and the qform (a
rotation, given as a quaternion, plus a translation, given in the quoffset fields). Each of them is only valid
if the corresponding code field is not zero, and the sform takes precedence over the qform if both are
present. This is the same rule that the NIFTI standard defines and that other implementations (nibabel,
oro.nifti) follow.
nifti.header.to.vox2ras(niiheader)
niiheader |
named list, a NIFTI v1 header as returned by |
a 4x4 numeric matrix (the voxel-to-RAS transformation), or NULL if the header contains neither an
sform nor a qform. The matrix implements the NIFTI convention that the rotation of the qform applies to
the left of the scaled voxel axes and that the third axis is flipped if the qfac field (pix_dim[1]) is
negative.
This is a header based re-implementation of the geometry computation of read.fs.volume.nii,
which reads an oro.nifti instance. The two are compared against each other in the unit tests, and against
nibabel in dev_tools/check_analyze_conversion.R.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.