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

View source: R/nifti2_extensions.R

nifti2.extension.textR Documentation

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)

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.

See Also

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


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.