NIFTI v2 files can store arbitrary data in header extensions, in the area between the header and the voxel data. This function creates such an extension. Pass the result to write.nifti2, which writes it to the file, and later read it back with read.nifti2.header plus nifti2.get.extension.
Arguments
- ecode
integer, the extension code. This identifies the type of the payload, but the code is not interpreted in any way. The CIFTI2 XML metadata uses code
32L.- content
raw vector, character string, or
NULL. The payload of the extension, i.e., the data to store. A character string is converted to UTF-8 bytes (several strings are joined with newline characters). UseNULLor omit for an empty payload.
Value
named list with the entries 'ecode' and 'content', representing one NIFTI v2 header extension.
See also
nifti2.get.extension, nifti2.extension.text
Other nifti2 extensions:
nifti2.extension.content(),
nifti2.extension.size(),
nifti2.extension.text(),
nifti2.get.extension()