Learn R Programming

neuroim (version 0.0.6)

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

Description

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

Usage

takeVolume(x, i, ...)
"takeVolume"(x, i, merge = FALSE)
"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

Run this code
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"

Run the code above in your browser using DataLab