WARPIMAGEMULTITRANSFORM(1)

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

✨ NAME ✨

Okay bestie, meet WarpImageMultiTransform πŸ¦‹, a user command (manual section 1) that's part of the ANTS registration suite. It's giving image-warping royalty πŸ‘‘.


✨ DESCRIPTION ✨

πŸ’… Usage

Here's the basic vibe:

WarpImageMultiTransform ImageDimension moving_image output_image  -R
reference_image --use-NN   SeriesOfTransformations--(See Below)

πŸ”— SeriesOfTransformations

This is where the magic happens ✨. WarpImageMultiTransform can chain together an unlimited number of transformations on your data (concatenation, bestie!). So you could do an affine transform, then a warp, then another affine, then another warp. Iconic, honestly πŸ”₯.

Inverse affine transforms get called with -i MyAffine.txt.

Inverse warps get called by passing the InverseWarp.nii.gz filename. Peep the important notes at the bottom about this πŸ‘€.

🧚 Example 1: Warped into the reference_image domain

Mapping a warped image into the reference_image domain by applying abcdWarp.nii.gz and then abcdAffine.txt:

WarpImageMultiTransform 3 moving_image output_image -R reference_image
abcdWarp.nii.gz abcdAffine.txt

🌈 Example 2: Back into the moving_image domain

To map the fixed/reference_image (warped) into the moving_image domain, you apply the inverse of abcdAffine.txt and then abcdInverseWarp.nii.gz:

WarpImageMultiTransform 3 reference_image output_image -R moving_image
-i  abcdAffine.txt abcdInverseWarp.nii.gz
Heads up! The inverse maps from Example 2 get passed in the reverse order of the forward maps from Example 1. Geometrically that totally makes sense πŸ€“. Check out ANTS.pdf for a visual of this syntax.

🫢 Compulsory arguments

  • ImageDimension β€” 2 or 3, for 2D or 3D registration.
  • moving_image β€” the image you want to apply the transformation to.
  • output_image β€” the resulting image.

🌸 Optional arguments

  • -R β€” the reference_image space you want to warp INTO.
  • --tightest-bounding-box β€” figures out the tightest bounding box using all the affine transforms. If you pass -R reference_image, that overrides it.
  • --reslice-by-header β€” same as -i -mh, or -fh -i -mh if you pair it with -R. It uses the orientation matrix and origin stored in the image file header. It can be used together with -R, but it's typically not used with any other transforms.
  • --use-NN β€” nearest neighbor interpolation.
  • --use-BSpline β€” 3rd order B-Spline interpolation.
  • --use-ML sigma β€” anti-aliasing interpolation for multi-label images, with Gaussian smoothing at standard deviation sigma. Sigma can be in physical or voxel units, just like Convert3D. It can be a scalar or a vector.
    • Examples: --use-ML 0.4mm -use-ML 0.8x0.8x0.8vox
  • -i β€” uses the inverse of the affine transform that follows it.

πŸŽ€ Other example usages

Reslice the image:

WarpImageMultiTransform 3 Imov.nii.gz Iout.nii.gz --tightest-bounding-box --reslice-by-header

Reslice the image to a reference image:

WarpImageMultiTransform 3 Imov.nii.gz Iout.nii.gz -R Iref.nii.gz --tightest-bounding-box --reslice-by-header

πŸ“Œ Important notes

  • A prefix name like abcd with no extension will use .nii.gz by default.
  • The abcdWarp and abcdInverseWarp files don't actually exist. They're formed from abcd(Inverse)Warp.nii.gz when you call WarpImageMultiTransform, but you still have to use them as if they exist πŸ’€.

That's a wrap, bestie! πŸŽ€ Version 2.6.4... from December 2025, go slay those registrations πŸ’–πŸ«Ά

πŸ“¦ where this page comes from