Learn R Programming

ANTsR (version 1.0)

imageMath: R access to the ANTs program ImageMath

Description

Perform math-operations on the given image. The first argument should be dimensionality, the 2nd the output image, the third a string describing the operation. The fourth should be in the input image. Additional parameters should be specific for each function. See the the imageMath help in ANTs.

Usage

imageMath(...)

Arguments

...

all parameters

Examples

Run this code
# NOT RUN {
fi<-antsImageRead( getANTsRData("r16") ,2)
mask<-getMask(fi)
imageMath( 2 , fi , "GD", fi , 1 )  # gray matter dilation
imageMath( 2 , mask , "Neg", mask )  # negate
imageMath( 2 , mask , "D", mask )  # distance transform
plot(mask)
# }

Run the code above in your browser using DataLab