Learn R Programming

Morpho (version 2.2)

CreateL: Create Matrices necessary for Thin-Plate Spline

Description

Create (Bending Engergy) Matrices necessary for Thin-Plate Spline, and sliding of Semilandmarks

Usage

CreateL(matrix, lambda = 0, output = c("L", "Linv", "Lsubk", "Lsubk3"))

Arguments

matrix
k x 3 or k x 2 matrix containing landmark coordinates.
lambda
numeric: regularization factor
output
character vector: select which matrices to create. Can be a vector containing any combination of the strings: "L","Linv","Lsubk", "Lsubk3". sliding of semilandmarks.

Value

  • depending on the choices in output:
  • LMatrix L as specified in Bookstein (1989)
  • LinvInverse of matrix L as specified in Bookstein (1989)
  • Lsubkuper left k x k submatrix of Linv
  • Lsubk3Matrix used for sliding in slider3d and relaxLM. Only available if blockdiag = TRUE

References

Gunz, P., P. Mitteroecker, and F. L. Bookstein. 2005. Semilandmarks in Three Dimensions, in Modern Morphometrics in Physical Anthropology. Edited by D. E. Slice, pp. 73-98. New York: Kluwer Academic/Plenum Publishers.

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

tps3d, warp.mesh

Examples

Run this code
require(rgl)
data(boneData)
L <- CreateL(boneLM[,,1])
## calculate Bending energy between first and second specimen:
be <- t(boneLM[,,2])%*%L$Lsubk%*%boneLM[,,2]
## calculate Frobenius norm
sqrt(sum(be^2))
## the amount is dependant on on the squared scaling factor
# scale landmarks by factor 5 and compute bending energy matrix
be2 <- t(boneLM[,,2]*5)%*%L$Lsubk%*%(boneLM[,,2]*5)
sqrt(sum(be2^2)) # exactly 25 times the result from above
## also this value is not symmetric:
L2 <- CreateL(boneLM[,,2])
be3 <- t(boneLM[,,1])%*%L2$Lsubk%*%boneLM[,,1]
sqrt(sum(be3^2))

Run the code above in your browser using DataLab