FileBackedNeuroVec: Create a File-Backed Neuroimaging Vector

View source: R/filebacked_neurovec.R

FileBackedNeuroVecR 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 metadata

  • Initializes 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

## Not run: 
# Create a file-backed vector from a NIFTI file
fbvec <- FileBackedNeuroVec("path/to/fmri_data.nii")

# Access specific volumes without loading entire dataset
first_vol <- sub_vector(fbvec, 1)

## End(Not run)


bbuchsbaum/neuroim2 documentation built on Jan. 2, 2025, 3:38 p.m.