AffineTransformation3D¶
-
MLModule
¶ genre SpatialTransformation
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLTransformation
definition MLTransformation.def keywords rotate
,translate
,shear
,scale
,image
Purpose¶
The module AffineTransformation3D
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 data types of < uint16
- the field
Details¶
The module uses the well-known backward mapping technique (see, e.g., the excellent monograph 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:
The idea of backward mapping graphically:
To achieve subvoxel 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).
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
¶ When 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
¶ Sets 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¶
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
¶ Sets the rotation around the x-axis in radians. The origin is the center of the volume.
Note
Forward interpretation is clockwise, backward interpretation is counterclockwise, 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
.
Scaling X¶
-
name:
scalingX
, type:
Double
, default:
1
¶ Sets the scaling in the x direction.
Scaling behaves reciprocally to the value (e.g., 0.5 zooms in the image by 2).
Matrix¶
-
name:
matrix
, type:
Matrix
, persistent:
no
¶ Sets 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:
with
Translation:
Scaling:
Shearing:
Rotation in X:
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 |