NeuroVecSeq | R Documentation |
The NeuroVecSeq class provides a container for managing a sequence of NeuroVec objects, particularly useful for handling time series or multi-session neuroimaging data where each segment may have different lengths.
Constructs a NeuroVecSeq object to represent a variable-length sequence of NeuroVec objects. This is particularly useful for managing time series data where different segments may have different lengths.
NeuroVecSeq(...)
... |
One or more instances of type |
NeuroVecSeq objects store:
A list of NeuroVec objects, each potentially with different time dimensions
The lengths of each constituent NeuroVec
A combined NeuroSpace object representing the total space
The class provides methods for:
Accessing individual time points across all vectors
Extracting subsequences
Computing statistics across the sequence
Linear access to the underlying data
The function performs several validations:
Ensures all inputs are NeuroVec objects
Verifies spatial compatibility
Combines spatial information appropriately
A NeuroVecSeq object containing:
The provided NeuroVec objects
Associated space information
Length information for each vector
Extract a single volume at a specified time point
Get the total number of time points
Extract a subsequence of volumes
Access data linearly across all vectors
NeuroVec-class
for the base vector class
NeuroSpace-class
for spatial information
## Not run:
# Create some example NeuroVec objects
v1 <- NeuroVec(array(0, c(5, 5, 5, 2)),
space = NeuroSpace(dim = c(5, 5, 5, 2)))
v2 <- NeuroVec(array(1, c(5, 5, 5, 4)),
space = NeuroSpace(dim = c(5, 5, 5, 4)))
v3 <- NeuroVec(array(2, c(5, 5, 5, 6)),
space = NeuroSpace(dim = c(5, 5, 5, 6)))
# Combine them into a sequence
vs <- NeuroVecSeq(v1, v2, v3)
# Access properties
length(vs) # Total time points
vs[[5]] # Get the 5th volume
# Extract a subsequence
sub_seq <- sub_vector(vs, 1:5)
## End(Not run)
## Not run:
# Create sample vectors
v1 <- NeuroVec(array(0, c(5, 5, 5, 2)),
space = NeuroSpace(dim = c(5, 5, 5, 2)))
v2 <- NeuroVec(array(0, c(5, 5, 5, 4)),
space = NeuroSpace(dim = c(5, 5, 5, 4)))
# Combine into sequence
vs <- NeuroVecSeq(v1, v2)
print(vs)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.