Learn R Programming

Morpho (version 2.1)

tps3d: thin plate spline mapping

Description

maps a datamatrix via thin plate spline between calculated by a reference on a target configuration in 2D and 3D

Usage

tps3d(M, refmat, tarmat, lambda = 0)

Arguments

M
datamatrix - e.g. the matrix information of vertices of a given surface
refmat
reference matrix - e.g. landmark configuration on a surface
tarmat
target matrix - e.g. landmark configuration on a target surface
lambda
integer: regularisation parameter of the TPS.

Value

  • returns the warped datamatrix

References

Bookstein FL. 1989. Principal Warps: Thin-plate splines and the decomposition of deformations. IEEE Transactions on pattern analysis and machine intelligence 11(6).

See Also

warp.mesh

Examples

Run this code
require(Morpho)
data(nose)
## define some landmarks
refind <- c(1:3,4,19:20)
## use a subset of shortnose.lm as anchor points for a TPS-deformation
reflm <- shortnose.lm[refind,]
tarlm <- reflm
##replace the landmark at the tip of the nose with that of longnose.lm
tarlm[4,] <- longnose.lm[4,]
##  deform a set of semilandmarks by applying a TPS-deformation
##  based on 5 reference points
deformed <- tps3d(shortnose.lm, reflm, tarlm)
##visualize results by applying a deformation grid
deformGrid3d(shortnose.lm,deformed,ngrid = 5)

Run the code above in your browser using DataLab