shapeDiff {RRmorph} | R Documentation |
Shape difference between 3d meshes
Description
The function reconstructs two specimens' meshes (x
)
by using their superimposed configurations (from within pca
),
calculates the shape difference between them, and plots such differences
on provided meshes (refsur
).
Usage
shapeDiff(x,pca,refsur,refmat,mshape_sur = NULL,
pal=NULL,NAcol="gray90",show.names=TRUE)
Arguments
x |
a vector of specimens pair. |
pca |
the result of a relative warp analysis. Classes |
refsur |
a list of two |
refmat |
a list of two landmark sets related to |
mshape_sur |
a |
pal |
a vector of colors to be passed to |
NAcol |
the color associated to |
show.names |
logical: if |
Value
Two mesh3d
objects colored according to shape differences.
Additionally, the function returns 3d plots of the meshes.
Author(s)
Marina Melchionna, Silvia Castiglione
Examples
da<-"https://github.com/pasraia/RRmorph_example_data/raw/refs/heads/main/RRmorphdata.rda"
download.file(url=da,destfile = paste0(tempdir(),"/RRmorphdata.rda"))
load(paste0(tempdir(),"/RRmorphdata.rda"))
require(Morpho)
pca<-procSym(endo.set)
ldm_homo<-endo.set[,,"Homo_sapiens"]
sur_homo<-endo.sur[["Homo_sapiens"]]
ldm_macaca<-endo.set[,,"Macaca_fuscata"]
sur_macaca<-endo.sur[["Macaca_fuscata"]]
diffs<-RRmorph::shapeDiff(x=c("Homo_sapiens","Macaca_fuscata"),
pca = pca,refsur = list(sur_homo,sur_macaca),
refmat = list(ldm_homo,ldm_macaca))