WEMIsoSurface¶
-
MLModule
¶ genre WEMGenerate
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLWEMModules
definition MLWEMModules.def see also SoWEMRenderer
inherits from WEMGenerator
keywords generate
Purpose¶
The module WEMIsoSurface
generates the isosurface of a scalar volume image at a specified threshold (interval).
Usage¶
Adjust the isothreshold value and supply the module with a scalar volume image. Use a SoWEMRenderer
to generate an Open Inventor scene and to render the resulting scene.
The generated WEM may be modified by a filter (such as WEMSmooth
, WEMDemergePatches
, WEMSubdivide
, or WEMReducePolygons
) after generation and before rendering.
Details¶
The Neighboring Cells algorithm behind the WEMIsoSurface
is similar to the well-known Marching Cubes algorithm: a volume (image) is scanned by discretizing it into cells. At each corner of the cells, the image values are measured. The assignment of corner values leads to a set number of configurations. There are 256 configurations because, in relation to the iso threshold, a corner can be either inside or outside the boundary to be generated. Therefore, a corner can yield two different states, and with eight corners, this sums up to 28 = 256 configurations.
In the Marching Cubes algorithm, there is a list of triangles for each configuration. These triangles are generated in each cell, resulting in a closed surface. In the Neighboring Cells algorithm, however, each configuration leads to the generation of zero to four nodes in each cell. These nodes are associated with the edges of the cell where a surface will pass through. After generating the nodes, the links or surface parts are established in a second processing pass. As in the Marching Cubes algorithm, some ambiguities will arise, but they are detected and resolved during construction.
The WEMIsoSurface
features two iso-values: a minimum and a maximum iso-value. The usage of both values can be toggled. Since the generated isosurface is always closed, we can think of an inside and an outside surface. A voxel value less than the minimum value or greater than the maximum value will result in an outside surface, while all other voxel values will result in an inside surface. If one of the values is not set to be used, the corresponding minimum or maximum image value is considered instead.
In general, if the image values are positive, use the minimum iso-value; if the image values are negative, use the maximum iso-value. In both cases, turn off the usage of the image’s minimum or maximum value.
If interpolation is activated, each cell’s edge associated with a certain node is interpolated linearly, and the interpolated node’s position is set to the centroid of all these interpolated cell edge positions. If interpolation is turned off, all nodes are positioned at the center of their cells, resulting in a voxel-precision isosurface.
The Cell Ext.
parameter determines the sizes of the scanning cells relative to the voxel size of the input image. If the cell extent is set to 1/1/1, each voxel will be scanned. If the cell extent is set to 2/1/1, only every second voxel in the x-direction is scanned. The values for the cell extent may be rational numbers, e.g., 0.5/1/2.3. The interpolation type for subvoxel-resolution cell extents is Nearest Neighbor.
During the surface generation process, the image voxel values are stored for the generated WEMNodes in a WEMPrimitiveValueList called LUT. If more than one voxel value is associated with a WEMNode, the highest value is stored in the corresponding WEMNode. These values may be used later in the SoWEMRenderer
, where they contribute to the coloring of the surface if a LUT is used.
Input Fields¶
The module has one input which must be an image of a scalar data type.
Output Fields¶
The module’s output is a WEM, which is always a 2-manifold (so, there are no holes or any other borders, and all internal pointer links of the primitives are correct).
outWEM¶
-
name:
outWEM
, type:
WEM(MLBase)
¶ - For accessing this object via scripting see the Scripting Reference:
MLWEMWrapper
.
Parameter Fields¶
Field Index¶
Apply : Trigger |
isProcessing : Bool |
taskVerboseLogging : Bool |
Auto Apply : Bool |
Label : String |
Time Point Index (-1=all) : Integer |
Cancel : Trigger |
maxTimePointIndex : Integer |
Update Mode : Enum |
Cell Ext. : Vector3 |
Overwrite label and description : Bool |
Use image max. value : Bool |
clear : Trigger |
progress : Float |
Use image min. value : Bool |
Description : String |
Remove edges after generation : Bool |
Use Voxel Sampling : Bool |
elapsedTime : Float |
Remove nodes with valence 3 : Bool |
useQuadrification : Bool |
Generate in Background : Trigger |
Remove zero-length edges : Bool |
Voxel Sampling : Integer |
id : Integer |
shouldComputeNormals : Bool |
World coordinates : Bool |
Interpolate : Bool |
status : String |
Write values to faces : Bool |
Iso Max. Value : Double |
taskCanceled : Trigger |
Write values to nodes : Bool |
Iso Min. Value : Double |
taskFinished : Trigger |
Visible Fields¶
Auto Apply¶
-
name:
autoApply
, type:
Bool
, default:
TRUE
¶ If checked, the module computes a new output WEM on any parameter change.
see also WEMGenerator.autoApply
Update Mode¶
-
name:
updateMode
, type:
Enum
, default:
AutoUpdate
, deprecated name:
autoUpdate
¶ Defines how this module should react on any input field change.
see also WEMGenerator.updateMode
Overwrite label and description¶
-
name:
overwriteLabelDescription
, type:
Bool
, default:
FALSE
¶ If checked, the label and description string of the output WEM are set to
Label
andDescription
, respectively.
Label¶
-
name:
label
, type:
String
¶ Sets a label string to the output WEM.
see also WEMGenerator.label
Description¶
-
name:
description
, type:
String
¶ Sets a description string to the output WEM.
see also WEMGenerator.description
Iso Min. Value¶
-
name:
isoMinValue
, type:
Double
, default:
1200
¶ Sets the minimum threshold value: the isosurface is generated between pairs of voxels where one voxel’s value exceeds or equals this value and the other voxel’s value falls below it.
Use image min. value¶
-
name:
useMinValue
, type:
Bool
, default:
FALSE
¶ If checked, the image’s minimum value is taken as the minimum iso-value.
Use this option with images containing negative values.
Use image max. value¶
-
name:
useMaxValue
, type:
Bool
, default:
TRUE
¶ If checked, the image’s maximum value is taken as the maximum iso-value.
Since a voxel value is tested against this value by equal or larger (>=), no surface will be generated at all due to this value.
Cell Ext.¶
-
name:
cellExtend
, type:
Vector3
, default:
3 3 3
¶ Sets the cell extents of the Neighboring Cells.
If the extent is set to 1/1/1, each voxel will be investigated, which is the default. If the extent is set to 2/2/2, every second voxel will be investigated. The cell extend can be set to an anisotropic value, such as 2/1/3.
All dimension parameters can be of float type, i.e., 1.2/0.5/3.4. The interpolation method is Nearest Neighbor.
World coordinates¶
-
name:
useWorldCoords
, type:
Bool
, default:
TRUE
¶ If checked, the resulting WEM is generated in world coordinates. Otherwise, the WEM is generated in voxel coordinates.
Interpolate¶
-
name:
useInterpolation
, type:
Bool
, default:
TRUE
¶ If checked, a trilinear interpolation is applied to find the best approximation of the nodes’ positions that reflects the image’s values.
Otherwise, each node is generated at the center of its cell, resulting in the WEM having voxel precision.
Write values to faces¶
-
name:
useFaceValueList
, type:
Bool
, default:
FALSE
¶ If checked, a Primitive Value List (PVL) for the faces is established, holding the nearest image value for each face.
Note: All of these faces are now locked for
WEMReducePolygons
,WEMSmooth
, andWEMSubdivide
operations. If the user attempts to use any of those modules, a warning is printed to the console.
Write values to nodes¶
-
name:
useLUTValueList
, type:
Bool
, default:
TRUE
¶ If checked, a Primitive Value List (PVL) for the nodes is established, holding the image value for each node. The name of this PVL is LUT.
Remove nodes with valence 3¶
-
name:
useValenceThreeRemoval
, type:
Bool
, default:
TRUE
¶ If checked, all nodes with a valence of three are deleted if all their incident edges yield an angle greater than 90 degrees.
Remove zero-length edges¶
-
name:
useZeroLengthEdgeRemoval
, type:
Bool
, default:
TRUE
¶ If checked, all edges with zero length are removed from the resulting WEM. Such edges cause incident faces to have zero area.
Remove edges after generation¶
-
name:
useEdgeRemoval
, type:
Bool
, default:
FALSE
¶ If checked, all edges are removed from the output WEM after its generation.
Time Point Index (-1=all)¶
-
name:
timePointIndex
, type:
Integer
, default:
0
, minimum:
-1
, maximum:
:field:`maxTimePointIndex`
¶ Sets the time point index from which to generate isosurfaces.
If set to -1, isosurfaces for all time point indexes are generated.
Generate in Background¶
-
name:
startTask
, type:
Trigger
¶ When pressed, the module generates a WEM in the background.
Apply¶
-
name:
startTaskSynchronous
, type:
Trigger
, deprecated name:
apply
¶ When pressed, the module computes a new output WEM.
Cancel¶
-
name:
cancelTask
, type:
Trigger
¶ If pressed while the module is generating a WEM in the background, the generation is canceled, and the module returns an empty WEM.
Use Voxel Sampling¶
-
name:
useVoxelSampling
, type:
Bool
, default:
TRUE
¶ If checked, the module uses the simple
Voxel Sampling
to scan the voxel image instead of the more granularCell Ext.
.