ANTSAPPLYTRANSFORMS(1)

πŸ“¦
version 2.6.4 Β· 2 versions
, in ubuntu resolute

πŸ¦‹ antsApplyTransforms πŸ¦‹

okay bestie, this is the manual page for antsApplyTransforms (aka ANTSAPPLYTRANSFORMS(1) πŸ’…) and it is SO worth the read ✨

✨ NAME ✨

antsApplyTransforms - part of ANTS registration suite πŸŽ€

πŸ’– DESCRIPTION πŸ’–

🧚 COMMAND 🧚

antsApplyTransforms

okay so antsApplyTransforms takes an input image and warps it using a reference image plus a transform (or a whole set of transforms) 🌸 The output gets resliced into the space of the reference image. Tensor and vector images get reoriented so their principal directions stay preserved. literally iconic πŸ”₯

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 input images. This needs to match the dimension you used in antsRegistration. It does NOT change for multi-valued inputs, so for time series and other multi-component images, use -e instead 🧠
  • -e, --input-image-type 0/1/2/3/4/5/6 β€” Picks the input image type, with the names scalar/vector/tensor/time-series/multichannel/five-dimensional/physical-vector. Here's the lineup:
    • 0 is scalar (the default ✨)
    • 1 is vector (spatial vectors in index space)
    • 2 is tensor (3D diffusion tensor in index space)
    • 3 is time-series
    • 4 is multichannel
    • 5 is five-dimensional (e.g. an AFNI stats image)
    • 6 is physical-vector (spatial vectors in ITK LPS+ physical space)

A time-series image is a scalar image with an extra dimension for time, whereas a multi-channel image is a vector image with only spatial dimensions. <VALUES>: 0

  • --time-index <timeIndex> β€” Grabs one time index out of a time series input (that's -e 3) πŸ•°οΈ It pulls a single slice without loading the whole dataset into memory. big brain move
  • -i, --input inputFileName β€” Right now the only input objects supported are image objects. The framework is set up to warp other stuff too, like meshes and point sets 🫧
  • -r, --reference-image imageFileName β€” For warping input images, the reference image decides the spacing, origin, size, and direction of the output warped image πŸ“
  • -o, --output warpedOutputFileName β€” The default output is your warped input image, resliced into the reference image's space. But you can also ask for a composite transform with all your input transforms, or a collapsed affine or displacement field made from them 🌈 If every input transform is linear, they can be collapsed and (if the boolean is set) inverted, then written to an ITK transform file. If the input transforms contain displacement fields, they can be collapsed into one displacement field with DisplacementField[collapsedDFFileName]. That replaces the old -o [collapsedDFFileName, 1] usage, which is deprecated but still works for backwards compatibility πŸ™ˆ To write a non-collapsed composite transform, use CompositeTransform[compositeTransform.h5].

The output forms look like this:

DisplacementField[compositeDFFileName]
CompositeTransform[compositeTransformFileName]
Linear[collapsedAffine.mat, invert=0]
[collapsedDisplacementField,1]
  • -n, --interpolation β€” Several interpolation options come from ITK. Your choices are Linear, NearestNeighbor, MultiLabel[<sigma=imageSpacing>,<alpha=4.0>], Gaussian[<sigma=imageSpacing>,<alpha=1.0>], BSpline[<order=3>], CosineWindowedSinc, WelchWindowedSinc, HammingWindowedSinc, LanczosWindowedSinc, and GenericLabel[<interpolator=Linear>]. For tensor data, NearestNeighbor or linear interpolation is recommended. The interpolation runs on log-transformed tensors, which cuts down on interpolation artifacts ✨ Vector data gets interpolated component-wise. Vector data with arbitrary sign (like diffusion tensor eigenvectors) should use NearestNeighbor interpolation.
  • -u, --output-data-type char β€” Sets the output image data type, choosing from uchar, short, int, float, double, or default. This is a direct typecast, so values are NOT rescaled. The default uses the internal data type (float or double). uchar is unsigned char, and the rest are signed πŸ’…
WARNING: Outputs will be incorrect (overflowed/reinterpreted) if values exceed the range allowed by your choice. Also, some pixel types aren't supported by some image formats. e.g. int is not supported by jpg. πŸ’€
  • -t, --transform transformFileName β€” Format: [transformFileName,useInverse]. Lots of transform options are supported, including everything defined in the ITK library plus a deformation field transform πŸ¦‹ Transforms are applied in the order you type them on the command line. An identity transform gets pushed onto the transformation stack first, and every new transform you pass in gets pushed on after it. Then, to warp the input object, each point gets warped by the last transform pushed, then the second to last, and so on, all the way down to that identity transform. You can also use the inverse transform, with the usual caveat that the inverse has to be defined by the specified transform class ⚠️
  • -f, --default-value value β€” The default voxel value, used with input images only. It's the value a voxel gets when the input point maps outside the output domain. For tensor input images, this sets the default voxel eigenvalues. Those default tensor eigenvalues also get used in voxels where the tensor data is all zero 🌸
  • -z, --static-cast-for-R value β€” Forces a static cast in ReadTransform (for R) πŸ€“
  • --float β€” Use float instead of double for computations. <VALUES>: 0
  • -v, --verbose (0)/1 β€” Turns on verbose output πŸ“’
  • -h β€” Prints the help menu (short version) 🧚
  • --help β€” Prints the help menu. <VALUES>: 1

That's the whole tea β˜•βœ¨ antsApplyTransforms 2.6.4+dfsg, December 2025. you're literally the best, bestie πŸ«ΆπŸŒˆπŸ’…

πŸ“¦ where this page comes from