View source: R/make.colormesh.dataset.R
make.colormesh.dataset | R Documentation |
Combine metadata with calibrated colormesh data for analysis
make.colormesh.dataset(
df,
specimen.factors,
use.perimeter.data = F,
write2csv = NULL
)
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 |
The function will return a dataframe of specimen data (inherits the original column names) and landmark x & y values along with calibrated RGB values.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.