FileBackedNeuroVec-class | R Documentation |
A class representing a four-dimensional brain image that uses on-demand loading through memory-mapped file access. This approach enables efficient handling of large-scale brain imaging data by loading only the required portions of the data into memory when needed.
The FileBackedNeuroVec
class represents a memory-efficient vector of neuroimaging data
that is stored on disk rather than in memory. This is particularly useful for large datasets
where memory constraints are a concern.
FileBackedNeuroVec objects provide a memory-efficient solution for working with large 4D neuroimaging datasets. By utilizing memory-mapped file access, this class allows users to work with datasets that exceed available RAM, only loading the necessary data segments into memory as they are accessed.
meta
An instance of class FileMetaInfo
containing
file metadata such as file path, format, and other associated information.
FileBackedNeuroVec
inherits from:
NeuroVec
: Base class for 4D brain images
ArrayLike4D
: Interface for 4D array-like operations
Data is read from disk on-demand, reducing memory usage compared to in-memory storage. The trade-off is slightly slower access times due to disk I/O operations.
NeuroVec-class
for the base 4D brain image class.
FileMetaInfo-class
for details on file metadata representation.
## Not run:
# Create a FileBackedNeuroVec object
file_path <- "/path/to/large/brain/image.nii.gz"
file_meta <- FileMetaInfo(file_path, format = "NIFTI")
file_backed_vec <- FileBackedNeuroVec(meta = file_meta)
# Access a subset of the data (this will load only the required portion)
subset <- file_backed_vec[,,, 1:10]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.