Convert a NeuroVec to a memory-mapped representation
Source:R/all_generic.R, R/mapped_neurovec.R, R/neurovec.R, and 1 more
as_mmap.RdGeneric for converting neuroimaging vectors to a memory-mapped
MappedNeuroVec on disk (when possible).
Methods for the as_mmap generic, which convert various
neuroimaging vector types to a MappedNeuroVec backed
by an on-disk NIfTI file.
Usage
as_mmap(x, file = NULL, ...)
# S4 method for class 'MappedNeuroVec'
as_mmap(x, file = NULL, ...)
# S4 method for class 'FileBackedNeuroVec'
as_mmap(x, file = NULL, ...)
# S4 method for class 'NeuroVec'
as_mmap(x, file = NULL, data_type = "FLOAT", overwrite = FALSE, ...)
# S4 method for class 'SparseNeuroVec'
as_mmap(x, file = NULL, data_type = "FLOAT", overwrite = FALSE, ...)Arguments
- x
A neuroimaging vector (
NeuroVec,MappedNeuroVec, orFileBackedNeuroVec).- file
Optional output file name. If
NULL, a temporary file with extension.niiis created.- ...
Additional arguments passed to methods (e.g.
data_type,overwrite).- data_type
Character string specifying the output data type for the NIfTI file. Should be one of: "BINARY", "UBYTE", "SHORT", "INT", "FLOAT", "DOUBLE". Default is "FLOAT".
- overwrite
Logical; if
TRUE, overwrite an existing file at the specified path. Default isFALSE.
Value
A MappedNeuroVec (or x itself if already
memory-mapped).
A MappedNeuroVec (or x itself if it is
already memory-mapped).