Learn R Programming

ANTsR (version 0.3.1)

antsRegistration: Perform registration between two images.

Description

Register a pair of images either through the full or simplified interface to the ANTs registration method.

Usage

antsRegistration(fixed = NA, moving = NA, typeofTransform = "SyN",
  initialTransform = NA, outprefix = "", mask = NA, gradStep = NA, ...)

Arguments

fixed

fixed image to which we register the moving image.

moving

moving image to be mapped to fixed space.

typeofTransform

Either a one stage rigid/affine mapping or a 2-stage affine+syn mapping. Mutual information metric by default. See Details. One of Rigid, Affine, AffineFast, SyN, SyNCC,

initialTransform

transforms to prepend

outprefix

output will be named with this prefix.

mask

mask the registration.

gradStep

gradient step size (not for all tx)

...

additional options see antsRegistration in ANTs

Value

outputs a list containing:

  • warpedmovout: Moving image warped to space of fixed image.

  • warpedfixout: Fixed image warped to space of moving image.

  • fwdtransforms: Transforms to move from moving to fixed image.

  • invtransforms: Transforms to move from fixed to moving image.

Ouptut of 1 indicates failure

Details

typeofTransform can be one of:

  • "Rigid": Rigid transformation: Only rotation and translation.

  • "Affine": Affine transformation: Rigid + scaling.

  • "AffineFast": Fast version of Affine.

  • "SyN": Symmetric normalization: Affine + deformable transformation, with mutual information as optimization metric.

  • "SyNCC": SyN, but with cross-correlation as the metric.

  • "SyNBold": SyN, but optimized for registrations between BOLD and T1 images.

  • "SyNAggro": SyN, but with more aggressive registration (fine-scale matching and more deformation). Takes more time than SyN.

  • "TVMSQ": time-varying diffeomorphism with mean square metric

Examples

Run this code
# NOT RUN {
fi <- antsImageRead(getANTsRData("r16") ,2)
mi <- antsImageRead(getANTsRData("r64") ,2)
fi<-resampleImage(fi,c(60,60),1,0)
mi<-resampleImage(mi,c(60,60),1,0) # speed up
mytx <- antsRegistration(fixed=fi, moving=mi, typeofTransform = c('SyN') )
mywarpedimage <- antsApplyTransforms( fixed=fi, moving=mi,
  transformlist=mytx$fwdtransforms )
# }

Run the code above in your browser using DataLab