WEMReducePolygons¶
-
MLModule
¶ genre WEMProcessing
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLWEMModules
definition MLWEMModules.def see also WEMSubdivide
inherits from WEMProcessor
keywords collapse
,reduction
,simplification
,quadric
,error
,metric
,surface
Purpose¶
The module WEMReducePolygons
reduces the number of primitives in the input WEM by collapsing edges using a quadric error metric to determine the order of collapsing.
Usage¶
Note that the module will not reduce single-colored faces. If a WEM patch consists solely of single-colored faces, the module will not reduce any polygons and will print a warning to the console.
Details¶
The edge collapse method collapses an edge so that its former head and tail nodes coincide (with only one remaining in the mesh). When collapsing an edge, its two adjacent faces are also removed from the mesh.
Each collapse operation introduces an error in the resulting mesh. It is advisable to first collapse those edges that introduce as little error as possible in the resulting mesh. To describe the error introduced, the Quadric Error Metric is used. More information on the topic can be found here
Tips¶
For a WEMIsoSurface
generated mesh, the reduction percentage can easily be set to 70% without losing geometric information. An error value of 2 produces a comparable result.
Input Fields¶
inWEM¶
-
name:
inWEM
, type:
WEM(MLBase)
¶ The input WEM that needs a reduction in the number of polygons.
For accessing this object via scripting see the Scripting Reference:MLWEMWrapper
.
Output Fields¶
outWEM¶
-
name:
outWEM
, type:
WEM(MLBase)
¶ The WEM with the reduced number of polygons.
For accessing this object via scripting see the Scripting Reference:MLWEMWrapper
.
Parameter Fields¶
Field Index¶
Apply : Trigger |
numEdgeCollapses : Integer |
Swap edges : Bool |
Auto Apply : Bool |
Overwrite label and description : Bool |
Target Error : Float |
Clear : Trigger |
progress : Float |
triangulationMode : Enum |
Description : String |
reduction : Integer |
Update Mode : Enum |
elapsedTime : Float |
Reduction Mode : Enum |
Use edge length weights : Bool |
id : Integer |
Reduction Percentage : Integer |
Use face area weights : Bool |
isProcessing : Bool |
shouldComputeNormals : Bool |
Use node valence weights : Bool |
Label : String |
shouldInterpolatePVLValues : Bool |
useExpertMode : Bool |
listenToFinishNotifications : Bool |
Skip edges with PVL difference : Bool |
Vertex Placement : Enum |
listenToRepaintNotifications : Bool |
Smooth : Bool |
workDirectlyOnInputWEMs : Bool |
listenToSelectionChangedNotifications : Bool |
Swap Angle Limit : Float |
Visible Fields¶
Auto Apply¶
-
name:
autoApply
, type:
Bool
, default:
TRUE
¶ If checked, the module will reduce the polygons of the input WEM on any change of a parameter.
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
Apply¶
-
name:
apply
, type:
Trigger
¶ When pressed, the module reduces the number of polygons of the input WEM.
see also WEMGenerator.apply
Clear¶
-
name:
clear
, type:
Trigger
¶ When pressed, the output WEM is cleared (made empty).
see also WEMGenerator.clear
Overwrite label and description¶
-
name:
overwriteLabelDescription
, type:
Bool
, default:
FALSE
¶ If checked, label and description strings are set in the output WEM to
Label
andDescription
.
Label¶
-
name:
label
, type:
String
¶ Sets a label string in the output WEM.
see also WEMGenerator.label
Description¶
-
name:
description
, type:
String
¶ Sets a description string in the output WEM.
see also WEMGenerator.description
Reduction Mode¶
-
name:
reductionMode
, type:
Enum
, default:
ErrorValue
¶ Defines the stopping criterion for reduction.
Values:
Title | Name | Description |
---|---|---|
Percentage | Percentage | The reduction algorithm stops if the Reduction Percentage percentage of edges has been removed. |
Error Value | ErrorValue | The reduction algorithm stops if the largest error exceeds the The error value is computed for edges because the algorithm actually collapses edges. The error value of an edge is always positive (> 0) and grows exponentially; a smaller error value (< 2) generally helps maintain the overall shape of the surface. There is no upper limit for the error value, but at a certain point, depending on the overall structure of the surface, a high error value can cause degeneration of the surface. For example, to reduce thin, elongated parts (e.g., in vascular surfaces), a relatively high error value needs to be set. |
Reduction Percentage¶
-
name:
targetReduction
, type:
Integer
, default:
70
, minimum:
0
, maximum:
100
¶ Sets the required amount of reduction. The parameter ranges from 0 to 100 percent, although very small and very large reduction rates are not effective.
Target Error¶
-
name:
targetError
, type:
Float
, default:
2
¶ Sets the maximum target error for reduction.
Smooth¶
-
name:
smooth
, type:
Bool
, default:
TRUE
¶ If checked, the generated mesh will be smoothed.
The resulting error will be a slightly larger - removing more features - but the quality of the mesh will improve.
Vertex Placement¶
-
name:
vertexPlacementMode
, type:
Enum
, default:
Middle
¶ Defines the vertex placement mode.
Although the resulting Quadric Error is clearly larger in the case of Middle placement, the resulting mesh tends to be smoother.
Values:
Title | Name | Description |
---|---|---|
Optimal | Optimal | A new node will be inserted in such a way that the resulting quadric error is minimized. |
Middle | Middle | A new node is inserted directly in the middle between the former head and tail nodes of an edge. |
Use face area weights¶
-
name:
areaWeightedQuadrics
, type:
Bool
, default:
TRUE
¶ If checked, edges between triangles with small areas are collapsed first, promoting uniform face areas.
Use node valence weights¶
-
name:
valenceWeightedQuadrics
, type:
Bool
, default:
TRUE
¶ If checked, edges with head and tail nodes that have a low valence are collapsed first.
The resulting valence for the new node is valencehead + valencetail - 2. This approach encourages overall uniform triangles.
Use edge length weights¶
-
name:
edgeWeightedQuadrics
, type:
Bool
, default:
TRUE
¶ If checked, edges with short lengths are collapsed first, promoting uniform face areas.
Skip edges with PVL difference¶
-
name:
shouldLeaveEdgesWithDifferentPVLValues
, type:
Bool
, default:
FALSE
¶ If checked, edges with different Primitive Value List (PVL) values at their head and tail nodes are skipped; that is, they are never reduced.
Use this option for reducing WEMs where integer values are stored in the PVL for labeled color look-up (e.g., the result of
WEMVascularSystem
).