read.nii.volume: Read NII Volume

Description Usage Arguments Details Value Author(s) Examples

View source: R/read.nii.volume.R

Description

Read indicated volume from NIfTI files.

Usage

1
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

1
2
3
4
5
# 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)

nifti.io documentation built on June 8, 2021, 9:06 a.m.