Skip to content

Commit 29f333b

Browse files
authored
[feat] Add new NIRS intent codes
1 parent 64690d4 commit 29f333b

1 file changed

Lines changed: 92 additions & 61 deletions

File tree

JNIfTI_specification.md

Lines changed: 92 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -227,67 +227,67 @@ corresponding JNIfTI `NIFTIHeader` self-explanatory subfields
227227

228228
***Table 1. A mapping table for NIFTI-1/2 headers and JNIfTI NIFTIHeader structure***
229229

230-
| NIFTI-1| NIFTI-2| Headers | Meanings | JNIfTI NIFTIHeader container |
231-
|--------|--------|------------------|-------------------------------|---------------------------------------|
232-
|`struct`|`struct`|` nifti_1_header{`| |`"NIFTIHeader": { `|
233-
|` int `|` int `|` sizeof_hdr; `| **NIFTI-1/2: 348/540** |`    "NIIHeaderSize": <i>, `|
234-
|` char `| - |` data_type[10]; `| **++UNUSED++** |`    "A75DataTypeName": "s", `|
235-
|` char `| - |` db_name[18]; `| **++UNUSED++** |`    "A75DBName": "s", `|
236-
|` int `| - |` extents; `| **++UNUSED++** |`    "A75Extends": <i>, `|
237-
|` short`| - |` session_error; `| **++UNUSED++** |`    "A75SessionError": <i>, `|
238-
|` char `| - |` regular; `| **++UNUSED++** |`    "A75Regular": <i>, `|
239-
|` char `|` char `|` dim_info; `| **MRI slice ordering** |`    "DimInfo" : { `|
240-
| | | | |`        "Freq": <i>, `|
241-
| | | | |`        "Phase": <i>, `|
242-
| | | | |`        "Slice": <i> `|
243-
| | | | |`     },   `|
244-
|` short`|` int64`|` dim[8]; `| **Data array dimensions** |`    "Dim": [dim[1],dim[2],...], `|
245-
|` float`|`double`|` intent_p1 ; `| **1st intent parameter** |`    "Param1": <f>, `|
246-
|` float`|`double`|` intent_p2 ; `| **2nd intent parameter** |`    "Param2": <f>, `|
247-
|` float`|`double`|` intent_p3 ; `| **3rd intent parameter** |`    "Param3": <f>, `|
248-
|` short`|` int `|` intent_code ; `| **NIFTI_INTENT_\* code** |`    "Intent": <i>\|"s", `|
249-
|` short`|` short`|` datatype; `| **Defines data type** |`    "DataType": <i>\|"s", `|
250-
|` short`|` short`|` bitpix; `| **Number bits/voxel** |`    "BitDepth": <i>, `|
251-
|` short`|` int `|` slice_start; `| **First slice index** |`    "FirstSliceID": <i>, `|
252-
|` float`|`double`|` pixdim[8]; `| **Grid spacings** |`    "VoxelSize":[pixdim[1],pixdim[2],...],`|
253-
| | | | **+x direction meaning** |`    "Orientation": { "x": "s", `|
254-
| | | | **+y direction meaning** |`        "y": "s", `|
255-
| | | | **+z direction meaning** |`        "z": "s" `|
256-
| | | |*RAS or LAS base on pixdim[0]* |`     },   `|
257-
|` float`|`double`|` vox_offset; `| **Offset into .nii file** |`    "NIIByteOffset": <f>, `|
258-
|` float`|`double`|` scl_slope ; `| **Data scaling: slope** |`    "ScaleSlope": <f>, `|
259-
|` float`|`double`|` scl_inter ; `| **Data scaling: offset** |`    "ScaleOffset": <f>, `|
260-
|` short`|` int `|` slice_end; `| **Last slice index** |`    "LastSliceID": <i>, `|
261-
|` char `|` int `|` slice_code ; `| **Slice timing order** |`    "SliceType": <i>\|"s", `|
262-
|` char `|` int `|` xyzt_units ; `| **Units of pixdim[1..4]** |`    "Unit":{"L":<i>\|"s","T":<i>\|"s"},`|
263-
|` float`|` float`|` cal_max; `| **Max display intensity** |`    "MaxIntensity": <f>, `|
264-
|` float`|` float`|` cal_min; `| **Min display intensity** |`    "MinIntensity": <f>, `|
265-
|` float`|` float`|` slice_duration;`| **Time for 1 slice** |`    "SliceTime": <f>, `|
266-
|` float`|` float`|` toffset; `| **Time axis shift** |`    "TimeOffset": <f>, `|
267-
|` int `| - |` glmax; `| **++UNUSED++** |`    "A75GlobalMax": <i>, `|
268-
|` int `| - |` glmin; `| **++UNUSED++** |`    "A75GlobalMin": <i>, `|
269-
|` char `|` char `|` descrip[80]; `| **Data description** |`    "Description": "s", `|
270-
|` char `|` char `|` aux_file[24]; `| **Auxiliary filename** |`    "AuxFile": "s", `|
271-
|` short`|` int `|` qform_code ; `| **NIFTI_XFORM_\* code** |`    "QForm": <i>\|"s", `|
272-
|` short`|` int `|` sform_code ; `| **NIFTI_XFORM_\* code** |`    "SForm": <i>\|"s", `|
273-
|` float`|`double`|` quatern_b ; `| **Quaternion b param** |`    "Quatern": { "b"=<f>, `|
274-
|` float`|`double`|` quatern_c ; `| **Quaternion c param** |`        "c": <f>, `|
275-
|` float`|`double`|` quatern_d ; `| **Quaternion d param** |`        "d": <f> `|
276-
| | | | |`     },   `|
277-
|` float`|`double`|` qoffset_x ; `| **Quaternion x shift** |`    "QuaternOffset":{ "x": <f>, `|
278-
|` float`|`double`|` qoffset_y ; `| **Quaternion y shift** |`        "y": <f>, `|
279-
|` float`|`double`|` qoffset_z ; `| **Quaternion z shift** |`        "z": <f> `|
280-
| | | | |`     },   `|
281-
|` float`|`double`|` srow_x[4] ; `| **1st row affine transform** |`    "Affine": [ [<f>,<f>,<f>,<f>], `|
282-
|` float`|`double`|` srow_y[4] ; `| **2nd row affine transform** |`        [<f>,<f>,<f>,<f>], `|
283-
|` float`|`double`|` srow_z[4] ; `| **3rd row affine transform** |`        [<f>,<f>,<f>,<f>] `|
284-
| | | | |`    ], `|
285-
|` char `|` char `|`intent_name[16];`| **'name' or meaning of data**|`    "Name" : "s", `|
286-
|`char*4`|`char*8`|` magic[] ; `| **NIFTI-1:"ni1\0" or "n+1\0"**|`    "NIIFormat": "s", `|
287-
| | |`};` | |      |
288-
|`struct`|`struct`|`nifti_extender `|`{char extension[4];};` |`    "NIFTIExtension": [<i>,<i>,<i>,<i>],`|
289-
| | | | |`    <...> `|
290-
| | | | |`} `|
230+
| NIFTI-1 | NIFTI-2 | Headers | Meanings | JNIfTI NIFTIHeader container |
231+
|----------|----------|------------------------|--------------------------------|-----------------------------------------------|
232+
| `struct` | `struct` | ` nifti_1_header{` | | `"NIFTIHeader": {` |
233+
| ` int ` | ` int ` | ` sizeof_hdr;` | **NIFTI-1/2: 348/540** | ` "NIIHeaderSize": <i>,` |
234+
| ` char ` | - | ` data_type[10];` | **++UNUSED++** | ` "A75DataTypeName": "s",` |
235+
| ` char ` | - | ` db_name[18];` | **++UNUSED++** | ` "A75DBName": "s",` |
236+
| ` int ` | - | ` extents;` | **++UNUSED++** | ` "A75Extends": <i>,` |
237+
| ` short` | - | ` session_error;` | **++UNUSED++** | ` "A75SessionError": <i>,` |
238+
| ` char ` | - | ` regular;` | **++UNUSED++** | ` "A75Regular": <i>,` |
239+
| ` char ` | ` char ` | ` dim_info;` | **MRI slice ordering** | ` "DimInfo" : {` |
240+
| | | | | ` "Freq": <i>,` |
241+
| | | | | ` "Phase": <i>,` |
242+
| | | | | ` "Slice": <i>` |
243+
| | | | | ` },` |
244+
| ` short` | ` int64` | ` dim[8];` | **Data array dimensions** | ` "Dim": [dim[1],dim[2],...],` |
245+
| ` float` | `double` | ` intent_p1 ;` | **1st intent parameter** | ` "Param1": <f>,` |
246+
| ` float` | `double` | ` intent_p2 ;` | **2nd intent parameter** | ` "Param2": <f>,` |
247+
| ` float` | `double` | ` intent_p3 ;` | **3rd intent parameter** | ` "Param3": <f>,` |
248+
| ` short` | ` int ` | ` intent_code ;` | **NIFTI_INTENT_\* code** | ` "Intent": <i>\|"s",` |
249+
| ` short` | ` short` | ` datatype;` | **Defines data type** | ` "DataType": <i>\|"s",` |
250+
| ` short` | ` short` | ` bitpix;` | **Number bits/voxel** | ` "BitDepth": <i>,` |
251+
| ` short` | ` int ` | ` slice_start;` | **First slice index** | ` "FirstSliceID": <i>,` |
252+
| ` float` | `double` | ` pixdim[8];` | **Grid spacings** | ` "VoxelSize":[pixdim[1],pixdim[2],...],` |
253+
| | | | **+x direction meaning** | ` "Orientation": { "x": "s",` |
254+
| | | | **+y direction meaning** | ` "y": "s",` |
255+
| | | | **+z direction meaning** | ` "z": "s"` |
256+
| | | | *RAS or LAS base on pixdim[0]* | ` },` |
257+
| ` float` | `double` | ` vox_offset;` | **Offset into .nii file** | ` "NIIByteOffset": <f>,` |
258+
| ` float` | `double` | ` scl_slope ;` | **Data scaling: slope** | ` "ScaleSlope": <f>,` |
259+
| ` float` | `double` | ` scl_inter ;` | **Data scaling: offset** | ` "ScaleOffset": <f>,` |
260+
| ` short` | ` int ` | ` slice_end;` | **Last slice index** | ` "LastSliceID": <i>,` |
261+
| ` char ` | ` int ` | ` slice_code ;` | **Slice timing order** | ` "SliceType": <i>\|"s",` |
262+
| ` char ` | ` int ` | ` xyzt_units ;` | **Units of pixdim[1..4]** | ` "Unit":{"L":<i>\|"s","T":<i>\|"s"},` |
263+
| ` float` | ` float` | ` cal_max;` | **Max display intensity** | ` "MaxIntensity": <f>,` |
264+
| ` float` | ` float` | ` cal_min;` | **Min display intensity** | ` "MinIntensity": <f>,` |
265+
| ` float` | ` float` | ` slice_duration;` | **Time for 1 slice** | ` "SliceTime": <f>,` |
266+
| ` float` | ` float` | ` toffset;` | **Time axis shift** | ` "TimeOffset": <f>,` |
267+
| ` int ` | - | ` glmax;` | **++UNUSED++** | ` "A75GlobalMax": <i>,` |
268+
| ` int ` | - | ` glmin;` | **++UNUSED++** | ` "A75GlobalMin": <i>,` |
269+
| ` char ` | ` char ` | ` descrip[80];` | **Data description** | ` "Description": "s",` |
270+
| ` char ` | ` char ` | ` aux_file[24];` | **Auxiliary filename** | ` "AuxFile": "s",` |
271+
| ` short` | ` int ` | ` qform_code ;` | **NIFTI_XFORM_\* code** | ` "QForm": <i>\|"s",` |
272+
| ` short` | ` int ` | ` sform_code ;` | **NIFTI_XFORM_\* code** | ` "SForm": <i>\|"s",` |
273+
| ` float` | `double` | ` quatern_b ;` | **Quaternion b param** | ` "Quatern": { "b"=<f>,` |
274+
| ` float` | `double` | ` quatern_c ;` | **Quaternion c param** | ` "c": <f>,` |
275+
| ` float` | `double` | ` quatern_d ;` | **Quaternion d param** | ` "d": <f>` |
276+
| | | | | ` },` |
277+
| ` float` | `double` | ` qoffset_x ;` | **Quaternion x shift** | ` "QuaternOffset":{ "x": <f>,` |
278+
| ` float` | `double` | ` qoffset_y ;` | **Quaternion y shift** | ` "y": <f>,` |
279+
| ` float` | `double` | ` qoffset_z ;` | **Quaternion z shift** | ` "z": <f>` |
280+
| | | | | ` },` |
281+
| ` float` | `double` | ` srow_x[4] ;` | **1st row affine transform** | ` "Affine": [ [<f>,<f>,<f>,<f>],` |
282+
| ` float` | `double` | ` srow_y[4] ;` | **2nd row affine transform** | ` [<f>,<f>,<f>,<f>],` |
283+
| ` float` | `double` | ` srow_z[4] ;` | **3rd row affine transform** | ` [<f>,<f>,<f>,<f>]` |
284+
| | | | | ` ],` |
285+
| ` char ` | ` char ` | `intent_name[16];` | **'name' or meaning of data** | ` "Name" : "s",` |
286+
| `char*4` | `char*8` | ` magic[] ;` | **NIFTI-1:"ni1\0" or "n+1\0"** | ` "NIIFormat": "s",` |
287+
| | | `};` | | |
288+
| `struct` | `struct` | `nifti_extender` | `{char extension[4];};` | ` "NIFTIExtension": [<i>,<i>,<i>,<i>],` |
289+
| | | | | ` <...>` |
290+
| | | | | `}` |
291291

292292
Notations from the above table are explained below
293293

@@ -542,6 +542,37 @@ The below table maps the NIFTI data intent codes to the acceptable intent string
542542
|`NIFTI_INTENT_FSL_TOPUP_CUBIC_SPLINE_COEFFICIENTS `| `2016` | `"fsl_topup_cubic_spline_coefficients"` |
543543
|`NIFTI_INTENT_FSL_TOPUP_QUADRATIC_SPLINE_COEFFICIENTS `| `2017` | `"fsl_topup_quadratic_spline_coefficients"`|
544544
|`NIFTI_INTENT_FSL_TOPUP_FIELD `| `2018` | `"fsl_topup_field"` |
545+
| **Used by FSL FNIRT** | | |
546+
|`NIFTI_INTENT_FSL_FNIRT_DISPLACEMENT_FIELD ` | `2006` | `"fsl_fnirt_displacement_field"` |
547+
|`NIFTI_INTENT_FSL_CUBIC_SPLINE_COEFFICIENTS `| `2007` | `"fsl_cubic_spline_coefficients"` |
548+
|`NIFTI_INTENT_FSL_DCT_COEFFICIENTS `| `2008` | `"fsl_dct_coefficients"` |
549+
|`NIFTI_INTENT_FSL_QUADRATIC_SPLINE_COEFFICIENTS `| `2009` | `"fsl_quadratic_spline_coefficients"` |
550+
| **Used by FSL TOPUP** | | |
551+
|`NIFTI_INTENT_FSL_TOPUP_CUBIC_SPLINE_COEFFICIENTS `| `2016` | `"fsl_topup_cubic_spline_coefficients"` |
552+
|`NIFTI_INTENT_FSL_TOPUP_QUADRATIC_SPLINE_COEFFICIENTS `| `2017` | `"fsl_topup_quadratic_spline_coefficients"`|
553+
|`NIFTI_INTENT_FSL_TOPUP_FIELD `| `2018` | `"fsl_topup_field"` |
554+
| **Used by NIRS/fNIRS/DOT** | | |
555+
|`NIFTI_INTENT_NIRS_DELTA_OD `| `4050` | `"nirs_delta_od"` |
556+
|`NIFTI_INTENT_NIRS_DELTA_MEAN_TOF `| `4051` | `"nirs_delta_mean_tof"` |
557+
|`NIFTI_INTENT_NIRS_DELTA_VARIANCE_TOF `| `4052` | `"nirs_delta_variance_tof"` |
558+
|`NIFTI_INTENT_NIRS_DELTA_SKEWNESS_TOF `| `4053` | `"nirs_delta_skewness_tof"` |
559+
|`NIFTI_INTENT_NIRS_MUA `| `4054` | `"nirs_mua"` |
560+
|`NIFTI_INTENT_NIRS_MUSP `| `4055` | `"nirs_musp"` |
561+
|`NIFTI_INTENT_NIRS_HBO `| `4056` | `"nirs_hbo"` |
562+
|`NIFTI_INTENT_NIRS_HBR `| `4057` | `"nirs_hbr"` |
563+
|`NIFTI_INTENT_NIRS_HBT `| `4058` | `"nirs_hbt"` |
564+
|`NIFTI_INTENT_NIRS_H2O `| `4059` | `"nirs_h2o"` |
565+
|`NIFTI_INTENT_NIRS_LIPID `| `4060` | `"nirs_lipid"` |
566+
|`NIFTI_INTENT_NIRS_STO2 `| `4061` | `"nirs_sto2"` |
567+
|`NIFTI_INTENT_NIRS_BFI `| `4062` | `"nirs_bfi"` |
568+
|`NIFTI_INTENT_NIRS_HRF_DELTA_OD `| `4063` | `"nirs_hrf_delta_od"` |
569+
|`NIFTI_INTENT_NIRS_HRF_DELTA_MEAN_TOF `| `4064` | `"nirs_hrf_delta_mean_tof"` |
570+
|`NIFTI_INTENT_NIRS_HRF_DELTA_VARIANCE_TOF `| `4065` | `"nirs_hrf_delta_variance_tof"` |
571+
|`NIFTI_INTENT_NIRS_HRF_DELTA_SKEWNESS_TOF `| `4066` | `"nirs_hrf_delta_skewness_tof"` |
572+
|`NIFTI_INTENT_NIRS_HRF_HBO `| `4067` | `"nirs_hrf_hbo"` |
573+
|`NIFTI_INTENT_NIRS_HRF_HBR `| `4068` | `"nirs_hrf_hbr"` |
574+
|`NIFTI_INTENT_NIRS_HRF_HBT `| `4069` | `"nirs_hrf_hbt"` |
575+
|`NIFTI_INTENT_NIRS_HRF_BFI `| `4070` | `"nirs_hrf_bfi"` |
545576

546577

547578
#### SliceType (NIFTI-1 header: `slice_code`)

0 commit comments

Comments
 (0)