Learn R Programming

neuroim2 (version 0.8.5)

parse_afni_extension: Parse AFNI Extension

Description

Parses an AFNI extension (ecode = 4) containing XML-formatted attributes.

Usage

parse_afni_extension(ext, as_xml = TRUE)

Value

If as_xml = TRUE and xml2 is available, returns an xml_document. Otherwise returns a character string containing the XML.

Arguments

ext

A NiftiExtension-class object with ecode = 4.

as_xml

Logical; if TRUE (default) and xml2 is available, returns an xml_document object. Otherwise returns the raw XML string.

Details

AFNI stores dataset attributes in an XML format within the NIfTI extension. The XML contains elements like HISTORY_NOTE, volume labels, tagged points, and other AFNI-specific metadata.

See Also

get_afni_attribute for extracting specific AFNI attributes.

Examples

Run this code
if (FALSE) {
# Read a NIfTI file with AFNI extension
hdr <- read_nifti_header("afni_file.nii")
afni_ext <- hdr$extensions[[1]]
parsed <- parse_afni_extension(afni_ext)
}

Run the code above in your browser using DataLab