Skip to content

ImageMarchingCubes ​

Introduction ​

vtkImageMarchingCubes - generate an isosurface from a vtkImageData

vtkImageMarchingCubes is a filter that takes a vtkImageData as input and generates, using the marching cubes case table, a vtkPolyData containing the triangles of the isosurface at the requested contour value.

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkImageMarchingCubes characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIImageMarchingCubesInitialValuesNo(default: {})

getComputeNormals ​

Get whether point normals are interpolated from the scalar gradient.

getContourValue ​

Get the iso-value at which the surface is extracted.

getMergePoints ​

Get whether points shared by neighboring voxels are merged.

getPointGradient ​

Compute the scalar gradient at the i-j-k point and store it in g.

ArgumentTypeRequiredDescription
iNumberYes
jNumberYes
kNumberYes
dimsVector3Yes
sliceNumberYesnumber of points in one i-j slice
spacingVector3Yes
sTypedArray or Array[Number]Yesscalar values
gArray[Number]Yesgradient output

getVoxelGradients ​

Compute the gradients of the eight corners of the voxel whose origin is i-j-k and cache them for the next call to produceTriangles.

ArgumentTypeRequiredDescription
iNumberYes
jNumberYes
kNumberYes
dimsVector3Yes
sliceNumberYesnumber of points in one i-j slice
spacingVector3Yes
scalarsTypedArray or Array[Number]Yes

getVoxelPoints ​

Compute the world coordinates of the eight corners of the voxel whose origin is i-j-k and cache them for the next call to produceTriangles.

ArgumentTypeRequiredDescription
iNumberYes
jNumberYes
kNumberYes
originVector3Yes
spacingVector3Yes

getVoxelScalars ​

Cache the point ids and the scalar values of the eight corners of the voxel whose origin is i-j-k.

ArgumentTypeRequiredDescription
iNumberYes
jNumberYes
kNumberYes
sliceNumberYesnumber of points in one i-j slice
dimsVector3Yes
originVector3Yes
spacingVector3Yes
sTypedArray or Array[Number]Yesscalar values

newInstance ​

Method used to create a new instance of vtkImageMarchingCubes

ArgumentTypeRequiredDescription
initialValuesIImageMarchingCubesInitialValuesNofor pre-setting some of its content

produceTriangles ​

Append the triangles contributed by one voxel to points, tris and, when computeNormals is on, normals.

ArgumentTypeRequiredDescription
cValNumberYescontour value
iNumberYes
jNumberYes
kNumberYes
extentExtentYes
sliceNumberYesnumber of points in one i-j slice
dimsVector3Yes
originVector3Yes
spacingVector3Yes
scalarsTypedArray or Array[Number]Yes
pointsArray[Number]Yes
trisArray[Number]Yes
normalsArray[Number]Yes

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setComputeNormals ​

Set whether point normals are interpolated from the scalar gradient.

ArgumentTypeRequiredDescription
computeNormalsBooleanYes

setContourValue ​

Set the iso-value at which the surface is extracted.

ArgumentTypeRequiredDescription
contourValueNumberYes

setMergePoints ​

Set whether points shared by neighboring voxels are merged.

ArgumentTypeRequiredDescription
mergePointsBooleanYes