| read.analyze.header | R Documentation |
Read the header of an ANALYZE 7.5 file, i.e. of a file in the two-file format that stores the voxel
data in a separate .img file.
read.analyze.header(filepath)
filepath |
character string, the path to the |
named list with the ANALYZE 7.5 header fields, in the field naming of the format specification. See
analyzeheader.template for a description of all of them. In addition to the fields of the
specification, the following entries are present:
endiancharacter string, the endianness of the file, 'little' or 'big'. It is detected from the
sizeof_hdr field.
magiccharacter string, the 4 bytes at offset 344 (which are the smin field of the ANALYZE
specification), interpreted as a string. It is empty for ANALYZE files, see is.analyze.file.
header_formatcharacter string, always 'analyze' here. The other variant of the two-file format is
reported as 'nifti1_pair', see read.fs.volume.analyze.
spm_origininteger vector of length 3, the interpretation that SPM gives to the originator field:
the voxel coordinates of the image origin, as stored in the first 6 bytes of the field. It is NULL if all
of them are zero, which means that the field does not store an origin.
originator_bytesraw vector of length 10, the unmodified content of the originator field. The
originator entry is the same content with the zero bytes removed and interpreted as a string, which loses
information for the files in which SPM stores the image origin there.
filepath_header, filepath_imagecharacter strings, the paths of the two files of the pair.
ANALYZE 7.5 does not define the meaning of the world coordinate system of an image: the header stores the
voxel sizes but neither the direction of the voxel axes nor the position of the image in space. This function
therefore reports the fields as they are stored and does not derive a transformation matrix. See
read.fs.volume.analyze for the ways to get a matrix anyway, and for what is known and unknown
about them.
read.analyze.data, analyzeheader.template
hdrfile <- system.file("extdata", "analyze", "tiny_u8.hdr",
package = "freesurferformats", mustWork = TRUE
)
analyzeheader <- read.analyze.header(hdrfile)
analyzeheader$datatype
analyzeheader$pix_dim
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.