Main Content

isTranslation

Determine if transformation is pure translation

Description

example

TF= isTranslation(tform)determines whether or not the rigid or affine transformation specified bytformis a pure translation.

Examples

collapse all

Create anaffine2dobject that defines a pure translation.

A = [ 1 0 0 0 1 0 40 40 1 ]; tform = affine2d(A)
tform = affine2d with properties: T: [3x3 double] Dimensionality: 2

Check if the transformation is a pure translation.

tf = isTranslation(tform)
tf = 1

Create anaffine3dobject that defines a different scale factor in each dimension.

Sx = 1.2; Sy = 1.6; Sz = 2.4; tform = affine3d([Sx 0 0 0; 0 Sy 0 0; 0 0 Sz 0; 0 0 0 1]);
tf = affine3d with properties: T: [4x4 double] Dimensionality: 3

Check if the transformation is a pure translation. Sincetformscales the object,

tf = isTranslation(tform)
tf = 0

As expected, the transformation is not a pure translation since scaling changes the size and shape of an input volume.

Input Arguments

collapse all

Geometric transformation, specified as anaffine2d,affine3d, orrigid2dgeometric transformation object.

Output Arguments

collapse all

Flag indicating pure translation transformation, returned as a logical scalar.TFisTruewhentformrepresents a pure translation.

Data Types:logical

More About

collapse all

Translation Transformation

A translation transformation shifts an image without modifying the image size, shape, or orientation. A 2-D translation is represented by a matrixTof the form:

[1 0 0; 0 1 0; e f 1];

A 3-D translation is represented by a matrix of the form:

[1 0 0 0; 0 1 0 0; 0 0 1 0; j k l 1];

Version History

Introduced in R2013a