Learn R Programming

RNifti (version 1.7.0)

niftiVersion: Check the format version of a file

Description

This function identifies the likely NIfTI format variant used by one or more files on disk.

Usage

niftiVersion(file)

Value

A vector of integers, of the same length as file. Each element will be 0 for ANALYZE format (the precursor to NIfTI-1), 1 for NIfTI-1 (which is now most common), 2 for NIfTI-2, or -1 if the file doesn't exist or doesn't look plausible in any of these formats.

Arguments

file

A character vector of file names.

Author

Jon Clayden <code@clayden.org>

See Also

readNifti, niftiHeader

Examples

Run this code
path <- system.file("extdata", "example.nii.gz", package="RNifti")
niftiVersion(path)       # 1

Run the code above in your browser using DataLab