vtkMesh2Image: convert a 3D triangular mesh into a voxel image

Description Usage Arguments Examples

View source: R/vtkMesh2Image.r

Description

convert a 3D triangular mesh into a voxel image

Usage

1
2
vtkMesh2Image(mesh, spacing = c(0.5, 0.5, 0.5), filename = "default.mha",
  IJK2RAS = diag(c(-1, -1, 1)), margin = 0.1, col = 255, tol = 0)

Arguments

mesh

triangular mesh of class mesh3d

spacing

numeric vector of length 3: voxel spacings

filename

filename to save as. Can be mha/mhd for VTK_VERSION < 6.2 and additionally nii or nii.gz else

IJK2RAS

3x3 transformation matrix from point to image space

margin

percentage of margin to add around the volume

col

integer: value 0 <= col <= 255. Defines the foreground color.

tol

The tolerance for including a voxel inside the stencil. This is in fractions of a voxel, and must be between 0 and 1. Tolerance is only applied in the x and y directions, not in z. Setting the tolerance to zero disables all tolerance checks and might result in faster performance.

Examples

1
2
3
require(Rvcg)
data(dummyhead)
vtkMesh2Image(dummyhead.mesh)

zarquon42b/RvtkStatismo documentation built on May 4, 2019, 9:09 p.m.