
Last chance! 50% off unlimited learning
Sale ends in
Perform various (often mathematical) operations on the input image. Additional parameters should be specific for each operation. See the the full ImageMath in ANTs, on which this function is based.
iMath(img, operation, param = NA, ...)
input object, usually antsImage
a character string e.g. "GetLargestComponent" ... the special case of "GetOperations" or "GetOperationsFull" will return a list of operations and brief description. Some operations may not be valid (WIP), but most are.
... additional parameters
further parameter options
# NOT RUN {
fi<-antsImageRead( getANTsRData("r16") , 2 )
mask<-getMask( fi )
op1<-iMath( fi , "GD" , 1 ) # gray matter dilation by 1 voxel
op2<-iMath( mask , "Neg" ) # negate
op3<-iMath( mask , "D" ) # distance transform
ops<-iMath( mask , "GetOperations" ) # list all ops
if ( usePkg("magrittr") ) { # string ops together
lapgd <- fi %>% iMath("Laplacian",1) %>% iMath("GD",3)
}
# }
Run the code above in your browser using DataLab