Learn R Programming

freesurferformats (version 1.1.0)

analyze.pair.files: Determine the header and data file of an ANALYZE 7.5 or NIFTI v1 pair file.

Description

The two formats ANALYZE 7.5 and NIFTI v1 (in its two-file variant) store the image in a header file (<base>.hdr) and a data file (<base>.img). This function computes the two file names from any of them, so that the user can pass any of the possible spellings.

Usage

analyze.pair.files(filepath, require_header = FALSE)

Value

named list with the entries header and image, the full paths to the header and the data file, the logical entries header_exists and image_exists, and the entries mat (the path of the MATLAB sidecar file that SPM and FreeSurfer write next to the image file, see read.fs.volume.analyze) and mat_exists, which report whether such a file is present.

Arguments

filepath

character string, the path to the header file, to the data file, or to the base name (with or without a .hdr/.img/.gz suffix).

require_header

logical, whether to stop with an error if the header file does not exist. If FALSE, the computed file names are returned even if the files are missing.