Learn R Programming

neuroim2 (version 0.8.5)

vols: Extract an ordered series of 3D volumes.

Description

This function extracts an ordered series of 3D volumes from an object that supplies volume data. The indices argument specifies the subset of volumes to extract, and can be a vector of indices or a logical vector. The return value is a list containing the extracted volumes in the same order as the specified indices.

Usage

vols(x, indices, ...)

# S4 method for NeuroVec,numeric vols(x, indices)

# S4 method for NeuroVec,missing vols(x)

Value

A list containing the extracted 3D volumes from x in the same order as indices.

Arguments

x

the object that supplies the volume data.

indices

the subset of volumes to extract.

...

additional arguments to be passed to methods.

Examples

Run this code
vec <- read_vec(system.file("extdata", "global_mask_v4.nii", package="neuroim2"))
vs <- vols(vec)
length(vs) == dim(vec)[4]

vs <- vols(vec, indices=1:3)
length(vs) == 3

Run the code above in your browser using DataLab