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.

Windows

Default Panel

../../../Modules/ML/MLWEMModules/mhelp/Images/Screenshots/WEMReducePolygons._default.png

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

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 and Description.

see also WEMGenerator.overwriteLabelDescription

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 Target Error limit. All remaining edges have a smaller error value.

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).

Swap edges

name: shouldSwapEdges, type: Bool, default: TRUE

If checked, an exhaustive edge-swapping is performed after reducing the amount of polygons, leading to a more balanced mesh.

Swap Angle Limit

name: swapAngleLimit, type: Float, default: 12, minimum: 1, maximum: 90

Sets an angle limit in degrees for the edge-swapping. If the dihedral angle of an edge is greater than this limit, no edge-swapping is performed.

Hidden Fields

isProcessing

name: isProcessing, type: Bool, persistent: no

see WEMGenerator.isProcessing

elapsedTime

name: elapsedTime, type: Float, persistent: no

see WEMGenerator.elapsedTime

id

name: id, type: Integer, default: 0

see WEMGenerator.id

shouldComputeNormals

name: shouldComputeNormals, type: Bool, default: TRUE

see WEMGenerator.shouldComputeNormals

workDirectlyOnInputWEMs

name: workDirectlyOnInputWEMs, type: Bool, default: FALSE

see WEMProcessor.workDirectlyOnInputWEMs

listenToFinishNotifications

name: listenToFinishNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToFinishNotifications

listenToRepaintNotifications

name: listenToRepaintNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToRepaintNotifications

listenToSelectionChangedNotifications

name: listenToSelectionChangedNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToSelectionChangedNotifications

progress

name: progress, type: Float, persistent: no

see WEMProcessor.progress

triangulationMode

name: triangulationMode, type: Enum, default: Strip

see WEMProcessor.triangulationMode

numEdgeCollapses

name: numEdgeCollapses, type: Integer, persistent: no

reduction

name: reduction, type: Integer, default: 0

useExpertMode

name: useExpertMode, type: Bool, default: FALSE

If checked, advanced options are available.

The smooth option corresponds to a middle vertex placement while using the weight factors. Not smoothing corresponds to an optimal vertex placement while not using the weight factors. When the expert mode is used, options can be combined to get a better result.

shouldInterpolatePVLValues

name: shouldInterpolatePVLValues, type: Bool, default: TRUE