getSides: try to identify bilateral landmarks and sort them by side

View source: R/getSides.r

getSidesR Documentation

try to identify bilateral landmarks and sort them by side

Description

try to identify bilateral landmarks and sort them by side

Usage

getSides(x, tol = 3, pcAlign = TRUE, icpiter = 100, ...)

Arguments

x

matrix containing landmarks (see details)

tol

maximal distance allowed between original and mirrored set.

pcAlign

logical: if TRUE orginal and mirrored landmarks will be initally aligned by their PC-axes

icpiter

integer: number of iterations in ICP alignment.

...

more arguments passed to mirror.

Details

This function mirrors the landmark set and aligns it to the original. Then it tries to find pairs. If you have a sample, run a Procrustes registration first (without scaling to unit centroid size, or you later have to adapt tol - see examples) and then use the mean as it is usually more symmetrical.

Value

returns a list containing

side1

integer vector containing indices of landmarks on one side

side2

integer vector containing indices of landmarks on the other side

unilat

integer vector containing indices unilateral landmarks

Examples

data(boneData)
proc <- procSym(boneLM,CSinit=FALSE)
mysides <- getSides(proc$mshape)
if (interactive()){
#visualize bilateral landmarks
deformGrid3d(boneLM[mysides$side1,,1],boneLM[mysides$side2,,1])
## visualize unilateral landmarks
rgl::spheres3d(boneLM[mysides$unilat,,1],radius=0.5)
}

zarquon42b/Morpho documentation built on Jan. 28, 2024, 2:11 p.m.