Q2R: Quaternion to rotation

Description Usage Arguments Value See Also Examples

View source: R/niftiFMRI.R

Description

Generate a (proper) rotation matrix from a quaternion.

Usage

1
Q2R(Q,qfac)

Arguments

Q

quaternion vector

qfac

qfac nifti field. It is pixdim[1]

Value

The rotation.

See Also

R2Q

Examples

1
2
3
L <- f.read.nifti.header(system.file("example-nifti.hdr", package="AnalyzeFMRI"))
Q <- c(L$quatern.b,L$quatern.c,L$quatern.d)
Q2R(Q,L$pixdim[1])

Example output

Loading required package: R.matlab
R.matlab v3.6.2 (2018-09-26) successfully loaded. See ?R.matlab for help.

Attaching package: 'R.matlab'

The following objects are masked from 'package:base':

    getOption, isOpen

Loading required package: fastICA
Loading required package: tcltk
Loading required package: tkrplot
Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 
     [,1] [,2] [,3]
[1,]   -1    0    0
[2,]    0    1    0
[3,]    0    0    1

AnalyzeFMRI documentation built on Oct. 5, 2021, 5:06 p.m.

Related to Q2R in AnalyzeFMRI...