sub-AbstractSparseNeuroVec-numeric-numeric-ANY-method: Extractor Method for AbstractSparseNeuroVec

[,AbstractSparseNeuroVec,numeric,numeric,ANY-methodR Documentation

Extractor Method for AbstractSparseNeuroVec

Description

Extracts a subset of data from a sparse four-dimensional brain image based on provided indices.

Usage

## S4 method for signature 'AbstractSparseNeuroVec,numeric,numeric,ANY'
x[i, j, k, m, ..., drop = TRUE]

Arguments

x

An object of class AbstractSparseNeuroVec.

i

Numeric vector specifying the indices for the first dimension.

j

Numeric vector specifying the indices for the second dimension.

k

Numeric vector specifying the indices for the third dimension. Defaults to all indices if missing.

m

Numeric vector specifying the indices for the fourth dimension. Defaults to all indices if missing.

...

Additional arguments (currently unused).

drop

Logical indicating whether to drop dimensions of length one. Defaults to TRUE.

Value

An array containing the extracted subset. The dimensions correspond to the lengths of i, j, k, and m. If drop is TRUE, dimensions of length one are removed.

Examples

## Not run: 
# Assuming 'sparse_vec' is a valid SparseNeuroVec object
subset <- sparse_vec[1:10, 1:10, 1:5, 1:100]

## End(Not run)


bbuchsbaum/neuroim2 documentation built on Jan. 2, 2025, 3:38 p.m.