Creates a data reader for accessing neuroimaging data from various file formats. The reader provides a unified interface for reading data regardless of the underlying format.
Details
Create a Data Reader for Neuroimaging Data
The data_reader function is a generic that creates appropriate readers for different neuroimaging formats. It handles:
File format detection and validation
Endianness configuration
Data type conversion
Compression handling (e.g., gzip)
Proper byte alignment
See also
read_header
for reading headers,
BinaryReader
for reading binary data
Examples
if (FALSE) { # \dontrun{
# Create reader for NIFTI file
meta <- read_header("brain.nii")
reader <- data_reader(meta, offset = 0)
# Read first 100 voxels
data <- reader$read(100)
} # }