VoxelizeWEM

MLModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLOpenVDB
definition MLOpenVDB.def
keywords distance

Purpose

The VoxelizeWEM allows for voxelizing the surface of a WEM mesh to a given reference coordinate system defined by the input image (but only within the bounds of the input image). It supports both voxel thickness and world thickness; however, using voxel thickness is considerably faster. Additionally, it can fill the interior and provide anti-aliasing.

It utilizes the OpenVDB library.

Tips

If you want to voxelize the WEM to an image that has the appropriate size, you might consider using the GenerateImageForBoundingBox module, which will create an image grid of the needed size aligned to the world axes if you provide it with the bounding box values from, for example, WEMInfo module.

Windows

Default Panel

../../../Projects/MLOpenVDB/MLOpenVDB/Modules/mhelp/Images/Screenshots/VoxelizeWEM._default.png

Output Fields

output1

name: output1, type: Image

The index of the closest triangle.

output2

name: output2, type: Image

The index of the closest node.

output3

name: output3, type: Image

The closest PVL value.

output4

name: output4, type: Image

The closest normal.

Parameter Fields

Visible Fields

Update

name: update, type: Trigger

When pressed, the output according to all parameters is updated.

Clear

name: clear, type: Trigger

When pressed, the output is cleared.

Mode

name: mode, type: Enum, default: Surface

Defines the mode in which the module operates.

Values:

Title Name Description
Signed Distance SignedDistance The module outputs a signed distance field, using float as the output data type. The distance is positive outside a closed mesh and negative inside.
Surface Surface The module outputs the surface and can optionally fill it and apply anti-aliasing.

Distance Mode

name: distanceMode, type: Enum, default: VoxelDistance

Defines whether the distance calculations use world or voxel distances.

The distance mode is utilized for Surface Thickness and for the output distances in SignedDistance mode.

NOTE: World distances are significantly slower, as the grid needs to undergo an extra resampling step.

Values:

Title Name Description
World Distance WorldDistance Use world distances in millimeters.
Voxel Distance VoxelDistance Use voxel distances.

Surface

name: surface, type: Bool, default: TRUE

If checked, the surface is voxelized.

Surface Thickness

name: surfaceThickness, type: Float, default: 1

Sets the thickness of the surface in voxels.

Fill Inside

name: fillInside, type: Bool, default: TRUE

If checked, the inside of closed meshes is filled.

Anti-aliasing

name: antiAliasing, type: Bool, default: TRUE

If checked, anti-aliasing on the borders of the surface and/or the filling is enabled.

Interior Bandwidth

name: interiorBandwidth, type: Double, default: 3, minimum: 1

Sets the inner bandwidth in voxels when SignedDistance mode is used.

The signed distance field is propagated only this far into the interior of a surface. All other inner voxels are set to the bandwidth distance.

Exterior Bandwidth

name: exteriorBandwidth, type: Double, default: 3, minimum: 1

Sets the outer bandwidth in voxels when SignedDistance mode is used.

The signed distance field is only propagated this far outside of a surface. All other outer voxels are set to the bandwidth distance.

Output Closest Triangle

name: outputClosestTriangle, type: Bool, default: FALSE

If checked, output1 outputs an int32 image, where the values indicate the closest triangle index of the WEM.

Output closest PVL

name: outputClosestPVL, type: Bool, default: FALSE

If checked, output3 outputs a double image where the values indicate the closest PVL value specified in PVL name.

Interpolate PVL

name: interpolatePVL, type: Bool, default: FALSE

If checked, per-node PVL values are interpolated using the barycentric coordinates of the triangle. Otherwise, the closest point’s PVL value is used without interpolation.

Invalid PVL value

name: invalidPVLValue, type: Double, default: 0

Sets the value that is written where no PVL value is available.

PVL name

name: pvlName, type: String, default: LUT

Sets the name of the PVL that is used. The module supports per-face and per-node PVLs.

Invert Normals

name: invertNormals, type: Bool, default: FALSE

If checked, the normals of the normal output image are inverted.

Output Closest Node

name: outputClosestNode, type: Bool, default: FALSE

If checked, an image with the indices of the closest WEM node is output at output2.

Output Closest Normal

name: outputClosestNormal, type: Bool, default: FALSE

If checked, the closest normals are output in output4.

Normal Mode

name: normalMode, type: Enum, default: FaceNormal

Defines which normals are used.

Values:

Title Name Description
Face Normal FaceNormal The closest face’s normal.
Node Normal NodeNormal The normal of the closest node.
Interpolated Node Normal InterpolatedNodeNormal The interpolated normal of the closest face’s node normals (renormalized).

Normal Type

name: normalType, type: Enum, default: Type_UInt8

Defines the data type of the normal output image.

Values:

Title Name Description
UInt8 Type_UInt8 Uint8 in three color channels, in the range of 0-255 (centered around 128). This format can be used for the SoGVRGradientVolume.
Double Type_Double Double values ranging from -1 to 1 in three color channels.
Vector3 Type_Vector3 Vector3 is used for the normals.