Skip to contents

This function extracts the spatial bounds (origin + dim * spacing) of an image represented by the input object.

Usage

bounds(x)

# S4 method for NeuroSpace
bounds(x)

Arguments

x

The object with the `bounds` property, typically an image.

Value

A matrix where each row contains the min (column 1) and max (column 2) bounds of the image dimension from 1 to `ndim(image)`.

Examples

bspace <- NeuroSpace(c(10, 10, 10), c(2, 2, 2))
b <- bounds(bspace)
nrow(b) == ndim(bspace)
#> [1] TRUE
ncol(b) == 2
#> [1] TRUE