Learn R Programming

fsbrain (version 1.0.0)

shell.extract.mesh: Extract the iso-surface mesh of a volume at one level.

Description

The mesh is returned in the voxel space of the volume, using 1-based R array indices (i.e., the first voxel of the volume is at index 1), no matter which backend is used. Use index2ras_tkr (not vox2ras_tkr(), which expects 0-based CRS indices) to transform such a mesh to surface RAS. The result is welded and free of degenerate faces, see mesh.weld.

Usage

shell.extract.mesh(volume, level, backend)

Value

a mesh3d instance with normals, in the voxel space of the volume, or NULL if the level is not within the range of the data.

Arguments

volume

a 3D numerical array, in voxel space.

level

numerical, the iso-level.

backend

character string, 'Rvcg' or 'misc3d'.