extract a slice from an image and return an image of dimensionality, d-1

extractSlice(image, slice, direction, collapseStrategy = 0)

Arguments

image

antsImage to crop

slice

which slice, integer

direction

which axis, integer

collapseStrategy

collapse sub-matrix. 0: Collapse sub-matrix if positive definite. Otherwise, thrown exception. Default. 1: Set sub-matrix to identity. 2: Collapse if positive definite. Otherwise, set to identity.

Value

antsImage of dimension - 1

Author

Brian B. Avants, Nicholas J. Tustison

Examples


fi <- makeImage(c(10, 10, 10), rnorm(1000))
slice <- extractSlice(fi, 1, 1)