data_decoder {gifti} | R Documentation |
Array Data Decoder
Description
Decodes values from a GIFTI image
Usage
data_decoder(
values,
encoding = c("ASCII", "Base64Binary", "GZipBase64Binary", "ExternalFileBinary"),
datatype = NULL,
endian = c("little", "big", "LittleEndian", "BigEndian"),
ext_filename = NULL,
n = NULL
)
Arguments
values |
text from XML of GIFTI image |
encoding |
encoding of GIFTI values |
datatype |
Passed to |
endian |
Endian to pass in |
ext_filename |
if |
n |
number of values to read. Relevant if
|
Value
Vector of values
Examples
if (have_gifti_test_data(outdir = NULL)) {
gii_files = download_gifti_data(outdir = NULL)
L = gifti_list(gii_files[1])
orig = L$DataArray$Data[[1]]
encoding = attributes(L$DataArray)$Encoding
datatype = attributes(L$DataArray)$DataType
endian = attributes(L$DataArray)$Endian
vals = data_decoder(orig, encoding = encoding,
datatype = datatype, endian = endian)
enc = data_encoder(vals, encoding = encoding,
datatype = datatype, endian = endian)
enc == orig
}
[Package gifti version 0.8.0 Index]