Main Content

transltform3d

3-D translation geometric transformation

Since R2022b

    Description

    A transltform3d object stores information about a 3-D translation geometric transformation and enables forward and inverse transformations.

    Creation

    You can create a transltform3d object in these ways:

    • imregtform — Estimates a geometric transformation that maps a moving image to a fixed image using similarity optimization.

    • fitgeotform3d (Medical Imaging Toolbox) — Estimates a geometric transformation that maps pairs of control points between two images.

    • The transltform3d function described here.

    Description

    tform = transltform3d creates a transltform3d object that performs the identity transformation.

    tform = transltform3d(Translation) creates a transltform3d object that performs a translation transformation based on the specified value of the Translation property. This property specifies the amount of translation in the x-, y-, and z-directions.

    example

    tform = transltform3d(tx,ty,tz) creates a transltform3d object that performs a translation transformation with the specified amounts of translation tx, ty, and tz in the x-, y-, and z-directions, respectively.

    tform = transltform3d(A) creates a transltform3d object and sets the property A as the specified 3-D translation transformation matrix.

    tform = transltform3d(tformIn) creates a transltform2d object from another geometric transformation object, tformIn, that represents a valid 3-D translation geometric transformation.

    Input Arguments

    expand all

    Amount of translation in the x-direction, specified as a numeric scalar. This value sets the first element of the Translation property.

    Amount of translation in the y-direction, specified as a numeric scalar. This value sets the second element of the Translation property.

    Amount of translation in the z-direction, specified as a numeric scalar. This value sets the third element of the Translation property.

    Translation 3-D geometric transformation, specified as an affinetform3d object, rigidtform3d object, simtform3d object, or transltform3d object.

    Properties

    expand all

    Forward 3-D translation transformation, specified as a 4-by-4 numeric matrix. When you create the object, you can also specify A as a 3-by-4 numeric matrix. In this case, the object concatenates the row vector [0 0 0 1] to the end of the matrix, forming a 4-by-4 matrix. The default of A is the identity matrix.

    The matrix A transforms the point (u, v, w) in the input coordinate space to the point (x, y, z) in the output coordinate space using the convention:

    [xyz1]=Α×[uvw1]

    For a translation transformation, A has the form:

    Α=[100tx010ty001tz0001]

    where tx, ty, and tz are the amount of translation in the x-, y-, and z-directions, respectively.

    Data Types: double | single

    Amount of translation, specified as a 3-element numeric vector of the form [tx ty tz].

    Data Types: double | single

    This property is read-only.

    Dimensionality of the geometric transformation for both input and output points, specified as 3.

    Data Types: double

    Object Functions

    invertInvert geometric transformation
    outputLimitsFind output spatial limits given input spatial limits
    transformPointsForwardApply forward geometric transformation
    transformPointsInverseApply inverse geometric transformation

    Examples

    collapse all

    Specify the amount of translation.

    t = [10 20.5 15];

    Create a transltform3d object that performs the specified translation.

    tform = transltform3d(t)
    tform = 
      transltform3d with properties:
    
        Dimensionality: 3
           Translation: [10 20.5000 15]
    
                     A: [1.0000         0         0   10.0000
                              0    1.0000         0   20.5000
                              0         0    1.0000   15.0000
                              0         0         0    1.0000]
    
    

    Examine the value of the A property.

    tform.A
    ans = 4×4
    
        1.0000         0         0   10.0000
             0    1.0000         0   20.5000
             0         0    1.0000   15.0000
             0         0         0    1.0000
    
    

    Extended Capabilities

    Version History

    Introduced in R2022b