make.colormesh.dataset: Combine metadata with calibrated colormesh data for analysis

Description Usage Arguments Value Examples

View source: R/make.colormesh.dataset.R

Description

Combine metadata with calibrated colormesh data for analysis

Usage

1
2
3
4
5
6
make.colormesh.dataset(
  df,
  specimen.factors,
  use.perimeter.data = F,
  write2csv = NULL
)

Arguments

df

A calibrated.mesh.colors object (generated from rgb.calibrate) or mesh.colors object (generated from rgb.measure)

specimen.factors

The covariate data that you want to combine with the calibrated data

use.perimeter.data

If TRUE, we will return the color values for the perimeter landmarks as well as the interior landmarks.

write2csv

A directory is to write a csv to, if desired

Value

The function will return a dataframe of specimen data (inherits the original column names) and landmark x & y values along with calibrated RGB values.

Examples

1
2
3
4
5
6
7
8
#covariate data and consensus lms
specimen.factors <- read.csv(system.file("extdata", "specimen_factors.csv", package = "Colormesh"), header = F)
consensus <- tps2array(system.file("extdata", "consensus_LM_coords.TPS", package = "Colormesh"))
test.image <- image_reader(paste0(path.package("Colormesh"),"/extdata/unwarped_images/"), "GPLP_unw_001.jpg")
delaunay.map <- tri.surf(consensus, point.map = c(1,8:17,2, 18:19,3,20:27,4, 28:42,5,43:52,6,53:54,7,55:62), 3, test.image)

rgb.test <- rgb.measure(imagedir = paste0(path.package("Colormesh"),"/extdata/unwarped_images/"), image.names = specimen.factors[,2], delaunay.map = delaunay.map, linearize.color.space = F)
cm.dataset <- make.colormesh.dataset(rgb.test, specimen.factors)

J0vid/Colormesh documentation built on Feb. 4, 2022, 1:33 a.m.