Main Content

affinetform3d

3-D affine geometric transformation

    Description

    An affinetform3d object stores information about a 3-D affine geometric transformation and enables forward and inverse transformations.

    Creation

    You can create an affinetform3d object in these ways:

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

    • randomAffine3d — Creates a randomized 3-D affine transformation.

    • The affinetform3d function described here.

    Description

    tform = affinetform3d creates an affinetform3d object that performs an identity transformation.

    example

    tform = affinetform3d(A) creates an affinetform3d object and sets the property A as the specified 3-D affine transformation matrix.

    tform = affinetform3d(tformIn) creates an affinetform3d object from another geometric transformation object, tformIn, that represents a valid 3-D affine geometric transformation.

    Input Arguments

    expand all

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

    Properties

    expand all

    Forward 3-D affine transformation, specified as a nonsingular 4-by-4 numeric matrix. The default value 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 an affine transformation, A has the form:

    Α=[abcdefghijkl0001]

    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

    Define a 4-by-4 geometric transformation matrix. This matrix specifies an affine transformation consisting of translation and nonisotropic scaling.

    [sx,sy,sz] = deal(2,2,2.5);
    [tx,ty,tz] = deal(10,20.5,15);
    A = [sx 0 0 tx; 0 sy 0 ty; 0 0 sz tz; 0 0 0 1];

    Create an affinetform3d object that performs the scaling and translation.

    tform = affinetform3d(A)
    tform = 
      affinetform3d with properties:
    
        Dimensionality: 3
                     A: [4x4 double]
    
    

    Examine the value of the A property.

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

    Extended Capabilities

    Version History

    Introduced in R2022b

    expand all