Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

Arguments

file

A character vector of file names.

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.

Note

NIfTI-2 format, mostly a variant of NIfTI-1 with wider datatypes used for many fields, is not currently supported for reading, but it is detected by this function.

Author(s)

Jon Clayden <code@clayden.org>

See Also

Examples

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

RNifti

Fast R and C++ Access to NIfTI Images

v1.3.0
GPL-2
Authors
Jon Clayden [cre, aut] (<https://orcid.org/0000-0002-6608-0619>), Bob Cox [aut], Mark Jenkinson [aut], Matt Hall [ctb], Rick Reynolds [ctb], Kate Fissell [ctb], Jean-loup Gailly [cph], Mark Adler [cph]
Initial release
2020-12-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.