Learn R Programming

AnalyzeFMRI (version 1.1-11)

analyze2nifti: Create a NIFTI file from an Analyze file

Description

Create a NIFTI file from an Analyze file.

Usage

analyze2nifti(file.in,path.in=".",path.out=".",file.out=NULL,is.nii=TRUE,qform.code=2,sform.code=2,data.type=rawToChar(raw(10)),db.name=rawToChar(raw(18)),dim.info=rawToChar(raw(1)),dim=NULL,TR=0,slice.code=rawToChar(raw(1)),xyzt.units=rawToChar(raw(1)),descrip=NULL,aux.file=rawToChar(raw(24)),intent.name=rawToChar(raw(16)))

Arguments

path.in
character, Directory path from where to take the .hdr,.img,.mat files
path.out
character, Directory path where to write the .hdr/.img or .nii file
file.out
character, filename of the NIFTI file to write (without extension). If NULL, same as file.in
is.nii
logical, if TRUE a NIFTI .nii file will be created, if FALSE a .hdr/.img NIFTI file will be created
qform.code
qform.code value (in 0,...4)
sform.code
sform.code value (in 0,...4)
data.type
char[10]. UNUSED in NIFTI-1 but could be filled with what you want
db.name
char[18]. UNUSED in NIFTI-1 but could be filled with what you want
dim.info
MRI slice ordering: This field encode which spatial dimension (1=x, 2=y, or 3=z) corresponds to which acquisition dimension for MRI data. In fact, it contains three informations: freq.dim, phase.dim and slice.dim, all squished into the single byte f
dim
vector (of length 8) of image dimensions. dim[1] specifies the number of dimensions. In NIFTI-1 files, dim[2], dim[3], dim[4] are for space, dim[5] is for time. The 5th dimension (dim[6]) of the dataset, if present (i.e., dim[1]=5 and dim[6] > 1), c
TR
Time Repetition to be stored in pixdim[5]
slice.code
Slice timing order. If this is nonzero, AND if slice.dim is nonzero, AND if slice.duration is positive, indicates the timing pattern of the slice acquisition. The following codes are defined: 0 (NIFTI SLI
xyzt.units
Units of pixdim[2:5]. Bits 1..3 of xyzt.units specify the (same) space unit of pixdim[2:4]. Bits 4..6 of xyzt.units specify the time unit of pixdim[5]. See xyzt-units.txt in the niftidoc directory of the source package. The R function st2xyzt can be
descrip
char[80]. This field may contain any text you like
aux.file
char[24]. This field is used to store an auxiliary filename.
intent.name
char[16]. 'name' or meaning of data. If no data name is implied or needed, intent.name[1] should be set to 0.

Value

  • Nothing is returned. The NIFTI file is created in the specified path.out directory (default is current directory).

Examples

Run this code
analyze2nifti(path.in=system.file(package="AnalyzeFMRI"),file.in="example",file.out="nifti-tmp",is.nii=TRUE)

Run the code above in your browser using DataLab