Generic function to extract a one or more individual volumes from a four-dimensional image

Share:

Description

Generic function to extract a one or more individual volumes from a four-dimensional image

Usage

1
2
3
4
5
6
7
takeVolume(x, i, ...)

## S4 method for signature 'SparseBrainVector,numeric'
takeVolume(x, i, merge = FALSE)

## S4 method for signature 'BrainVector,numeric'
takeVolume(x, i, merge = FALSE)

Arguments

x

four-dimensional image

i

the indices of the volume(s) to extract

...

additional arguments

merge

concatenate extracted volumes

Value

a list of BrainVolume elements

Examples

1
2
3
4
5
6
7
bvec <- BrainVector(array(rnorm(24*24*24*24), c(24,24,24,24)), BrainSpace(c(24,24,24,24), c(1,1,1)))
vol <- takeVolume(bvec,1)
all.equal(dim(vol), c(24,24,24))

vol <- takeVolume(bvec,1:3)
length(vol) == 3
class(vol) == "list"

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.