Learn R Programming

mritc (version 0.5-3)

writeMRI: Write an MR Image

Description

Write an MR image into a file of different formats.

Usage

writeMRI(data, file, header, format)

Value

Nothing is returned.

Arguments

data

MRI data in a three dimensional array or four dimensional array with the forth dimension equal to 1. It could be also an object of class "nifti" or "anlz" as defined in the package oro.nifti.

file

the name of the image file to be written out.

header

the header file. header is set as NULL for backward compatibility.

format

the format of the image file. Right now only the "Analyze", "NIfTI", and raw byte (unsigned with 1 byte per element in the byte stream) gzip formats are supported.

Details

Header file is not needed for the file of "Analyze" or "NIfTI" format anymore.

Files of "Analyze" format are written out through the function writeANALYZE. Files of "NIfTI" format are written out through the function writeNIfTI.

See Also

writeANALYZE, writeNIfTI

Examples

Run this code
  if (FALSE) {
  writeMRI(vol, file="vol.rawb.gz", header=NULL, format="rawb.gz")
  
  writeMRI(vol, file="vol", header=NULL, format="nifti")

  writeMRI(vol, file="vol", header=NULL, format="analyze")
  }

Run the code above in your browser using DataLab