ANTSAPPLYTRANSFORMS(1)
π¦ 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 inantsRegistration. It does NOT change for multi-valued inputs, so for time series and other multi-component images, use-einstead π§-e,--input-image-type 0/1/2/3/4/5/6β Picks the input image type, with the namesscalar/vector/tensor/time-series/multichannel/five-dimensional/physical-vector. Here's the lineup:0is scalar (the default β¨)1is vector (spatial vectors in index space)2is tensor (3D diffusion tensor in index space)3is time-series4is multichannel5is five-dimensional (e.g. an AFNI stats image)6is 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 withDisplacementField[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, useCompositeTransform[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 areLinear,NearestNeighbor,MultiLabel[<sigma=imageSpacing>,<alpha=4.0>],Gaussian[<sigma=imageSpacing>,<alpha=1.0>],BSpline[<order=3>],CosineWindowedSinc,WelchWindowedSinc,HammingWindowedSinc,LanczosWindowedSinc, andGenericLabel[<interpolator=Linear>]. For tensor data,NearestNeighboror 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 useNearestNeighborinterpolation.-u,--output-data-type charβ Sets the output image data type, choosing fromuchar,short,int,float,double, ordefault. This is a direct typecast, so values are NOT rescaled. The default uses the internal data type (float or double).ucharis 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 inReadTransform(for R) π€--floatβ Usefloatinstead ofdoublefor 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
- ubuntu resolute: ants 2.6.4+dfsg-1 Β· BSD-3-Clause
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms