Learn R Programming

ANTsR (version 0.4.0)

apply.antsImage: Extension of apply to allow input of antsImage

Description

Extension of apply to allow input of antsImage

Usage

# S3 method for antsImage
apply(X, MARGIN, FUN, ...)

Arguments

X

an antsImage

MARGIN

a vector giving the subscripts which the function will be applied over.

FUN

the function to be applied..

...

optional arguments to FUN

Value

output is antsImage of lower dimnesion than input

Examples

Run this code
# NOT RUN {
img <- makeImage(c(4,4,4), rnorm(4*4*4))
img2 <- apply.antsImage(img, c(1,2), mean)

# }

Run the code above in your browser using DataLab