Purpose

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 which also can be configured in this module.

Usage

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

Details

The following parameters control the way vtk image data is converted to ML image data and it also 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 a 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: MLBase

Connect a vtkImageSource or a vtkImageData object to the base input to be converted to an ML paged image.

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

Visible Fields

Convert2Comps To

name: convert2CompsTo, type: Enum, default: Complex

Selects ML output type for vtk images with two scalar comonents

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 with 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

Selects ML output type for vtk images with three scalar comonents

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 with 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 with ML_HUE, ML_SATURATION and ML_VALUE.

Convert4Comps To

name: convert4CompsTo, type: Enum, default: Mat2

Selects ML output type for vtk images with four scalar comonents

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 with 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 with 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

Selects ML output type for vtk images with six scalar comonents

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

Selects ML output type for vtk images with nine scalar comonents

Values:

Title Name Description
Vec9 Vec9 Four component voxels from vtk are converted to vecf9 or vec9 ML voxels.
Mat3 Mat3 Six component voxels from vtk are converted to ML voxels of type mat3 or matf3.

Convert16Comps To

name: convert16CompsTo, type: Enum, default: Mat4

Selects ML output type for vtk images with 16 scalar comonents

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

Selects ML output type for vtk images with 25 scalar comonents

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

Selects ML output type for vtk images with 36 scalar comonents

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

Direction cosines matrix which is integrated in world matrix of ML if Use Direction Cosines is on.

Use Direction Cosines

name: useDirCosines, type: Bool, default: FALSE

If enabled then the direction cosines matrix is integrated in world matrix of ML.

VTKImage Extent

name: VTKExtent, type: IntVector6, persistent: no

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

Adapt Origin To VTKImage Extent

name: adaptOriginToVTKExtent, type: Bool, default: TRUE

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

Status

name: status, type: String, default: Invalid/open input

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

Img Info

name: imgInfo, type: String, default: No valid vtkImageData connected

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.