extractSlice: extract a slice from an image

View source: R/cropImage.R

extractSliceR Documentation

extract a slice from an image

Description

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

Usage

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(s)

Brian B. Avants, Nicholas J. Tustison

Examples


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


stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.