The NIfTI-1 header

The NIfTI-1 header has the following entries (see below). The size should be indicated as 348, to keep compatibility with Analyze 7.5 reader software. Although the header size field should indicate '348', the real size of the nifti-1 header is 352 bytes.

 

datatype fieldname

NIFTI-1 usage    

ANALYZE 7.5 field(s)

 

 

 

 

was header_key substruct

 

int  sizeof_hdr

MUST be 348

int sizeof_hdr

char  data_type[10]

Unused

char data_type[10]

char  db_name[18]

Unused

char db_name[18]

int   extents

Unused

int extents

short session_error

Unused

short session_error

char  regular

Unused

char regular

char  dim_info

MRI slice ordering

char hkey_un0

 

was image_dimension substruct

 

short dim[0]

Data array dimensions; dim[0] = number of dimensions; if dim[0] is outside range 1..7, then the header information needs to be byte swapped appropriately

short dim[8]

short dim[1]

NIFTI-1 reserves dimensions 1,2,3 for space x,y,z

 

short dim[2]

 

 

short dim[3]

 

 

short dim[4]

NIFTI-1 reserves dimensions 4 for time (t)

 

short dim[5]

storing multiple values at each spatiotemporal voxel

 

short dim[6]

 

 

short dim[7]

 

 

float intent_p1

1st intent parameter

short unused8, short unused9

float intent_p2

2nd intent parameter

short unused10, short unused11

float intent_p3

3rd intent parameter

short unused12, short unused13

short intent_code

NIFTI_INTENT_* code

short unused14

short datatype

Defines data type

short datatype

short bitpix

Number bits/voxel

short bitpix

short slice_start

First slice index

short dim_un0

float pixdim[0]

Grid spacings; Method 2 uses a factor 'qfac' which is either -1 or 1; qfac is stored in the otherwise unused pixdim[0].  If pixdim[0]=0.0 (which should not occur), we take qfac=1

float pixdim[8]

float pixdim[1]

x scale

 

float pixdim[2]

y scale

 

float pixdim[3]

z scale

 

float pixdim[4]

 

 

float pixdim[5]

 

 

float pixdim[6]

 

 

float pixdim[7]

 

 

float vox_offset

Offset into .nii file (should be at least 352)

float vox_offset

float scl_slope

Data scaling: slope

float funused1

float scl_inter

Data scaling: offset

float funused2

short slice_end

Last slice index

float funused3

char  slice_code

Slice timing order

float funused3

char  xyzt_units

dx, dy, dz & dt units: NIFTI_UNITS_* code

float funused3

float cal_max

Max display intensity

float cal_max

float cal_min

Min display intensity

float cal_min

float slice_duration

Time for 1 slice

float compressed

float toffset

Time axis shift  

float verified

int   glmax

Unused

int glmax

int   glmin

Unused

int glmin

 

was data_history substruct

 

char  descrip[80]

 

char descrip[80]

char  aux_file[24]

auxiliary filename

char aux_file[24]

short qform_code

NIFTI_XFORM_* code

all ANALYZE 7.5  fields below here are replaced  

short sform_code

sform_code > 0 indicates affine transformation

 

float quatern_b

Quaternion b param

 

float quatern_c

Quaternion c param

 

float quatern_d

Quaternion d param  

 

float qoffset_x

Quaternion x shift   

 

float qoffset_y

Quaternion y shift   

 

float qoffset_z

Quaternion z shift

 

float srow_x[4]

1st row affine transform

 

float srow_y[4]

2nd row affine transform

 

float srow_z[4]

3rd row affine transform

 

char intent_name[16]

'name' or meaning of data

 

char magic[4]

Indicates nifti-type; must be "ni1\0" or "n+1\0"

 

byte extension[4]

extension = (esize/16) + (222 *code)