Skip to contents

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)

Arguments

extension

a NIFTI v2 header extension, a named list with entries 'ecode' and 'content', see nifti2.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.