Description Usage Arguments Details Value Author(s) References Examples

The affine/rotation matrix *R* is calculated from the quaternion
parameters.

1 2 3 | ```
quaternion2rotation(b, c, d, tol = 1e-07)
quaternion2mat44(nim, tol = 1e-07)
``` |

`b` |
is the quaternion |

`c` |
is the quaternion |

`d` |
is the quaternion |

`tol` |
is a very small value used to judge if a number is essentially zero. |

`nim` |
is an object of class |

The quaternion representation is chosen for its compactness in representing
rotations. The orientation of the *(x,y,z)* axes relative to the
*(i,j,k)* axes in 3D space is specified using a unit quaternion
*[a,b,c,d]*, where *a*a+b*b+c*c+d*d=1*. The
*(b,c,d)* values are all that is needed, since we require that
*a=sqrt(1.0-(b*b+c*c+d*d))* be non-negative.
The *(b,c,d)* values are stored in the (`quatern_b`

,
`quatern_c`

, `quatern_d`

) fields.

The (proper) *3x3* rotation matrix or
*4x4* affine matrix.

Brandon Whitcher [email protected]

NIfTI-1

http://nifti.nimh.nih.gov/

1 2 3 | ```
## This R matrix is represented by quaternion [a,b,c,d] = [0,1,0,0]
## (which encodes a 180 degree rotation about the x-axis).
(R <- quaternion2rotation(1, 0, 0))
``` |

oro.nifti documentation built on Nov. 17, 2017, 4:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.