Learn R Programming

vows (version 0.5)

nii2R: NIfTI-to-R conversion

Description

Reads in a NIfTI (.nii) file and puts the data in a 4-dimensional array.

Usage

nii2R(niifilename, which.vols = NULL, savename = NULL, remove.zero = TRUE, maskname = NULL, ind = NULL, ind.auto = TRUE, coord = NULL)

Arguments

niifilename
the path for the .nii file.
which.vols
which volumes (images) to include. In terms of the 4D array, this refers to subsetting in the fourth dimension. If NULL (the default), all volumes are included.
savename
if non-NULL, the name of the .RData file to which the 4D array will be saved.
remove.zero
optional when maskname is not provided. If TRUE, a binary array indicating the voxels with nonzero measures based on the first three dimension of the nii file will be provided. If FALSE, a 3D array with TRUE everywhere will be provided.
maskname
name of a .nii file providing a "mask", a 3D binary array indicating which voxels to include.
ind, ind.auto
ind is an optional list saying which indices (which slices of the image) to include in each of the three dimensions. If NULL, this will be all slices with nonzero data if ind.auto = TRUE, and all slices otherwise.
coord
coordinates of the first three dimensions of the 4D array created.

Value

a 4-dimensional array.

See Also

R2nii