f.read.analyze.header: read Analyze header file

Description Usage Arguments Value See Also Examples

View source: R/analyzeFMRI.R

Description

Reads the ANALYZE image format .hdr header file into a list.

Usage

1

Arguments

file

The .hdr file to be read

Value

A list containing the information in the fields of the .hdr file.

file.name

name of the .img file

swap

TRUE or FALSE variable indicating whether files are big or little endian

....... HEADER KEY ..........
sizeof.hdr

This field implies that Analyze format was originally intended to be extensible, but in practice this did not happen, and instead the file size (and hence the value of this field) is 348. Software commonly tests the value in this field to detect whether the byte ordering is Big-Endian or Little-Endian.

data.type

character vector indicating data storage type for each voxel

db.name

database name

extents

Should be 16384, the image file is created as contiguous with a minimum extent size

session.error
regular

Must be ‘r’ to indicate that all images and volumes are the same size

hkey.un0
....... IMAGE DIMENSION ..........
dim

vector of the image dimensions: dim[1] Number of dimensions in database, usually 4; dim[2] Image X dimension (slice width), number of pixels in an image row; dim[3] Image Y dimension (slice height), number of pixel rows in slice; dim[4] Volume Z dimension (volume depth), number of slices in a volume; dim[5] Time points, number of volumes in database dim[6] ?? dim[7] ?? dim[8] ??

vox.units

3 characters to specify the spatial units of measure for a voxel (mm., um., cm.)

cal.units

7 characters to specify the name of the calibration unit i.e. pixel,voxel

unused1

??

datatype

integer indicator of data storage type for this image: 0 (None or Unknown), 1 (Binary), 2 (Unsigned-char), 4 (Signed-short), 8 (Signed-int), 16 (float), 32 (Complex), 64 (Double), 128 (RGB), 255 (All)

bitpix

number of bits per pixel: 1 (packed binary, slices begin on byte boundaries), 8 (unsigned char, gray scale), 16 (signed short), 32 (signed integers or float), or 24 (RGB, 8 bits per channel)s

dim.un0

unused

pixdim

Parallel vector to dim, giving real world measurements in mm. and ms. pixdim[1]: ?? pixdim[2]: voxel width in mm. pixdim[3]: voxel height in mm. pixdim[4]: slice thickness (interslice distance) in mm. pixdim[5]: timeslice in ms. pixdim[6]: ?? pixdim[7]: ?? pixdim[8]: ??

vox.offset

byte offset in the .img file at which voxels start. This value can be negative to specify that the absolute value is applied for every image voxel in the file

funused1

specify the range of calibration values. SPM extends the Analyze format by using a scaling factor for the image from the header

funused2

SPM2 image intensity zero intercept

funused3

??

cal.max

Max display intensity, calibration value, values of 0.0 for both fields imply that no calibration max and min values are used

cal.min

Min display intensity, calibration value

compressed

??

verified

??

glmax

The maximum pixel values for the entire database

glmin

The minimum pixel values for the entire database

....... DATA HISTORY ..........
descrip

any text you like

aux.file

auxiliary filename

orient

planar slice orientation for this dataset: 0 transverse unflipped; 1 coronal unflipped; 2 sagittal unflipped; 3 transverse flipped; 4 coronal flipped; 5 sagittal flipped

originator

image central voxel coordinates. SPM uses this Analyze header field in an unorthodox way. originator[1]: SPM99 X near Anterior Commissure, originator[2]: SPM99 Y near Anterior Commissure, originator[3]: SPM99 Z near Anterior Commissure, originator[4]:??, originator[5]:??

generated

??

scannum

??

patient.id

??

exp.date

??

exp.time

??

hist.un0

??

views

??

vols.added

??

start.field

??

field.skip

??

omax

??

omin

??

smax

??

smin

??

See Also

f.analyze.file.summary

Examples

1
f.read.analyze.header(system.file("example.hdr", package="AnalyzeFMRI"))

Example output

Loading required package: R.matlab
R.matlab v3.6.2 (2018-09-26) successfully loaded. See ?R.matlab for help.

Attaching package: 'R.matlab'

The following objects are masked from 'package:base':

    getOption, isOpen

Loading required package: fastICA
Loading required package: tcltk
Loading required package: tkrplot
Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 
$file.name
[1] "/usr/lib/R/site-library/AnalyzeFMRI/example.img"

$swap
[1] 1

$sizeof.hdr
[1] 348

$data.type
[1] "signed short"

$db.name
[1] "audvis.4.2.mc.vol."

$extents
[1] 16384

$session.error
[1] 0

$regular
[1] "r"

$hkey.un0
[1] ""

$dim
[1]  4 64 64 21  1  0  0  0

$vox.units
[1] "mm"

$cal.units
[1] "pixels"

$unused1
[1] 0

$datatype
[1] 4

$bitpix
[1] 16

$dim.un0
[1] 0

$pixdim
[1] 4 4 4 6 0 0 0 0
attr(,"Csingle")
[1] TRUE

$vox.offset
[1] 0
attr(,"Csingle")
[1] TRUE

$funused1
[1] 1
attr(,"Csingle")
[1] TRUE

$funused2
[1] 0
attr(,"Csingle")
[1] TRUE

$funused3
[1] 0
attr(,"Csingle")
[1] TRUE

$cal.max
[1] 14553
attr(,"Csingle")
[1] TRUE

$cal.min
[1] 0
attr(,"Csingle")
[1] TRUE

$compressed
[1] 0
attr(,"Csingle")
[1] TRUE

$verified
[1] 0
attr(,"Csingle")
[1] TRUE

$glmax
[1] 14553

$glmin
[1] 0

$descrip
[1] "audvis.4.2.mc.vol.1.img"

$aux.file
[1] ""

$orient
[1] ""

$originator
[1] 0 0 0 0 0

$generated
[1] ""

$scannum
[1] ""

$patient.id
[1] ""

$exp.date
[1] ""

$exp.time
[1] ""

$hist.un0
[1] "LAS"

$views
[1] 0

$vols.added
[1] 0

$start.field
[1] 0

$field.skip
[1] 0

$omax
[1] 0

$omin
[1] 0

$smax
[1] 0

$smin
[1] 0

AnalyzeFMRI documentation built on Oct. 5, 2021, 5:06 p.m.