Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

computeTransform

calculate an affine transformation matrix


Description

calculate an affine transformation matrix

Usage

computeTransform(x, y, type = c("rigid", "similarity", "affine", "tps"),
  reflection = FALSE, lambda = 1e-08, weights = NULL,
  centerweight = FALSE, threads = 1)

Arguments

x

fix landmarks. Can be a k x m matrix or mesh3d.

y

moving landmarks. Can be a k x m matrix or mesh3d.

type

set type of affine transformation: options are "rigid", "similarity" (rigid + scale) and "affine",

reflection

logical: if TRUE "rigid" and "similarity" allow reflections.

lambda

numeric: regularisation parameter of the TPS.

weights

vector of length k, containing weights for each landmark (only used in type="rigid" or "similarity").

centerweight

logical or vector of weights: if weights are defined and centerweigths=TRUE, the matrix will be centered according to these weights instead of the barycenter. If centerweight is a vector of length nrow(x), the barycenter will be weighted accordingly.

threads

number of threads to use in TPS interpolation.

Details

x and y can also be a pair of meshes with corresponding vertices.

Value

returns a 4x4 (3x3 in 2D case) transformation matrix or an object of class "tpsCoeff" in case of type="tps".

Note

all lines containing NA, or NaN are ignored in computing the transformation.

See Also

rotonto, link{rotmesh.onto}, tps3d

Examples

data(boneData)
trafo <- computeTransform(boneLM[,,1],boneLM[,,2])
transLM <- applyTransform(boneLM[,,2],trafo)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.