visual3d: Annotate and Plot mesh Face with different colorpalette

Description Usage Arguments Value Examples

View source: R/faceplot.R

Description

an interactive graphing function based on the 'rgl' package. it can draw a 3D object with different style and gradient colors.

Usage

1
visual3d(mesh, value = NULL, col = NULL, output = NULL)

Arguments

mesh

a mesh3d object (class qmesh3d or tmesh3d), or for as.mesh3d an object with a method defined.

value

a vector or list. If it is a vector, each of whose elements can be an index or a quantitative value, such as the phenotypic changes under different genotypes. If it is a list, it should be a list of index vector.

col

a vector of colors or a color palette, if it is not given, the default color palette will be used.

output

the output path. the default is NULL. if output is NULL, the plot will not be printed to a file.

Value

an interactive plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(refface)
ref.m <- refface$ref.m
seg.idx<- refface$seg.idx
visual3d(ref.m,output = '../vignettes/ref_face')

nose.idx<- which(seg.idx==10)
visual3d(ref.m,nose.idx,output = '../vignettes/highlight_nose')

visual3d(ref.m,seg.idx,col = colorbar(1:10,c('#377EB8', '#4DAF4A','white', '#984EA3', '#FF7F00')))

seg.lst<- sapply(unique(seg.idx),function(i)which(i==seg.idx))
visual3d(ref.m,seg.lst,col = colorbar(1:10),'../vignettes/seg_lst')

nose.m <- Meshextract(ref.m,nose.idx)
nose.vol<- Meshvolume(nose.m)
visual3d(nose.m,nose.vol)
visual3d(nose.m,nose.vol,col = colorRampPalette(c('white','black')))

changebio/MAGPA documentation built on June 15, 2020, 9:26 p.m.