vcg_isosurface | R Documentation |
Create surface from 3D-array using marching cubes algorithm
vcg_isosurface(
volume,
threshold_lb = 0,
threshold_ub = NA,
vox_to_ras = diag(c(-1, -1, 1, 1))
)
volume |
a volume or a mask volume |
threshold_lb |
lower-bound threshold for creating the surface; default
is |
threshold_ub |
upper-bound threshold for creating the surface; default
is |
vox_to_ras |
a |
A triangular mesh of class 'mesh3d'
if(is_not_cran()) {
library(ravetools)
data("left_hippocampus_mask")
mesh <- vcg_isosurface(left_hippocampus_mask)
rgl_view({
rgl_call("mfrow3d", 1, 2)
rgl_call("title3d", "Direct ISOSurface")
rgl_call("shade3d", mesh, col = 2)
rgl_call("next3d")
rgl_call("title3d", "ISOSurface + Implicit Smooth")
rgl_call("shade3d",
vcg_smooth_implicit(mesh, degree = 2),
col = 3)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.