table of contents
| ANTSAPPLYTRANSFORMS(1) | User Commands | ANTSAPPLYTRANSFORMS(1) |
NAME¶
antsApplyTransforms - part of ANTS registration suite
DESCRIPTION¶
COMMAND:¶
- antsApplyTransforms
- antsApplyTransforms, applied to an input image, transforms it according to a reference image and a transform (or a set of transforms). The output image is resliced into the space of the reference image. Tensor and vector images are reoriented to preserve the principal directions.
As well as applying warps to
- images, antsApplyTransforms can also compose multiple transforms into a composite transform file, or collapse them into a single affine transform or displacement field.
OPTIONS:¶
-d, --dimensionality 2/3/4
- Sets the dimensionality of transforms and scalar inputs.dimensional image. This will be the same dimension as used in antsRegistration. This does not change for multi-valued inputs, use the -e option for time series and other multi-component images.
- -e, --input-image-type 0/1/2/3/4/5/6
- scalar/vector/tensor/time-series/multichannel/five-dimensional/physical-vector
- Option specifying the input image type of scalar (default), vector (spatial vectors in index space), tensor (3D diffusion tensor in index space), time-series, multichannel, five-dimensional, or physical-vector (spatial vectors in ITK LPS+ physical space). A time-series image is a scalar image defined by an additional dimension for the time component whereas a multi-channel image is a vector image with only spatial dimensions. Five-dimensional images are e.g., AFNI stats image. <VALUES>: 0
--time-index <timeIndex>
- Time index to extract from time series input (-e 3). This selects a single slice from time series input without reading the entire dataset into memory.
-i, --input inputFileName
- Currently, the only input objects supported are image objects. However, the current framework allows for warping of other objects such as meshes and point sets.
-r, --reference-image imageFileName
- For warping input images, the reference image defines the spacing, origin, size, and direction of the output warped image.
-o, --output warpedOutputFileName
- DisplacementField[compositeDFFileName] CompositeTransform[compositeTransformFileName] Linear[collapsedAffine.mat, invert=0] [collapsedDisplacementField,1]
- The default output is the warped input image, resliced into the space of the reference image. Alternatively, one can output the composite transform containing all input transforms, or a collapsed affine or displacement field created from the input transforms. If all input transforms are linear, they can be collapsed and (if boolean is set) inverted, then written to an ITK transform file. If the input transforms contain displacement fields, they can be collapsed into a single displacement field with DisplacementField[collapsedDFFileName]. This replaces the usage '-o [collapsedDFFileName, 1]', which is deprecated but still allowed for backwards compatibility. To write a non-collapsed composite transform, use CompositeTransform[compositeTransform.h5].
- -n, --interpolation Linear
- NearestNeighbor MultiLabel[<sigma=imageSpacing>,<alpha=4.0>] Gaussian[<sigma=imageSpacing>,<alpha=1.0>] BSpline[<order=3>] CosineWindowedSinc WelchWindowedSinc HammingWindowedSinc LanczosWindowedSinc GenericLabel[<interpolator=Linear>]
- Several interpolation options are available via ITK. For tensor data, NearestNeighbor or linear interpolation are recommended. The interpolation is done on log-transformed tensors, which reduces interpolation artifacts. Vector data is interpolated component-wise. Vector data that has arbitrary sign (eg, diffusion tensor eigenvectors) should use NearestNeighbor interpolation.
- -u, --output-data-type char
- uchar short int float double default
- Output image data type. This is a direct typecast; output values are not rescaled. Default is to use the internal data type (float or double). uchar is unsigned char; others are signed. WARNING: Outputs will be incorrect (overflowed/reinterpreted) if values exceed the range allowed by your choice. Note that some pixel types are not supported by some image formats. e.g. int is not supported by jpg.
- -t, --transform transformFileName
- [transformFileName,useInverse]
- Several transform options are supported including all those defined in the ITK library in addition to a deformation field transform. The ordering of the transformations follows the ordering specified on the command line. An identity transform is pushed onto the transformation stack. Each new transform encountered on the command line is also pushed onto the transformation stack. Then, to warp the input object, each point comprising the input object is warped first according to the last transform pushed onto the stack followed by the second to last transform, etc. until the last transform encountered which is the identity transform. Also, it should be noted that the inverse transform can be accommodated with the usual caveat that such an inverse must be defined by the specified transform class
-f, --default-value value
- Default voxel value to be used with input images only. Specifies the voxel value when the input point maps outside the output domain. With tensor input images, specifies the default voxel eigenvalues. Default tensor eigenvalues are also are used in voxels where the tensor data is all zero.
-z, --static-cast-for-R value
- forces static cast in ReadTransform (for R)
--float
- Use 'float' instead of 'double' for computations. <VALUES>: 0
-v, --verbose (0)/1
- Verbose output.
-h
- Print the help menu (short version).
--help
- Print the help menu. <VALUES>: 1
| December 2025 | antsApplyTransforms 2.6.4+dfsg |