data_reader | R Documentation |
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.
data_reader(x, offset)
x |
An object containing metadata required to create the reader (e.g., file path, format info) |
offset |
Numeric. Byte offset where data reading should begin. Default is 0. |
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
A BinaryReader object configured for the specific data format
read_header
, BinaryReader
## Not run:
# Create reader for NIFTI file
meta <- read_header("brain.nii")
reader <- data_reader(meta, offset = 0)
# Read first 100 voxels
data <- reader$read(100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.