RigidTransformResample - Image resampling with a rigid transform

Resample an image with a rigid transform

Detailed description

This application performs a parametric transform on the input image. Scaling, translation and rotation with scaling factor are handled. Parameters of the transform is expressed in physical units, thus particular attention must be paid on pixel size (value, and sign). Moreover transform is expressed from input space to output space (on the contrary ITK Transforms are expressed form output space to input space).

Parameters

This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is RigidTransformResample .

[1]Table: Parameters table for Image resampling with a rigid transform.
Parameter Key Parameter Name Parameter Type
in Input image Input image
out Output image Output image
transform Transform parameters Group
transform.type Type of transformation Choices
transform.type id id Choice
transform.type translation translation Choice
transform.type rotation rotation Choice
transform.type.id.scalex X scaling Float
transform.type.id.scaley Y scaling Float
transform.type.translation.tx The X translation (in physical units) Float
transform.type.translation.ty The Y translation (in physical units) Float
transform.type.translation.scalex X scaling Float
transform.type.translation.scaley Y scaling Float
transform.type.rotation.angle Rotation angle Float
transform.type.rotation.scalex X scaling Float
transform.type.rotation.scaley Y scaling Float
interpolator Interpolation Choices
interpolator nn Nearest Neighbor interpolation Choice
interpolator linear Linear interpolation Choice
interpolator bco Bicubic interpolation Choice
interpolator.bco.radius Radius for bicubic interpolation Int
ram Available RAM (Mb) Int
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file

Input image: The input image to translate.

Output image: The transformed output image.

[Transform parameters]: This group of parameters allows setting the transformation to apply.

  • Type of transformation: Type of transformation. Available transformations are spatial scaling, translation and rotation with scaling factor. Available choices are:
  • id: Spatial scaling.
  • X scaling: Scaling factor between the output X spacing and the input X spacing.
  • Y scaling: Scaling factor between the output Y spacing and the input Y spacing.
  • translation: translation.
  • The X translation (in physical units): The translation value along X axis (in physical units).
  • The Y translation (in physical units): The translation value along Y axis (in physical units).
  • X scaling: Scaling factor between the output X spacing and the input X spacing.
  • Y scaling: Scaling factor between the output Y spacing and the input Y spacing.
  • rotation: rotation.
  • Rotation angle: The rotation angle in degree (values between -180 and 180).
  • X scaling: Scale factor between the X spacing of the rotated output image and the X spacing of the unrotated image.
  • Y scaling: Scale factor between the Y spacing of the rotated output image and the Y spacing of the unrotated image.

Interpolation: This group of parameters allows one to define how the input image will be interpolated during resampling. Available choices are:

  • Nearest Neighbor interpolation: Nearest neighbor interpolation leads to poor image quality, but it is very fast.
  • Linear interpolation: Linear interpolation leads to average image quality but is quite fast.
  • Bicubic interpolation
  • Radius for bicubic interpolation: This parameter allows controlling the size of the bicubic interpolation filter. If the target pixel size is higher than the input pixel size, increasing this parameter will reduce aliasing artifacts.

Available RAM (Mb): This allows setting the maximum amount of RAM available for processing. As the writing task is time consuming, it is better to write large pieces of data, which can be achieved by increasing this parameter (pay attention to your system capabilities).

Load otb application from xml file: Load otb application from xml file.

Save otb application to xml file: Save otb application to xml file.

Example

To run this example in command-line, use the following:

otbcli_RigidTransformResample -in qb_toulouse_sub.tif -out rigitTransformImage.tif -transform.type rotation -transform.type.rotation.angle 20 -transform.type.rotation.scalex 2. -transform.type.rotation.scaley 2.

To run this example from Python, use the following code snippet:

#!/usr/bin/python

# Import the otb applications package
import otbApplication

# The following line creates an instance of the RigidTransformResample application
RigidTransformResample = otbApplication.Registry.CreateApplication("RigidTransformResample")

# The following lines set all the application parameters:
RigidTransformResample.SetParameterString("in", "qb_toulouse_sub.tif")

RigidTransformResample.SetParameterString("out", "rigitTransformImage.tif")

RigidTransformResample.SetParameterString("transform.type","rotation")

RigidTransformResample.SetParameterFloat("transform.type.rotation.angle", 20)

RigidTransformResample.SetParameterFloat("transform.type.rotation.scalex", 2.)

RigidTransformResample.SetParameterFloat("transform.type.rotation.scaley", 2.)

# The following line execute the application
RigidTransformResample.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.

See Also

These additional resources can be useful for further information:
Translation