VoxelizeInventorScene

MLModule
genre Visualization
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLVoxelizeInvScene
definition MLVoxelizeInvScene.def
see also Raster, RasterFunctions
keywords voxelization, raster, volume

Purpose

The module VoxelizeInventorScene voxelizes an arbitrary Open Inventor scene into a voxel image.

The voxelization result may be colored based on the colors of the original polygonal scene.

Additionally, the module allows for filled voxelization of closed surfaces using a scan-line algorithm.

Usage

Simply connect an ML image and an Open Inventor scene to the module.

Ensure that the ML image and the 3D scene share the same world coordinate space.

Details

Firstly, the primitives of the Open Inventor scene (points, lines, and triangles) are collected. The bounding boxes of these primitives are sorted according to slices.

If the surface is to be voxelized, all voxels within the intersecting bounding box of the primitive and the current slice’s bounding box are examined regarding their distance to the primitive. If this distance falls below the adjusted thickness parameter, the voxel is set.

If the resulting image is to be filled, a scan-line algorithm is applied to the 3D primitives (in this case, triangles only). Note: Due to the ratio of polygon size to image resolution (voxel size), some artifacts may appear as incorrect lines; this occurs because of the sampling theorem. Adjust either the voxel size (ImagePropertyConvert, etc.) or the polygon sizes (WEMReducePolygons or WEMSubdivide).

Windows

Default Panel

../../../Modules/ML/MLVoxelizeInvScene/mhelp/Images/Screenshots/VoxelizeInventorScene._default.png

Input Fields

input0

name: input0, type: Image

inInventorScene

name: inInventorScene, type: SoNode

Output Fields

output0

name: output0, type: Image

Parameter Fields

Visible Fields

Apply

name: apply, type: Trigger

When pressed, the module computes anew.

Points

name: allowCollectPoints, type: Bool, default: FALSE

If checked, the module collects information about points and voxelizes those single points.

Lines

name: allowCollectLines, type: Bool, default: FALSE

If checked, the module collects information about lines and voxelizes those lines.

Triangles

name: allowCollectTriangles, type: Bool, default: TRUE

If checked, the module collects information about triangles and voxelizes those triangles.

If this is active, the module can fill surfaces.

Write Voxel Value

name: voxelValue, type: Double, default: 1024

Sets the voxel write value if the Open Inventor scene should not be voxelized with the original color.

Note that if anti-aliasing is active, the border voxels may not have the value set in Write Voxel Value.

Thickness

name: lineWidth, type: Float, default: 1

Sets a thickness for lines and faces.

The interpretation of this value depends on Mode.

Anti-alias

name: useAntiAliasing, type: Bool, default: TRUE

If checked, the lines and faces are voxelized with an anti-aliasing.

This option works for non-colored output only.

Copy input image

name: copyInputImage, type: Bool, default: TRUE

If checked, the input image is copied to the output image.

Otherwise, the background voxels are all set to 0 (or black if voxelized in color).

Note: This mode does not work well with the option Copy input image because the original image values are scaled and copied only to the red channel of the output image, while the green, blue, and alpha channels’ voxels are set to an undefined value.

DrawStyle as Inventor scene

name: drawStyleAsScene, type: Bool, default: FALSE

If checked, the module considers the current draw style of the Open Inventor scene.

For example, if the draw style is Wire Frame, only lines will be voxelized with this option. Otherwise, the faces of the surfaces will also be voxelized.

Filled

name: voxelizeFilled, type: Bool, default: TRUE

If checked and the Open Inventor scene contains surfaces (and Triangles is checked), the module fills the voxelized surfaces with either the Write Voxel Value or the Fill Color / Alpha.

Include border

name: includeBorderOnFill, type: Bool, default: TRUE

If checked, the surface voxels of the voxelized objects are considered when filling a closed surface.

Fill Color

name: fillColor, type: Color, default: 1 1 1

Sets a fill color.

Alpha

name: fillAlpha, type: Float, default: 1, minimum: 0, maximum: 1

Sets a fill alpha value.

Surface

name: voxelizeSurface, type: Bool, default: TRUE

If checked, the surface itself is being voxelized.

On Inventor change

name: autoUpdateInvScene, type: Bool, default: FALSE

If checked, the module computes anew on each update of the attached Open Inventor scene.

On ML image change

name: autoUpdateMLImage, type: Bool, default: FALSE

If checked, the module computes anew on each change of the attached ML image.

On parameter change

name: autoUpdateParameter, type: Bool, default: FALSE

If checked, the module computes anew on each change of any parameter field.

Mode

name: distanceMode, type: Enum, default: WorldDistance

Defines the distance mode. This is how the field Thickness is interpreted.

Values:

Title Name Description
Voxel Distance VoxelDistance The Thickness sets a thickness in number of voxels.
World Distance WorldDistance The Thickness sets a thickness in millimeters.

Colored

name: voxelizeColored, type: Bool, default: FALSE

If checked, the resulting voxel image will be a color image with all the colors of the primitives of the Open Inventor scene. The optional fill voxels will have the color set with Fill Color and Alpha.

Output number of collected primitives

name: showNumCollectedPrimitives, type: Bool, default: FALSE

If checked, the number of collected primitives is printed to the console.

This is a debug feature.

Use Super Sampling

name: useSuperSampling, type: Bool, default: FALSE

If checked, the module uses super-sampling for the filling of surfaces.

With this option enabled, the algorithm uses four rays instead of just one for testing. This approach is slower but numerically more stable.