#include <nifti1.h>
Data Fields | |
| 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] |
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. -----------------------------------------------------------------------------
Definition at line 127 of file nifti1.h.
|
|
auxiliary filename. Definition at line 167 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |
|
|
Number bits/voxel. Definition at line 149 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nim2nhdr(), nifti_simple_init_nim(), and swap_nifti_header(). |
|
|
Max display intensity Definition at line 158 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Min display intensity Definition at line 159 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 132 of file nifti1.h. Referenced by disp_nifti_1_header(). |
|
|
Defines data type! Definition at line 148 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), nifti_simple_init_nim(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 133 of file nifti1.h. Referenced by disp_nifti_1_header(). |
|
|
any text you like. Definition at line 166 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |
|
|
Data array dimensions. Definition at line 140 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), nifti_simple_init_nim(), and swap_nifti_header(). |
|
|
MRI slice ordering. Definition at line 137 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |
|
|
++UNUSED++ Definition at line 134 of file nifti1.h. Referenced by disp_nifti_1_header(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 162 of file nifti1.h. Referenced by disp_nifti_1_header(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 163 of file nifti1.h. Referenced by disp_nifti_1_header(), and swap_nifti_header(). |
|
|
NIFTI_INTENT_* code. Definition at line 147 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
'name' or meaning of data. Definition at line 183 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |
|
|
1st intent parameter. Definition at line 141 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
2nd intent parameter. Definition at line 143 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
3rd intent parameter. Definition at line 145 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
MUST be "ni1\0" or "n+1\0". Definition at line 185 of file nifti1.h. Referenced by disp_nifti_1_header(), and nifti_convert_nim2nhdr(). |
|
|
Grid spacings. Definition at line 151 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), nifti_simple_init_nim(), and swap_nifti_header(). |
|
|
NIFTI_XFORM_* code. Definition at line 169 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion x shift. Definition at line 175 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion y shift. Definition at line 176 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion z shift. Definition at line 177 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion b param. Definition at line 172 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion c param. Definition at line 173 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Quaternion d param. Definition at line 174 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 136 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nim2nhdr(), and nifti_simple_init_nim(). |
|
|
Data scaling: offset. Definition at line 154 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Data scaling: slope. Definition at line 153 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
++UNUSED++ Definition at line 135 of file nifti1.h. Referenced by disp_nifti_1_header(), and swap_nifti_header(). |
|
|
NIFTI_XFORM_* code. Definition at line 170 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
MUST be 348 Definition at line 131 of file nifti1.h. Referenced by disp_nifti_1_header(), is_nifti_file(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), nifti_simple_init_nim(), and swap_nifti_header(). |
|
|
Slice timing order. Definition at line 156 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |
|
|
Time for 1 slice. Definition at line 160 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Last slice index. Definition at line 155 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
First slice index. Definition at line 150 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
1st row affine transform. Definition at line 179 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
2nd row affine transform. Definition at line 180 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
3rd row affine transform. Definition at line 181 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Time axis shift. Definition at line 161 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Offset into .nii file Definition at line 152 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), nifti_convert_nim2nhdr(), and swap_nifti_header(). |
|
|
Units of pixdim[1..4] Definition at line 157 of file nifti1.h. Referenced by disp_nifti_1_header(), nifti_convert_nhdr2nim(), and nifti_convert_nim2nhdr(). |