Skip to contents

Extracts data from an H5ParcellatedScan object when only the first index is provided. Can handle mask indices, coordinate matrices, or pass through to coordinate-based indexing.

Extracts a single volume from a LatentNeuroVec as a SparseNeuroVol.

Usage

# S4 method for class 'H5ParcellatedScan,ANY,missing,ANY'
x[i, j, ..., drop = TRUE]

# S4 method for class 'H5ParcellatedScanSummary,ANY,ANY,ANY'
x[i, j, k, l, ..., drop = TRUE]

# S4 method for class 'H5ParcellatedScanSummary,ANY,missing,ANY'
x[i, j, ..., drop = TRUE]

# S4 method for class 'H5NeuroVec,numeric,numeric,ANY'
x[i, j, k, l, ..., drop = TRUE]

# S4 method for class 'LabeledVolumeSet,numeric'
x[[i, j, ...]]

# S4 method for class 'LabeledVolumeSet,character'
x[[i, j, ...]]

# S4 method for class 'LatentNeuroVec,numeric'
x[[i, j, ...]]

# S4 method for class 'LatentNeuroVec,numeric,numeric,ANY'
x[i, j, k, l, ..., drop = TRUE]

# S4 method for class 'LatentNeuroVec,ANY,ANY,ANY'
x[i, j, k, l, ..., drop = TRUE]

# S4 method for class 'LatentNeuroVec,numeric'
x[[i, j, ...]]

Arguments

x

A LatentNeuroVec-class object.

i

A numeric index specifying which volume to extract (must be a single value).

j

Missing (not provided)

...

Additional arguments

drop

Logical. If TRUE, the result is coerced to the lowest possible dimension

k

Slice index (z-coordinate) - optional, passed via ...

l

Time index - optional, passed via ...

Value

An array or vector containing the subset of data

A SparseNeuroVol-class containing:

  • The computed volume data

  • A new 3D NeuroSpace object

  • The original spatial indices

Details

1. Validates index i 2. Computes the volume data with matrix operations 3. Adds the offset 4. Builds a new 3D NeuroSpace 5. Returns a SparseNeuroVol

Examples

if (FALSE) { # \dontrun{
# Extract volumes
vol1 <- lvec[[1]]
vol_mid <- lvec[[dim(lvec)[4] / 2]]
vol_last <- lvec[[dim(lvec)[4]]]
} # }