FileBackedNeuroVec {neuroim2} | R Documentation |
Create a File-Backed Neuroimaging Vector
Description
Constructs a FileBackedNeuroVec
instance, which represents a file-backed
neuroimaging vector object. This constructor provides memory-efficient access to large
neuroimaging datasets by keeping the data on disk until needed.
Usage
FileBackedNeuroVec(file_name, label = basename(file_name))
Arguments
file_name |
A character string specifying the path to the neuroimaging file. Supported formats include NIFTI (.nii) and ANALYZE (.hdr/.img). |
label |
Optional character string providing a label for the vector |
Details
Create a FileBackedNeuroVec Object
The function performs the following operations:
Reads the header information from the specified file
Validates the dimensionality (must be 4D data)
Creates a
NeuroSpace
object with appropriate metadataInitializes the file-backed vector with minimal memory footprint
Value
A new instance of class FileBackedNeuroVec
.
See Also
NeuroSpace
for spatial metadata management,
read_header
for header information extraction,
sub_vector
for data access methods
Examples
# Create a file-backed vector from a NIFTI file
fbvec <- FileBackedNeuroVec(system.file("extdata", "global_mask_v4.nii", package = "neuroim2"))
# Access specific volumes without loading entire dataset
first_vol <- sub_vector(fbvec, 1)