apply.Rd
Returns an antsImage after applying function.
apply(X, MARGIN, FUN, ...)
# Default S3 method
apply(X, MARGIN, FUN, ...)
# S3 method for class 'antsImage'
apply(X, MARGIN, FUN, ...)
output is antsImage of lower dimnesion than input
img <- makeImage(c(4, 4, 4), rnorm(4 * 4 * 4))
img2 <- apply(img, c(1, 2), mean)
is.antsImage(img2)
#> [1] TRUE