View source: R/nifti_extensions.R
| NiftiExtension | R Documentation |
Constructor function for creating a NiftiExtension-class object
with proper padding to ensure the size is a multiple of 16 bytes.
NiftiExtension(ecode, data)
ecode |
Integer extension code. See |
data |
The extension data. Can be:
|
The function automatically handles padding to ensure the total extension size (esize) is a multiple of 16 bytes, as required by the NIfTI specification. The esize includes the 8-byte header (esize + ecode fields).
A NiftiExtension-class object.
NiftiExtension-class, NiftiExtensionCodes
# Create a comment extension
ext <- NiftiExtension(ecode = 6L, data = "This is a comment")
ext@ecode
ext@esize
# Create an AFNI extension with XML data
afni_xml <- '<?xml version="1.0"?><AFNI_attributes></AFNI_attributes>'
afni_ext <- NiftiExtension(ecode = 4L, data = afni_xml)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.