# NOT RUN {
i<-antsImageRead( getANTsRData('r16') , 2 )
roiImg<-getMask(i)
roiImg2<-iMath(roiImg,'ME',25)
if ( sum(roiImg==1) == sum(roiImg2==1) ) stop("erosion failure")
roiImg2<-iMath(roiImg,'MD',25)
if ( sum(roiImg==1) == sum(roiImg2==1) ) stop("dilation failure")
data( "iMathOps", package = "ANTsR", envir = environment() ) #
for ( j in c(1:nrow(iMathOps)) )
{
op <- as.character( iMathOps$Operation[j] )
# k <- eval( parse( text = toString( iMathOps$Example[j] ) ) )
}
# }
Run the code above in your browser using DataLab