Learn R Programming

ANTsR (version 1.0)

antsApplyTransforms: Apply transforms to images.

Description

Apply a transform list to map an image from one domain to another. In image registration, one computes mappings between (usually) pairs of images. These transforms are often a sequence of increasingly complex maps, e.g. from translation, to rigid, to affine to deformation. The list of such transforms is passed to this function to interpolate one image domain into the next image domain, as below. The order matters strongly and the user is advised to familiarize with the standards established in examples.

Usage

antsApplyTransforms(fixed = NA, moving = NA, transformlist = "",
  interpolator = "Linear", imagetype = 0, whichtoinvert = NA, ...)

Arguments

fixed

fixed image defining domain into which the moving image is transformed.

moving

moving image to be mapped to fixed space.

transformlist

list of transforms generated by antsRegistration where each transform is a filename.

interpolator

Choice of interpolator. One of: Linear, NearestNeighbor, MultiLabel, CosineWindowedSinc, WelchWindowedSinc, HammingWindowedSinc, LanczosWindowedSinc, Gaussian, or BSpline. other interpolator available in antsApplyTransforms.

imagetype

choose 0/1/2/3 mapping to scalar/vector/tensor/time-series .

whichtoinvert

list of booleans, same length as transforms

...

other parameters to pass to antsApplyTransforms.

Value

an antsImage is output. 1 -- Failure

See Also

antsRegistration

Examples

Run this code
# NOT RUN {
# will give the full form of help
antsApplyTransforms("-h")
# see antsRegistration
# example 1 - simplified
fixed <- antsImageRead( getANTsRData("r16") ,2)
moving <- antsImageRead( getANTsRData("r64") ,2)
fixed <- resampleImage(fixed,c(64,64),1,0)
moving <- resampleImage(moving,c(64,64),1,0)
mytx <- antsRegistration(fixed=fixed , moving=moving ,
  typeofTransform = c("SyN") )
mywarpedimage <- antsApplyTransforms( fixed=fixed,moving=moving,
  transformlist=mytx$fwdtransforms )
mywarpedimage <- antsApplyTransforms( fixed=moving,moving=fixed,
  transformlist=mytx$invtransforms )
# full access via listing the inputs in standard ANTs format
# }

Run the code above in your browser using DataLab