MappedNeuroVecSource-class | R Documentation |
A class used to produce a MappedNeuroVec
instance. It encapsulates
the necessary information to create a memory-mapped representation of a 4D neuroimaging dataset.
Creates a MappedNeuroVecSource
object that manages the memory
mapping between a neuroimaging file and memory space. This is typically used internally
by MappedNeuroVec
but can be created directly for custom access patterns.
MappedNeuroVecSource(file_name)
file_name |
Character string specifying the path to the neuroimaging file. Supported formats include NIFTI (.nii) and ANALYZE (.hdr/.img). |
MappedNeuroVecSource acts as a factory for MappedNeuroVec objects. While it doesn't have any additional slots beyond its parent class, it specifies the intent to create a memory-mapped representation of the neuroimaging data. This class is typically used in data loading pipelines where large datasets need to be accessed efficiently without loading the entire dataset into memory.
Create a Memory-Mapped Source for Neuroimaging Data
The function performs several important checks:
Validates file existence and permissions
Reads and validates header information
Ensures proper dimensionality (>= 3D)
Verifies file format compatibility
A new MappedNeuroVecSource
object containing:
Meta information about the dataset
File format details
Dimensional information
MappedNeuroVecSource
inherits from:
NeuroVecSource
: Base class for NeuroVec source objects
MappedNeuroVec
for the main user interface,
read_header
for header reading details
# Create a MappedNeuroVecSource
mapped_source <- new("MappedNeuroVecSource")
# Create source from NIFTI file
source <- MappedNeuroVecSource(system.file("extdata", "global_mask_v4.nii", package = "neuroim2"))
# Check dimensions
dim(source@meta_info)
# View header information
str(source@meta_info)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.