Learn R Programming

AnalyzeFMRI (version 1.1-16)

mat34.to.TZSR: Affine 4x4 (or 3x4) matrix to Translation, Scale, Shear and Rotation

Description

Extract in that order Translation, Scale, Shear and Rotation from a 4x4 (or 3x4) affine matrix from a NIFTI header list (srow.x, srow.y, srow.z).

Usage

mat34.to.TZSR(M)

Arguments

M

the affine matrix

Value

A list containing Translation, Scale, Shear and Rotation. Rotation decomposition is also provided (rotation = RotZ*RotY*RotX*Ref where Ref is a Reflexion if the rotation is improper or is Identity if the rotation is proper).

Details

Decomposes M using the convention: M = translation * scale * skew * rotation. Be careful that rotation can be improper.

See Also

R2Q Q2R mat34.to.TRSZ

Examples

Run this code
# NOT RUN {
L <- f.read.nifti.header(system.file("example-nifti.hdr", package="AnalyzeFMRI"))
M <- rbind(L$srow.x,L$srow.y,L$srow.z)
mat34.to.TZSR(M)
# }

Run the code above in your browser using DataLab