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 of the input WEM by collapsing edges using a quadric error metric to decide which edges to collapse first.
Usage¶
Note that the module will not reduce single-colored faces. If a WEM patch consists of only single-colored faces, the module will reduce no polygons and print a warning to the console.
Details¶
The edge collapse method collapses an edge so that its former head and tail nodes fall together (and only one of them remains 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 feasible 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 geometrical 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
¶ If pressed, the module reduces the number of polygons of the input WEM.
see also WEMGenerator.apply
Clear¶
-
name:
clear
, type:
Trigger
¶ If 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) will mostly keep the overall shape of the surface intact. 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 a degeneration of the surface. For example, to reduce thin, elongated parts (e.g., in vascular surfaces), a rather high error value needs to be set. |
Reduction Percentage¶
-
name:
targetReduction
, type:
Integer
, default:
70
, minimum:
0
, maximum:
100
¶ Sets the amount of reduction that is required. The parameter ranges from 0 to 100 percent, although very small and very large reduction rates are not useful.
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 little 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 | New node will be inserted in such a way that the resulting Quadric Error is as small as possible. |
Middle | Middle | New nodes are just inserted in the middle between the former head and tail node. |
Use face area weights¶
-
name:
areaWeightedQuadrics
, type:
Bool
, default:
TRUE
¶ If checked, edges between triangles with a small area are collapsed first. Uniform face areas are encouraged this way.
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. Overall uniform triangles are encouraged this way.
Use edge length weights¶
-
name:
edgeWeightedQuadrics
, type:
Bool
, default:
TRUE
¶ If checked, edges with a short length are collapsed first. Uniform face areas are encouraged this way.
Skip edges with PVL difference¶
-
name:
shouldLeaveEdgesWithDifferentPVLValues
, type:
Bool
, default:
FALSE
¶ If checked, edges with different PVL values at their head and tail node are skipped, i.e., 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., result of
WEMVascularSystem
).