AffineTransformation3D

MLModule
genre SpatialTransformation
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLTransformation
definition MLTransformation.def
keywords rotate, translate, shear, scale, image

Purpose

This module warps an input volume according to a three-dimensional affine coordinate transformation, using trilinear interpolation.

Usage

Translation, rotation, shearing and scaling can be entered and reset. The field for the transformation matrix is read-only.

Limitations:
  • the field Matrix is not updated when no output image is demanded.
  • works efficiently only with datatypes of < MLuint16

Details

The module uses the well-known backward mapping technique (see e.g. the excellent monography by George Wolberg: Digital image warping). From the given parameters the module constructs a transformation matrix for the backward mapping. This transformation matrix B maps a point y in the output volume onto the corresponding point x in the input volume:

../../../Modules/ML/MLTransformation/mhelp/Images/image008.gif

The idea of backwarp mapping graphically:

../../../Modules/ML/MLTransformation/mhelp/Images/image018.jpg

To achieve sub-voxel resolution, trilinear interpolation is applied in the input volume. The origin of the coordinate system is in the center of the output volume.

The order for constructing the matrix is shearing, rotation, scaling, translation (the translation is applied after the other transformations).

Windows

Default Panel

../../../Modules/ML/MLTransformation/mhelp/Images/Screenshots/AffineTransformation3D._default.png

Input Fields

input0

name: input0, type: Image

The input volume.

Output Fields

output0

name: output0, type: Image

The output volume is the warped input volume.

Parameter Fields

Field Index

Is World Transformation: Bool Scaling Y: Double Translation Z: Double
Matrix: Matrix Scaling Z: Double World Voxel Transformation: Matrix
Opt Parameters: String Shearing X: Double  
Reset: Trigger Shearing Y: Double  
Rotation X: Double Shearing Z: Double  
Rotation Y: Double Transformation Mode: Enum  
Rotation Z: Double Translation X: Double  
Scaling X: Double Translation Y: Double  

Visible Fields

Reset

name: reset, type: Trigger

If pressed, all transformation parameters are set back to their default value.

Opt Parameters

name: optParameters, type: String, default: 0 0 0 0 0 0 1 1 1 0 0 0

Set optionally all values in one string.

The order is translations, rotations, shearings and scalings. This is used e.g. for coupling to an Optimizer module.

Translation X

name: translationX, type: Double, default: 0

Note

This is a relative value, the actual displacement in voxels is calculated according to the formula displayed in field Matrix.

Translation Y

name: translationY, type: Double, default: 0

Equivalent to Translation X.

Translation Z

name: translationZ, type: Double, default: 0

Equivalent to Translation X.

Rotation X

name: rotationX, type: Double, default: 0

The rotation around the x-axis in radians. The origin is in center of volume.

Note

Forward interpretation is clock-wise, backward interpretation is counter-clockwise, which is against mathematical convention. See Matrix for the explicit rotation matrix.

Rotation Y

name: rotationY, type: Double, default: 0

Equivalent to Rotation X.

Rotation Z

name: rotationZ, type: Double, default: 0

Equivalent to Rotation X.

Shearing X

name: shearingX, type: Double, default: 0

The shearing in x direction.

Shearing Y

name: shearingY, type: Double, default: 0

The shearing in y direction.

Shearing Z

name: shearingZ, type: Double, default: 0

The shearing in z direction.

Scaling X

name: scalingX, type: Double, default: 1

Scaling behaves reciprocally to the value (e.g. 0.5 zooms in the image by 2).

Scaling Y

name: scalingY, type: Double, default: 1

Equivalent to Scaling X.

Scaling Z

name: scalingZ, type: Double, default: 1

Equivalent to Scaling X.

Matrix

name: matrix, type: Matrix, persistent: no

This is the backward mapping matrix B as a 4x4 matrix.

Note

The matrix is according to ML convention, not Open Inventor convention. One may use the “DecomposeMatrix” macro to format this field in a 4x4 matrix.

The matrix B is constructed by the module from the parameters according to the following formula:

../../../Modules/ML/MLTransformation/mhelp/Images/image006.gif

with

Translation:

../../../Modules/ML/MLTransformation/mhelp/Images/image016.gif

Scaling:

../../../Modules/ML/MLTransformation/mhelp/Images/image010.gif

Shearing:

../../../Modules/ML/MLTransformation/mhelp/Images/image012.gif

Rotation in X:

../../../Modules/ML/MLTransformation/mhelp/Images/image014.gif

and Rotation in Z and Y accordingly. The entries for the displacement vector in B are in voxels.

Transformation Mode

name: transformationMode, type: Enum, default: Affine

Defines the transformation mode.

Values:

Title Name
Translation Translation
Rigid Rigid
Similarity Similarity
Rigid + Scale Rigid + Scale
Affine Affine

Is World Transformation

name: isWorldTransformation, type: Bool, default: FALSE

If checked, the transformation is performed in world space.

World Voxel Transformation

name: worldVoxelTransformation, type: Matrix, persistent: no

Shows the world-to-voxel matrix.