Learn R Programming

Morpho (version 2.12)

fixLMmirror: estimate missing landmarks from their bilateral counterparts

Description

estimate missing landmarks from their bilateral counterparts

Usage

fixLMmirror(x, pairedLM, ...)

# S3 method for array fixLMmirror(x, pairedLM, ...)

# S3 method for matrix fixLMmirror(x, pairedLM, ...)

Value

a matrix or array with fixed missing bilateral landmarks.

Arguments

x

a matrix or an array containing landmarks (3D or 2D)

pairedLM

a k x 2 matrix containing the indices (rownumbers) of the paired LM. E.g. the left column contains the lefthand landmarks, while the right side contains the corresponding right hand landmarks.

...

additional arguments

Details

the configurations are mirrored and the relabled version is matched onto the original using a thin-plate spline deformation. The missing landmark is now estimated using its bilateral counterpart. If one side is completely missing, the landmarks will be mirrored and aligned by the unilateral landmarks.

Examples

Run this code
data(boneData)
left <- c(4,6,8)
## determine corresponding Landmarks on the right side:
# important: keep same order
right <- c(3,5,7)
pairedLM <- cbind(left, right)
exampmat <- boneLM[,,1]
exampmat[4,] <- NA #set 4th landmark to be NA
fixed <- fixLMmirror(exampmat, pairedLM=pairedLM)
if (FALSE) {
deformGrid3d(fixed, boneLM[,,1],ngrid=0)
## result is a bit off due to actual asymmetry
}
## example with one side completely missing
oneside <- boneLM[,,1]
oneside[pairedLM[,1],] <- NA
onesidefixed <- fixLMmirror(oneside,pairedLM)
if (FALSE) {
deformGrid3d(onesidefixed, boneLM[,,1],ngrid=0)
## result is a bit off due to actual asymmetry
}

Run the code above in your browser using DataLab