MappedNeuroVecSource-class: MappedNeuroVecSource Class

MappedNeuroVecSource-classR Documentation

MappedNeuroVecSource Class

Description

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.

Usage

MappedNeuroVecSource(file_name)

Arguments

file_name

Character string specifying the path to the neuroimaging file. Supported formats include NIFTI (.nii) and ANALYZE (.hdr/.img).

Details

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

Value

A new MappedNeuroVecSource object containing:

  • Meta information about the dataset

  • File format details

  • Dimensional information

Inheritance

MappedNeuroVecSource inherits from:

  • NeuroVecSource: Base class for NeuroVec source objects

See Also

MappedNeuroVec-class for the resulting memory-mapped 4D neuroimaging data class.

MappedNeuroVec for the main user interface read_header for header reading details

Examples

## 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: 
# Create source from NIFTI file
source <- MappedNeuroVecSource("path/to/fmri.nii")

# Check dimensions
dim(source@meta_info)

# View header information
str(source@meta_info)

## End(Not run)


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