nifti2.trailing.nul.removed: Remove trailing NUL bytes from a raw vector.

View source: R/nifti2_extensions.R

nifti2.trailing.nul.removedR Documentation

Remove trailing NUL bytes from a raw vector.

Description

Remove the NUL bytes at the end of a raw vector, but keep any NUL bytes before them. This is needed for the payload of NIFTI v2 header extensions, which is padded with NUL bytes to a multiple of 16 bytes, but can in theory contain NUL bytes as part of the payload.

Usage

nifti2.trailing.nul.removed(rawdata)

Arguments

rawdata

raw vector or integer vector with values in range 0 to 255.

Value

raw vector, the input without trailing NUL bytes.


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