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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IImageMarchingCubesInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes | |
dims | Vector3 | Yes | |
slice | Number | Yes | number of points in one i-j slice |
spacing | Vector3 | Yes | |
s | TypedArray or Array[Number] | Yes | scalar values |
g | Array[Number] | Yes | gradient 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.
| Argument | Type | Required | Description |
|---|---|---|---|
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes | |
dims | Vector3 | Yes | |
slice | Number | Yes | number of points in one i-j slice |
spacing | Vector3 | Yes | |
scalars | TypedArray 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.
| Argument | Type | Required | Description |
|---|---|---|---|
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes | |
origin | Vector3 | Yes | |
spacing | Vector3 | Yes |
getVoxelScalars
Cache the point ids and the scalar values of the eight corners of the voxel whose origin is i-j-k.
| Argument | Type | Required | Description |
|---|---|---|---|
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes | |
slice | Number | Yes | number of points in one i-j slice |
dims | Vector3 | Yes | |
origin | Vector3 | Yes | |
spacing | Vector3 | Yes | |
s | TypedArray or Array[Number] | Yes | scalar values |
newInstance
Method used to create a new instance of vtkImageMarchingCubes
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IImageMarchingCubesInitialValues | No | for pre-setting some of its content |
produceTriangles
Append the triangles contributed by one voxel to points, tris and, when computeNormals is on, normals.
| Argument | Type | Required | Description |
|---|---|---|---|
cVal | Number | Yes | contour value |
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes | |
extent | Extent | Yes | |
slice | Number | Yes | number of points in one i-j slice |
dims | Vector3 | Yes | |
origin | Vector3 | Yes | |
spacing | Vector3 | Yes | |
scalars | TypedArray or Array[Number] | Yes | |
points | Array[Number] | Yes | |
tris | Array[Number] | Yes | |
normals | Array[Number] | Yes |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setComputeNormals
Set whether point normals are interpolated from the scalar gradient.
| Argument | Type | Required | Description |
|---|---|---|---|
computeNormals | Boolean | Yes |
setContourValue
Set the iso-value at which the surface is extracted.
| Argument | Type | Required | Description |
|---|---|---|---|
contourValue | Number | Yes |
setMergePoints
Set whether points shared by neighboring voxels are merged.
| Argument | Type | Required | Description |
|---|---|---|---|
mergePoints | Boolean | Yes |