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 Inventor scene into a voxel image.

The voxelization result may be colored according to the colors of the original polygonal scene.

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

Usage

Just connect an ML image and an Inventor scene to the module.

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

Details

Firstly, the Inventor scene’s primitves (Points, Lines and Triangles) are collected. All those primitives’ bounding boxes are sorted according to slices.

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

If the resulting image should be filled, a scan line algorithm is applied on the 3D primitives (here: triangles only). Note that due to the ratio of polygon size and image resolution (voxel size) some artifacts may appear as uncorrect lines; this is 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

If 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 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 depend 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 that this mode does not work well with using 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’ voxel 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 Inventor scene.

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

Filled

name: voxelizeFilled, type: Bool, default: TRUE

If checked and the 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 regarded while 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 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 mm.

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 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 the filling of surfaces.

Having this option checked, the algorithm uses four rays instead of only one to test. Slower but numerically more stable.