writeMRI: Write an MR Image

View source: R/mriio.R

writeMRIR Documentation

Write an MR Image

Description

Write an MR image into a file of different formats.

Usage

   writeMRI(data, file, header, format)

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.

Value

Nothing is returned.

See Also

writeANALYZE, writeNIfTI

Examples

  ## Not run: 
  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")
  
## End(Not run)

mritc documentation built on Feb. 16, 2023, 10:47 p.m.