RNifti (version 1.3.0)

niftiHeader: Dump or construct a raw NIfTI or ANALYZE header

Description

These functions extract the contents of a NIfTI-1 or ANALYZE-7.5 header, closely approximating how it is (or would be) stored on disk. Defaults will be used where information is missing, but no processing is performed on the metadata.

Usage

niftiHeader(image = list())

analyzeHeader(image = list())

# S3 method for niftiHeader print(x, ...)

# S3 method for analyzeHeader print(x, ...)

Arguments

image

An image, in any acceptable form (see asNifti). A list containing partial header information is acceptable, including an empty list, which returns defaults for every field.

x

A "niftiHeader" object.

...

Ignored.

Value

For niftiHeader, a list of class "niftiHeader", with named components corresponding to the elements in a raw NIfTI-1 header. For analyzeHeader, the equivalent for ANALYZE-7.5.

Details

The NIfTI-1 standard was originally formulated as a roughly backwards- compatible improvement on the ANALYZE format. Both formats use a binary header structure of 348 bytes, but the field names and their interpretation is often non-equivalent. These functions dump these fields, without regard to whether or not the result makes proper sense.

dumpNifti is an alias of niftiHeader, but the former is now soft-deprecated.

References

The NIfTI-1 standard (http://www.nitrc.org/docman/view.php/26/64/nifti1.h).

See Also

niftiVersion

Examples

Run this code
# NOT RUN {
niftiHeader(system.file("extdata", "example.nii.gz", package="RNifti"))

# Default header for a standard R array
niftiHeader(array(0L, dim=c(10,10)))

# }

Run the code above in your browser using DataLab