computeTransform: calculate an affine transformation matrix

View source: R/ComputeTransform.r

computeTransformR Documentation

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 documentation built on June 22, 2024, 7:19 p.m.