transform-image

Synopsis

transform-image <source> <output> [options]

Description

Applies one or more transformations to an input image. Each voxel center of the target image is mapped by the composition of the transformations to the space of the source image. The output intensity for the target voxel is the source image intensity interpolated at the mapped point and cast to the output data type. When the input transformation is the identity map, this command effectively resamples the input image on the finite discrete grid of the transform-image -target image.

Arguments

source

Source image.

output

Transformed source image.

Command options

-dofin <file>...

Append transformation to composition or ‘Id’/’Identity’. (default: Id) This option can be given multiple times and/or accepts multiple arguments. The transformations are composed from left to right, i.e., when the arguments are “ffd.dof.gz aff.dof rig.dof”, the target image point is first mapped by the “ffd.dof.gz” transformation, then “aff.dof”, and finally “rig.dof”.

-invdof, -dofin_i <file>...

Append inverse of given transformations to composition. When multiple arguments are given, the composite transformation is inverted, i.e., the order is reversed and each transformation inverted separately. If the order should not be reversed, use option -invdof/-dofin_i before each argument.

-invert [on|off], -noinvert

Enable/disable inversion of composite transformation. (default: off)

-interpolation, -interp <mode>

Interpolation mode: (default: Linear)

  • NN [with padding]
  • Linear [with padding]
  • Fast linear [with padding]
  • BSpline [with padding]
  • Cubic BSpline [with padding]
  • Fast cubic BSpline [with padding]
  • CSpline [with padding]
  • SBased [with padding]
  • Sinc [with padding]
  • Gaussian [with padding]
-labels [<n>...|all]

Transform the specified segmentation labels. When no arguments or “all” is given, all input labels are transformed. When -interpolation mode is nearest neighbor (“NN”), the input label image is directly resampled by assigning the output the nearest label value. Otherwise, the default, the binary mask corresponding to each label is resampled using the selected interpolation mode (e.g., linear) and the resulting fuzzy segmentations converted back into a hard segmentation by assigning the label with the highest interpolated value (pseudo-probability). This results in smoother transformed hard segmentations with reduced NN interpolation artifacts.

-target <file>

Target image. (default: source)

-target-affdof <file>

Affine target header transformation. (default: none)

-target-invdof <file>

Inverse affine target header transformation. (default: none)

-source-affdof <file>

Affine source header transformation. (default: none)

-source-invdof <file>

Inverse affine source header transformation. (default: none)

-apply-affdof

Apply affine header transformation to output image header. When this option is not specified, the output image attributes are identical to the -target image. When this option is given, the -target-affdof or -target-invdof, respectively, is applied to the output image attributes.

-spacing, -voxel-size <dx> [<dy> [<dz> [<dt>]]]

Voxel size of output image. (default: -target spacing)

-type, -dtype, -datatype <type>

Data type of output image. (default: data type of source)

-Tp, -target-padding <value>

Target padding value. (default: none)

-Sp, -source-padding <value>

Source padding value. (default: none)

-padding <value>

Set both -target-padding and -source-padding to same value.

-Tt, -target-time <value>

Time point of target image. (default: torigin)

-St, -source-time <value>

Time point of source image. (default: torigin)

-2d [on|off], -no2d

Project transformed points to 2D, i.e., ignore mapped z coordinate. (default: off)

-3d

Alias for -2d off.

Standard options

-v, -verbose [n]

Increase/Set verbosity of output messages. (default: 0)

-debug [level]

Increase/Set debug level for output of intermediate results. (default: 0)

-version [major.minor]

Print version and exit or set version to emulate.

-revision

Print revision (or version) number only and exit.

-h, -help

Print help and exit.

Terminal options

-color, -nocolor

Enable/disable colored output. (default: off)

Parallelization options

-threads <n>

Use maximal <n> threads for parallel execution. (default: automatic)