Learn R Programming

Morpho (version 2.1)

applyTransform: apply affine transformation to data

Description

apply affine transformation to data

Usage

applyTransform(x, trafo, inverse)

## S3 method for class 'matrix': applyTransform(x, trafo, inverse = FALSE)

## S3 method for class 'mesh3d': applyTransform(x, trafo, inverse = FALSE)

Arguments

x
matrix or mesh3d
trafo
4x4 transformation matrix (for mesh3d the matrix will be transformed to a 4x4 matrix)
inverse
logical: if TRUE, the inverse of the transformation is applied

Value

  • the transformed object

Examples

Run this code
data(boneData)
rot <- rotonto(boneLM[,,1],boneLM[,,2])
trafo <- getTrafo4x4(rot)
boneLM2trafo <- applyTransform(boneLM[,,2],trafo)

Run the code above in your browser using DataLab