checkLM {Morpho} | R Documentation |
Visually browse through a sample rendering its landmarks and corresponding surfaces.
Description
Browse through a sample rendering its landmarks and corresponding surfaces. This is handy e.g. to check if the landmark projection using placePatch was successful, and to mark specific specimen.
Usage
checkLM(
dat.array,
path = NULL,
prefix = "",
suffix = ".ply",
col = "white",
pt.size = NULL,
alpha = 1,
begin = 1,
render = c("w", "s"),
point = c("s", "p"),
add = FALSE,
meshlist = NULL,
Rdata = FALSE,
atlas = NULL,
text.lm = FALSE
)
Arguments
dat.array |
array or list containing landmark coordinates. |
path |
optional character: path to files where surface meshes are stored locally. If not specified only landmarks are displayed. |
prefix |
prefix to attach to the filenames extracted from
|
suffix |
suffix to attach to the filenames extracted from
|
col |
mesh color |
pt.size |
size of plotted points/spheres. If |
alpha |
value between 0 and 1. Sets transparency of mesh 1=opaque 0= fully transparent. |
begin |
integer: select a specimen to start with. |
render |
if render="w", a wireframe will be drawn, else the meshes will be shaded. |
point |
how to render landmarks. "s"=spheres, "p"=points. |
add |
logical: add to existing rgl window. |
meshlist |
list holding meshes in the same order as |
Rdata |
logical: if the meshes are previously stored as Rdata-files by
calling save(), these are simply loaded and rendered. Otherwise it is
assumed that the meshes are stored in standard file formats such as PLY, STL
or OBJ, that are then imported with the function |
atlas |
provide object generated by |
text.lm |
logical: number landmarks. Only applicable when
|
Value
returns an invisible vector of indices of marked specimen.
See Also
placePatch, createAtlas, plotAtlas,
file2mesh
Examples
data(nose)
###create mesh for longnose
longnose.mesh <- tps3d(shortnose.mesh,shortnose.lm,longnose.lm,threads=1)
### write meshes to disk
save(shortnose.mesh, file="shortnose")
save(longnose.mesh, file="longnose")
## create landmark array
data <- bindArr(shortnose.lm, longnose.lm, along=3)
dimnames(data)[[3]] <- c("shortnose", "longnose")
## Not run:
checkLM(data, path="./",Rdata=TRUE, suffix="")
## End(Not run)
## now visualize by using an atlas:
atlas <- createAtlas(shortnose.mesh, landmarks =
shortnose.lm[c(1:5,20:21),],
patch=shortnose.lm[-c(1:5,20:21),])
if (interactive()){
checkLM(data, path="./",Rdata=TRUE, suffix="", atlas=atlas)
}
## remove data from disk
unlink("shortnose")
unlink("longnose")