Monte Carlo eXtreme (MCX)
Public Attributes | List of all members
nifti_1_header Struct Reference

Data structure defining the fields in the nifti1 header. This binary header should be found at the beginning of a valid NIFTI-1 header file. More...

#include <nifti1.h>

Public Attributes

int sizeof_hdr
 
char data_type [10]
 
char db_name [18]
 
int extents
 
short session_error
 
char regular
 
char dim_info
 
short dim [8]
 
float intent_p1
 
float intent_p2
 
float intent_p3
 
short intent_code
 
short datatype
 
short bitpix
 
short slice_start
 
float pixdim [8]
 
float vox_offset
 
float scl_slope
 
float scl_inter
 
short slice_end
 
char slice_code
 
char xyzt_units
 
float cal_max
 
float cal_min
 
float slice_duration
 
float toffset
 
int glmax
 
int glmin
 
char descrip [80]
 
char aux_file [24]
 
short qform_code
 
short sform_code
 
float quatern_b
 
float quatern_c
 
float quatern_d
 
float qoffset_x
 
float qoffset_y
 
float qoffset_z
 
float srow_x [4]
 
float srow_y [4]
 
float srow_z [4]
 
char intent_name [16]
 
char magic [4]
 

Detailed Description

Data structure defining the fields in the nifti1 header. This binary header should be found at the beginning of a valid NIFTI-1 header file.

INTRODUCTION TO NIFTI-1:

The twin (and somewhat conflicting) goals of this modified ANALYZE 7.5 format are: (a) To add information to the header that will be useful for functional neuroimaging data analysis and display. These additions include:

Most of the unused fields in the ANALYZE 7.5 header have been taken, and some of the lesser-used fields have been co-opted for other purposes. Notably, most of the data_history substructure has been co-opted for other purposes, since the ANALYZE 7.5 format describes this substructure as "not required".

NIFTI-1 FLAG (MAGIC STRINGS):

To flag such a struct as being conformant to the NIFTI-1 spec, the last 4 bytes of the header must be either the C String "ni1" or "n+1"; in hexadecimal, the 4 bytes 6E 69 31 00 or 6E 2B 31 00 (in any future version of this format, the '1' will be upgraded to '2', etc.). Normally, such a "magic number" or flag goes at the start of the file, but trying to avoid clobbering widely-used ANALYZE 7.5 fields led to putting this marker last. However, recall that "the last shall be first" (Matthew 20:16).

If a NIFTI-aware program reads a header file that is NOT marked with a NIFTI magic string, then it should treat the header as an ANALYZE 7.5 structure.

NIFTI-1 FILE STORAGE:

"ni1" means that the image data is stored in the ".img" file corresponding to the header file (starting at file offset 0).

"n+1" means that the image data is stored in the same file as the header information. We recommend that the combined header+data filename suffix be ".nii". When the dataset is stored in one file, the first byte of image data is stored at byte location (int)vox_offset in this combined file. The minimum allowed value of vox_offset is 352; for compatibility with some software, vox_offset should be an integral multiple of 16.

GRACE UNDER FIRE:

Most NIFTI-aware programs will only be able to handle a subset of the full range of datasets possible with this format. All NIFTI-aware programs should take care to check if an input dataset conforms to the program's needs and expectations (e.g., check datatype, intent_code, etc.). If the input dataset can't be handled by the program, the program should fail gracefully (e.g., print a useful warning; not crash).

SAMPLE CODES:

The associated files nifti1_io.h and nifti1_io.c provide a sample implementation in C of a set of functions to read, write, and manipulate NIFTI-1 files. The file nifti1_test.c is a sample program that uses

the nifti1_io.c functions.

Member Data Documentation

◆ aux_file

char nifti_1_header::aux_file[24]

auxiliary filename.

◆ bitpix

short nifti_1_header::bitpix

Number bits/voxel.

◆ cal_max

float nifti_1_header::cal_max

Max display intensity

◆ cal_min

float nifti_1_header::cal_min

Min display intensity

◆ data_type

char nifti_1_header::data_type[10]

++UNUSED++

◆ datatype

short nifti_1_header::datatype

Defines data type!

◆ db_name

char nifti_1_header::db_name[18]

++UNUSED++

◆ descrip

char nifti_1_header::descrip[80]

any text you like.

◆ dim

short nifti_1_header::dim[8]

Data array dimensions.

◆ dim_info

char nifti_1_header::dim_info

MRI slice ordering.

◆ extents

int nifti_1_header::extents

++UNUSED++

◆ glmax

int nifti_1_header::glmax

++UNUSED++

◆ glmin

int nifti_1_header::glmin

++UNUSED++

◆ intent_code

short nifti_1_header::intent_code

NIFTI_INTENT_* code.

◆ intent_name

char nifti_1_header::intent_name[16]

'name' or meaning of data.

◆ intent_p1

float nifti_1_header::intent_p1

1st intent parameter.

◆ intent_p2

float nifti_1_header::intent_p2

2nd intent parameter.

◆ intent_p3

float nifti_1_header::intent_p3

3rd intent parameter.

◆ magic

char nifti_1_header::magic[4]

MUST be "ni1\0" or "n+1\0".

◆ pixdim

float nifti_1_header::pixdim[8]

Grid spacings.

◆ qform_code

short nifti_1_header::qform_code

NIFTI_XFORM_* code.

◆ qoffset_x

float nifti_1_header::qoffset_x

Quaternion x shift.

◆ qoffset_y

float nifti_1_header::qoffset_y

Quaternion y shift.

◆ qoffset_z

float nifti_1_header::qoffset_z

Quaternion z shift.

◆ quatern_b

float nifti_1_header::quatern_b

Quaternion b param.

◆ quatern_c

float nifti_1_header::quatern_c

Quaternion c param.

◆ quatern_d

float nifti_1_header::quatern_d

Quaternion d param.

◆ regular

char nifti_1_header::regular

++UNUSED++

◆ scl_inter

float nifti_1_header::scl_inter

Data scaling: offset.

◆ scl_slope

float nifti_1_header::scl_slope

Data scaling: slope.

◆ session_error

short nifti_1_header::session_error

++UNUSED++

◆ sform_code

short nifti_1_header::sform_code

NIFTI_XFORM_* code.

◆ sizeof_hdr

int nifti_1_header::sizeof_hdr

MUST be 348

◆ slice_code

char nifti_1_header::slice_code

Slice timing order.

◆ slice_duration

float nifti_1_header::slice_duration

Time for 1 slice.

◆ slice_end

short nifti_1_header::slice_end

Last slice index.

◆ slice_start

short nifti_1_header::slice_start

First slice index.

◆ srow_x

float nifti_1_header::srow_x[4]

1st row affine transform.

◆ srow_y

float nifti_1_header::srow_y[4]

2nd row affine transform.

◆ srow_z

float nifti_1_header::srow_z[4]

3rd row affine transform.

◆ toffset

float nifti_1_header::toffset

Time axis shift.

◆ vox_offset

float nifti_1_header::vox_offset

Offset into .nii file

◆ xyzt_units

char nifti_1_header::xyzt_units

Units of pixdim[1..4]


The documentation for this struct was generated from the following file: