Main Content

fliptform

Flip input and output roles of spatial transformation structure

Description

tflip = fliptform(T) creates a new TFORM spatial transformation structure by flipping the roles of the inputs and outputs in an existing TFORM structure.

example

Examples

collapse all

Create a spatial transformation structure.

T = maketform('affine', [.5 0 0; .5 2 0; 0 0 1])
T = 

  struct with fields:

       ndims_in: 2
      ndims_out: 2
    forward_fcn: @fwd_affine
    inverse_fcn: @inv_affine
          tdata: [1×1 struct]

Create a new spatial transformation structure by flipping the roles of the inputs and outputs.

T2 = fliptform(T)
T2 = 

  struct with fields:

       ndims_in: 2
      ndims_out: 2
    forward_fcn: @inv_affine
    inverse_fcn: @fwd_affine
          tdata: [1×1 struct]

After flipping the spatial transformation structures, the following statements are equivalent.

x = tformfwd([-3 7],T)
x = tforminv([-3 7],T2)
x =

     2    14


x =

     2    14

Input Arguments

collapse all

Spatial transformation, specified as a TFORM spatial transformation structure.

Data Types: struct

Output Arguments

collapse all

Flipped spatial transformation, returned as a TFORM spatial transformation structure.

Extended Capabilities

Version History

Introduced before R2006a

expand all