Linear Access Method for FileBackedNeuroVec
Source:R/filebacked_neurovec.R
, R/mapped_neurovec.R
, R/neurohypervec.R
, and 3 more
linear_access-methods.Rd
Internal method providing linear access to memory-mapped data.
Provides linear access to the data across all vectors in the sequence.
Usage
# S4 method for class 'FileBackedNeuroVec,numeric'
linear_access(x, i)
# S4 method for class 'MappedNeuroVec,numeric'
linear_access(x, i)
# S4 method for class 'NeuroHyperVec,ANY'
linear_access(x, i, ...)
# S4 method for class 'NeuroVecSeq,numeric'
linear_access(x, i)
# S4 method for class 'SparseNeuroVol,numeric'
linear_access(x, i)
# S4 method for class 'AbstractSparseNeuroVec,numeric'
linear_access(x, i)
Examples
# \donttest{
# Create a small NeuroVec and save it
nvec <- NeuroVec(matrix(1:32, 8, 4), NeuroSpace(c(2,2,2,4)))
tmp <- tempfile(fileext = ".nii")
write_vec(nvec, tmp)
# Load as FileBackedNeuroVec and access values
fbvec <- FileBackedNeuroVec(tmp)
values <- linear_access(fbvec, 1:10)
# Clean up
unlink(tmp)
# }