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

Description Usage Arguments Value Examples

View source: R/flip.lms.R

Description

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

Usage

1
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

1
2
3
4
5
6
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 Feb. 4, 2022, 1:33 a.m.