Write a NIfTI or ANALYZE format file
These functions write an image to NIfTI-1, NIfTI-2 or ANALYZE-7.5 format, using the standard NIfTI C library.
writeNifti(image, file, template = NULL, datatype = "auto", version = 1) writeAnalyze(image, file, template = NULL, datatype = "auto")
image |
An image, in any acceptable form (see |
file |
A character string containing a file name. |
template |
An optional template object to derive NIfTI-1 properties
from. Passed to |
datatype |
The NIfTI datatype to use when writing the data out. The
default, |
version |
An integer (1 or 2) giving the NIfTI file format version to use. Version 2 is usually only needed for very large images or where metadata needs to be stored with high precision. The types available for storing the pixel data are the same in both cases. |
An invisible, named character vector giving the image and header file names written to.
The ANALYZE-7.5 file format is a legacy format and use of it is not recommended, except for compatibility. In particular, the format does not reliably specify the spatial orientation of the image.
Jon Clayden <code@clayden.org>
The NIfTI-1 standard (http://www.nitrc.org/docman/view.php/26/64/nifti1.h).
## Not run: writeNifti(im, "image.nii.gz", datatype="float")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.