flip.lms: Flips landmarks to the same orientation if you have a mixture...

View source: R/flip.lms.R

flip.lmsR Documentation

Flips landmarks to the same orientation if you have a mixture of left and right facing data

Description

Flips landmarks to the same orientation if you have a mixture of left and right facing data

Usage

flip.lms(landmarks, imagedir, side_data, side_code = "right")

Arguments

landmarks

A landmark array with dimensions N_landmarks x 2 x N_observations

imagedir

The path to the working folder of images

side_data

An index of which side the landmarks are facing

side_code

What you call the side you want to flip (for example, "right" or "R")

Value

An array of landmark info with dimensions N_landmarks x 2 x N_observations with all data facing the same direction

Examples

guppy.lms <- tps2array(system.file("extdata", "original_lms.TPS", package = "Colormesh"))
flip.test <- flip.lms(landmarks = guppy.lms, imagedir = paste0(path.package("Colormesh"),"/inst/extdata/cropped_images/"), side_data = c("right", rep("left", 9)))

#plot the flipped example
plot(flip.test[,,1])
points(guppy.lms[,,1])

J0vid/Colormesh documentation built on Nov. 23, 2024, 6:10 p.m.