PointCloudToMask

MLModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLPointCloudToMask
definition MLPointCloudToMask.def
keywords convert, 3D

Purpose

The module PointCloudToMask converts a (sparse) cloud of points and their normals to either a mask image or a smoothed distance image.

Usage

Attach an image (for determining the output image’s size and matrix) and either a marker list containing at least four vectors, or provide an ASCII file to load the points and normals from.

Details

The points’ positions define the surface while the normals at the points point all either inwards or outwards. Internally, an implicit spline function is generated out of the points and the normals, and this function is evaluated for each voxel of the output image. The result of the evaluation in each voxel is a signed distance value, where a value of 0 can be found on the surface, positive values outside the surface and negative values inside the surface. Due to the spline nature of the implicit function the distance values are smoothed over the space.

A definable threshold can be used to produce a mask image with adjustable foreground and background values. Otherwise, all the distance values can be written to the voxels (this is neither slower nor faster), and an iso surface can be found afterwards. This approach has the advantage that one can produce i.e. security margins quite simply, and the resulting surface is smoothed by the continuous distance function.

Note that the amount of point/normal pairs should be limited to 2000-3000. This is because internally, a NxN matrix needs to be inverted with N=2*numPoints.

A file can be provided for the point/normal pairs that define a surface. This file must be plain ASCII, no header needed. The file must only contain point coordinate triples and normal coordinate triples, separated by spaces in the form

posX1 posY1 posZ1 normalX1 normalY1 normalZ1 posX2 posY2 posZ2 normalX2 normalY2...

Windows

Default Panel

../../../Modules/ML/MLPointCloudToMask/mhelp/Images/Screenshots/PointCloudToMask._default.png

Input Fields

input0

name: input0, type: Image

Reference image for obtaining the world matrix.

inMarkerList

name: inMarkerList, type: XMarkerList(MLBase)

Marker list with only vectors. The positions of the marker mark the points and the vector is taken as the surface normal.

For accessing this object via scripting see the Scripting Reference: MLXMarkerListWrapper.

Output Fields

output0

name: output0, type: Image

Smoothed distance image or mask image.

Parameter Fields

Field Index

Apply: Trigger Threshold: Float
Auto: Bool Use: Bool
Background:: Float Use input markers: Bool
File Name: String  
Foreground:: Float  
Normalize vectors: Bool  
Status: String  
surfacePositionApproximationStrength: Float  

Visible Fields

File Name

name: fileName, type: String

Sets a file name for the ASCII file containing the points and normals.

Use input markers

name: useInputMarkers, type: Bool, default: TRUE

If checked, the module only considers the input marker list.

Otherwise, only the file is loaded.

Use

name: useThreshold, type: Bool, default: FALSE

If checked, the output image is a mask image. Internally, a threshold is applied.

Threshold

name: threshold, type: Float, default: 0

Sets the threshold value.

A value of 0 masks exactly the surface, positive values augment the mask, negative values shrink the mask.

Foreground:

name: foregroundValue, type: Float, default: 4095

Sets a foreground value that is used for the mask object.

Background:

name: backgroundValue, type: Float, default: 0

Sets a background value that is used for the object background.

Normalize vectors

name: normalizeInternalVectors, type: Bool, default: FALSE

If checked, all points’ normals are normalized before computing the smoothed surface function.

Non-normalized normals have a different influence on the curvature; longer normal vector have a greater influence.

Auto

name: autoApply, type: Bool, default: FALSE

If checked, the module computes anew on each field or input change.

Apply

name: apply, type: Trigger

If pressed, the module computes anew.

Status

name: status, type: String, persistent: no

Shows status information about this module.

Hidden Fields

surfacePositionApproximationStrength

name: surfacePositionApproximationStrength, type: Float, default: 0