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.
This function constructs a MappedNeuroVecSource object, which represents a source for memory-mapped neuroimaging data.
MappedNeuroVecSource(file_name)
file_name |
A character string specifying the name of the image file to be memory mapped. |
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.
The function performs the following steps:
1. Reads the header of the specified file using read_header
.
2. Checks that the dimensions of the meta information are at least 3D.
3. Creates and returns a new MappedNeuroVecSource object with the meta information.
A new instance of class MappedNeuroVecSource
.
MappedNeuroVecSource
inherits from:
NeuroVecSource
: Base class for NeuroVec source objects
MappedNeuroVec-class
for the resulting memory-mapped 4D neuroimaging data class.
MappedNeuroVec
, read_header
## Not run:
# Create a MappedNeuroVecSource
mapped_source <- new("MappedNeuroVecSource")
# Use the source to create a MappedNeuroVec (pseudo-code)
# file_path <- "/path/to/large/brain/image.dat"
# mapped_vec <- create_mapped_neuro_vec(mapped_source, file_path)
## End(Not run)
## Not run:
# Assuming you have a valid neuroimaging file named "brain.nii"
source <- MappedNeuroVecSource("brain.nii")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.