| is.analyze.file | R Documentation |
Check whether a file is an ANALYZE 7.5 file.
is.analyze.file(filepath)
filepath |
character string, the path to a |
logical, whether the 348 byte header is an ANALYZE 7.5 header. This is the case when the header contains
neither of the two NIFTI v1 magic strings, i.e. when the magic is empty. Files that use the ni1 magic are
NIFTI v1 pair files, see read.nifti1.header, and files with the n+1 magic are single file NIFTI
v1 files.
Note that this function returns TRUE for any two-file header that does not carry a NIFTI magic, which is
what "ANALYZE 7.5" means in practice: these files were written by ANALYZE itself, by SPM, by AFNI or by
FreeSurfer. Only the fields of the ANALYZE specification are defined for them, but SPM stores extra
information in fields that ANALYZE leaves unused, see read.fs.volume.analyze.
A file path that does not describe an existing pair file (for example a single file NIFTI image, or a
file that does not exist) returns FALSE rather than an error.
hdrfile <- system.file("extdata", "analyze", "tiny_u8.hdr",
package = "freesurferformats", mustWork = TRUE
)
is.analyze.file(hdrfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.