Learn R Programming

ANTsR (version 0.4.0)

resampleImageToTarget: resampleImageToTarget

Description

Resample image by using another image as target reference. This function uses antsApplyTransform with an identity matrix to achieve proper resampling.

Usage

resampleImageToTarget(image, target, interpType = "linear", imagetype = 0,
  verbose = FALSE, ...)

Arguments

image

image to resample

target

image of reference, the output will be in this space

interpType

Choice of interpolator. Supports partial matching.

  • linear

  • nearestNeighbor

  • multiLabel for label images but genericlabel is preferred

  • gaussian

  • bSpline

  • cosineWindowedSinc

  • welchWindowedSinc

  • hammingWindowedSinc

  • lanczosWindowedSinc

  • genericLabel use this for label images

imagetype

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

verbose

print command and run verbose application of transform.

Value

output antsImage resampled with target's resolution/origin/orientation/direction

Examples

Run this code
# NOT RUN {
fi<-antsImageRead( getANTsRData("r16"))
fi2mm <- resampleImage(fi, c(2, 2), useVoxels = 0, interpType = 'linear')
resampled <- resampleImageToTarget(fi2mm, fi)

# }

Run the code above in your browser using DataLab