Learn R Programming

fsbrain (version 0.8.0)

Triangles3D.to.coloredmesh: Convert a misc3d Triangles3D iso-surface to a coloredmesh.

Description

Convert a misc3d::contour3d(draw = FALSE) result (an iso-surface mesh of class 'Triangles3D', e.g., as returned by volvis.contour) into an fs.coloredmesh. This allows rendering volume iso-surfaces with ANY renderer backend: while the rgl backend can render 'Triangles3D' instances directly, the scimesh backend requires fs.coloredmesh instances and converts them automatically, so you normally do not need to call this function yourself.

Usage

Triangles3D.to.coloredmesh(tris, hemi = NULL, add_normals = TRUE)

Value

an fs.coloredmesh instance, or a list of such instances if 'tris' is a list.

Arguments

tris

a 'Triangles3D' instance as returned by misc3d::contour3d(draw = FALSE) or volvis.contour, or a list of such instances (e.g., when multiple frames of a 4D volume were extracted with frame = "all").

hemi

character string or NULL, the hemisphere for the resulting coloredmesh. 'Triangles3D' iso-surfaces are not hemisphere-specific, so this defaults to NULL. See fs.coloredmesh.

add_normals

logical, whether to compute per-vertex normals for the mesh. Required for correct lighting in the scimesh backend, defaults to TRUE.

See Also

Other coloredmesh functions: coloredmesh.from.annot(), coloredmesh.from.label(), coloredmesh.from.mask(), coloredmesh.from.morph.native(), coloredmesh.from.morph.standard(), coloredmesh.from.morphdata(), coloredmeshes.from.color()