Learn R Programming

freesurferformats (version 1.1.0)

nifti2.extension.text: Get the payload of a NIFTI v2 header extension as text.

Description

Convert the payload of a header extension to a character string. The trailing NUL bytes, which are only used to pad the extension to a multiple of 16 bytes, are removed. Note that embedded NUL bytes cannot be represented in an R string and are removed as well, so this function is only meaningful for text payloads (like the CIFTI2 XML metadata).

Usage

nifti2.extension.text(extension)

Value

character string, the payload of the extension. The string is marked as UTF-8 encoded, which is the encoding required by the NIFTI standard.

Arguments

extension

a NIFTI v2 header extension, a named list with entries 'ecode' and 'content', see nifti2.extension.

See Also

Other nifti2 extensions: nifti2.extension(), nifti2.extension.content(), nifti2.extension.size(), nifti2.get.extension()