Learn R Programming

Morpho (version 2.12)

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 = 1e-08,
  output = c("K", "L", "Linv", "Lsubk", "Lsubk3"),
  threads = 1
)

Value

depending on the choices in output:

L

Matrix K as specified in Bookstein (1989)

L

Matrix L as specified in Bookstein (1989)

Linv

Inverse of matrix L as specified in Bookstein (1989)

Lsubk

uper left k x k submatrix of Linv

Lsubk3

Matrix used for sliding in slider3d and relaxLM

.

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: "K", "L","Linv","Lsubk", "Lsubk3".

threads

threads to be used for parallel execution calculating K. sliding of semilandmarks.

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

Examples

Run this code

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