Learn R Programming

Morpho (version 2.1)

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, blockdiag = TRUE)

Arguments

matrix
k x 3 or k x 2 matrix containing landmark coordinates.
lambda
numeric: regularization factor
blockdiag
logical: request blockdiagonal matrix Lsubk3 needed for sliding of semilandmarks.

Value

  • 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