read.nii.volume {nifti.io} | R Documentation |
Read NII Volume
Description
Read indicated volume from NIfTI files.
Usage
read.nii.volume(nii.file, vol.num)
Arguments
nii.file |
Full directory listing to a NIFTI file. File must not be gzipped. |
vol.num |
An integer indicating which volume to read. |
Details
NIfTI files need to be unzipped before using this function or any other portions of the nifti.io package. This is necessary given the inconsistent way in which gzipped files are indexed (Some information on this is given in the documentation for the readBin function).
Value
An array containing values from NIFTI volume.
Author(s)
Timothy R. Koscik <timothy-koscik@uiowa.edu>
Examples
# get filename for example NII file included in nifti.io package
nii.eg <- system.file("extdata", "egBrain.nii", package="nifti.io")
# read entire volume into array
volume.values <- read.nii.volume(nii.file = nii.eg, vol.num = 1)
[Package nifti.io version 1.0.0 Index]