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.
analyze.pair.files(filepath, require_header = FALSE)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.
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).
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.