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.

This function constructs a MappedNeuroVecSource object, which represents a source for memory-mapped neuroimaging data.

Usage

MappedNeuroVecSource(file_name)

Arguments

file_name

A character string specifying the name of the image file to be memory mapped.

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.

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.

Value

A new instance of class MappedNeuroVecSource.

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, read_header

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: 
# Assuming you have a valid neuroimaging file named "brain.nii"
source <- MappedNeuroVecSource("brain.nii")

## End(Not run)


bbuchsbaum/neuroim2 documentation built on Nov. 3, 2024, 9:31 a.m.