VTKToMLImage

MLModule

genre

VTKAdapters

author

MeVis Medical Solutions AG

package

MeVisLab/VTK

dll

MLVTKAdapters

definition

MLVTKAdapters.def

see also

ImageLoad, LocalImage, MLToVTKArray, MLToVTKImage, SoVTK, WEMToVTKPolyData, VTKPolyDataToWEM, MLBaseToVTKPolyData

keywords

convert, loader, memory, source, input, translate, transfer, reformat, cross, interface, adapter

Purpose

The module VTKToMLImage converts the output of a vtkImageSource or a vtkImageData object to an ML image.

A vtkImageSource or a vtkImageData provide a number of voxel types and number of components. These image types may be converted to different ML image types that also can be configured in this module.

Usage

Connect a vtkImageSource or a vtkImageData object and check whether the connection is valid (shown in Status and Img Info). If necessary, configure the conversion to output voxels.

Details

The parameters of this module control the way VTK image data is converted to ML image data and it shows some additional information about the connected VTK image data object. Note that all numbers of VTK components not mentioned explicitly are converted automatically to the best fitting floating-point vector type of the ML (if there is any).

Some rarely used VTK data formats with more than 1 component per voxel cannot be matched exactly to an ML image type. In this case, the next better fitting ML type is used instead, or – if that also does not exist – the output image is invalidated. This happens only if the number of scalar components is larger than 64.

Windows

Default Panel

../../../Modules/ML/MLVTKAdapters/mhelp/Images/Screenshots/VTKToMLImage._default.png

Input Fields

inputvtkImageData

name: inputvtkImageData, type: VTKObjectWrapper(MLBase)

Connect a vtkImageSource or a vtkImageData object to the Base input to be converted to a PagedImage.

Output Fields

output0

name: output0, type: Image

The ML image converted from the input base field. It will be invalid if no valid vtkImageSource or vtkImageData has been connected.

Parameter Fields

Field Index

Adapt Origin To VTKImage Extent: Bool

Convert9Comps To: Enum

Convert16Comps To: Enum

Direction Cosines: Matrix

Convert25Comps To: Enum

Img Info: String

Convert2Comps To: Enum

Status: String

Convert36Comps To: Enum

Use Direction Cosines: Bool

Convert3Comps To: Enum

VTKImage Extent: IntVector6

Convert4Comps To: Enum

Convert6Comps To: Enum

Visible Fields

Convert2Comps To

name: convert2CompsTo, type: Enum, default: Complex

Defines the ML output type for VTK images with two scalar components.

Values:

Title

Name

Description

​Vec2

​Vec2

​Two component voxels from VTK are converted to vecf2 or vec2 ML voxels.

​Luminance Alpha

​LuminanceAlpha

​Two component voxels from VTK are converted to scalar ML voxels into two color channels named ML_LUMINANCE and ML_ALPHA.

​Complex

​Complex

​Two component voxels from VTK are converted to complex ML voxels.

Convert3Comps To

name: convert3CompsTo, type: Enum, default: Vec3

Defines the ML output type for VTK images with three scalar components.

Values:

Title

Name

Description

​Vec3

​Vec3

​Three component voxels from VTK are converted to vecf3 or vec3 ML voxels.

​Red Green Blue

​RedGreenBlue

​Three component voxels from VTK are converted to scalar ML voxels into three color channels named ML_RED, ML_GREEN, and ML_BLUE.

​Hue Saturation Value

​HueSaturationValue

​Three component voxels from VTK are converted to scalar ML voxels into three color channels named ML_HUE, ML_SATURATION, and ML_VALUE.

Convert4Comps To

name: convert4CompsTo, type: Enum, default: Mat2

Defines the ML output type for VTK images with four scalar components.

Values:

Title

Name

Description

​Vec4

​Vec4

​Four component voxels from VTK are converted to vecf4 or vec4 ML voxels.

​Red Green Blue Alpha

​RedGreenBlueAlpha

​Four component voxels from VTK are converted to scalar ML voxels into four color channels named ML_RED, ML_GREEN, ML_BLUE, and ML_ALPHA.

​Hue Saturation Value Alpha

​HueSaturationValueAlpha

​Four component voxels from VTK are converted to scalar ML voxels into four color channels named ML_HUE, ML_SATURATION and ML_VALUE, and ML_ALPHA.

​Mat2

​Mat2

​Four component voxels from VTK are converted to mat2f or mat2 ML voxels.

​Quaternion

​Quaternion

​Four component voxels from VTK are converted to quaternionf or qauterniond ML voxels.

Convert6Comps To

name: convert6CompsTo, type: Enum, default: Vec6

Defines the ML output type for VTK images with six scalar components.

Values:

Title

Name

Description

​Vec6

​Vec6

​Six component voxels from VTK are converted to vecf6 or vec6 ML voxels.

​Vector16

​Vector16

​Six component voxels from VTK are converted to ML voxels of type Vector16.

​Vector

​Vector

​Six component voxels from VTK are converted to ML voxels of type Vector.

​Vector64

​Vector64

​Six component voxels from VTK are converted to ML voxels of type Vector64.

Convert9Comps To

name: convert9CompsTo, type: Enum, default: Mat3

Defines the ML output type for VTK images with nine scalar components.

Values:

Title

Name

Description

​Vec9

​Vec9

​Nine component voxels from VTK are converted to vecf9 or vec9 ML voxels.

​Mat3

​Mat3

​Nine component voxels from VTK are converted to ML voxels of type mat3 or matf3.

Convert16Comps To

name: convert16CompsTo, type: Enum, default: Mat4

Defines the ML output type for VTK images with 16 scalar components.

Values:

Title

Name

Description

​Vec16

​Vec16

​16 component voxels from VTK are converted to vecf16 or vec16 ML voxels.

​Mat4

​Mat4

​16 component voxels from VTK are converted to ML voxels of type mat4 or matf4.

Convert25Comps To

name: convert25CompsTo, type: Enum, default: Mat5

Defines the ML output type for VTK images with 25 scalar components.

Values:

Title

Name

Description

​Vec32

​Vec32

​25 component voxels from VTK are converted to vecf32 or vec32 ML voxels.

​Mat5

​Mat5

​25 component voxels from VTK are converted to ML voxels of type mat5 or matf5.

Convert36Comps To

name: convert36CompsTo, type: Enum, default: Mat6

Defines the ML output type for VTK images with 36 scalar components.

Values:

Title

Name

Description

​Vec64

​Vec64

​36 component voxels from VTK are converted to vecf64 or vec64 ML voxels.

​Mat6

​Mat6

​36 component voxels from VTK are converted to ML voxels of type mat6 or matf6.

Direction Cosines

name: dirCosines, type: Matrix, default: 1 0 0 0, 0 1 0 0, 0 0 1 0, 0 0 0 1

Sets the direction cosines matrix to be integrated in the world matrix of ML if Use Direction Cosines is checked.

Use Direction Cosines

name: useDirCosines, type: Bool, default: FALSE

If checked, the direction cosines matrix is integrated into the voxel-to-world matrix of the ML image.

VTKImage Extent

name: VTKExtent, type: IntVector6, persistent: no

Shows the extent of the connected VTK image. Do not confuse this with the 6D image extent of ML images! Read as startX, endX, startY, endY, startZ, and endZ.

Adapt Origin To VTKImage Extent

name: adaptOriginToVTKExtent, type: Bool, default: TRUE

If checked, the output world matrix origin is adapted based on the VTK extent (might be necessary if the extent does not start at (0,0,0)).

Status

name: status, type: String, persistent: no

Shows the current connection state of the VTK base input. It also shows error information of impossible conversions or reasons for that.

Img Info

name: imgInfo, type: String, persistent: no

Shows information about the connected input image (if there is one). This includes number of VTK cells, points, image components, image extent, the VTK voxel data type and its ID, voxel spacing, and image minimum and maximum values.