VoxelizeWEM

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

Purpose

The VoxelizeWEM allows to voxelize the surface of a WEM mesh to a given reference coordinate system given by the input image (but only inside the bounds of the input image). It supports both voxel thickness and world thickness, but using voxel thickness is considerably faster. It can also fill the inside and provide anti-aliasing.

It makes use of the OpenVDB (http://www.openvdb.org/) library.

Tips

If you want to voxelize the WEM to an image that has just the right size you might consider to use the GenerateImageForBoundingBox module, which will create an image grid of the needed size aligned to the world axes if you feed it the bounding box values from, e.g., an WEMInfo module.

Windows

Default Panel

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

Output Fields

output1

name: output1, type: Image

index of closest triangle

output2

name: output2, type: Image

closest PVL value

output3

name: output3, type: Image

closest PVL value

output4

name: output4, type: Image

closest normal

Parameter Fields

Visible Fields

Update

name: update, type: Trigger

Updates the output according to all parameters.

Clear

name: clear, type: Trigger

Clears the output.

Mode

name: mode, type: Enum, default: Surface

Selects in which mode the module operates.

Values:

Title Name Description
Signed Distance SignedDistance The module outputs a signed distance field (using float as output datatype). The distance is positive on the outside of a closed mesh and negative inside.
Surface Surface The module outputs the surface (and optionally fills it and applies anti-aliasing).

Distance Mode

name: distanceMode, type: Enum, default: VoxelDistance

Allows to choose if the distance calculations use world or voxel distances. The distance mode is used for Surface Thickness and for the output distances in SignedDistance mode.

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

Values:

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

Surface

name: surface, type: Bool, default: TRUE

If enabled, 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 enabled, the inside of closed meshes is filled.

Anti-aliasing

name: antiAliasing, type: Bool, default: TRUE

Enables anti-aliasing on the borders of the surface and/or the filling.

Interior Bandwidth

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

Defines the inner bandwidth (in voxels) when SignedDistance mode is used. The signed distance field is only propagated this far into the inside of a surface. All other inner voxels are set to the bandwidth distance.

Exterior Bandwidth

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

Defines 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 enabled, 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 enabled, output2 outputs a double image where the values indicate the closest PVL value of the PVL specified in PVL name.

Interpolate PVL

name: interpolatePVL, type: Bool, default: FALSE

If enabled, per node PVL values are interpolated using the barycentric coordinates of the triangle. If disabled, the closes point’s PVL value is used uninterpolated.

Invalid PVL value

name: invalidPVLValue, type: Double, default: 0

The value that is written where no PVL value is available.

PVL name

name: pvlName, type: String, default: LUT

The name of the PVL that is used. We support per face and per node PVLs.

Invert Normals

name: invertNormals, type: Bool, default: FALSE

Invert the normals of the normal output image.

Output Closest Node

name: outputClosestNode, type: Bool, default: FALSE

Output an image with the indices to the closest WEM node.

Output Closest Normal

name: outputClosestNormal, type: Bool, default: FALSE

Output the closest normals.

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 type of the normal output image.

Values:

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