Open effigies opened 5 years ago
Guess I forgot to finish this up, and the "Edit" button isn't working for me right now.
It would be good to validate consistency at least insofar as the NIfTI metadata should not directly contradict the JSON metadata. In many cases, the NIfTI header will have \x00
bytes in these fields, so that should probably not fail the check. Additionally, some values permissible in the JSON metadata may not be representable in NIfTI (e.g., the polarity of the phase encoding direction is not specifiable in NIfTI), so we should be aware of that in any checks proposed.
Based on a discussion in: https://github.com/bids-standard/bids-specification/issues/138
The JSON metadata fields
PhaseEncodingDirection
,SliceEncodingDirection
have corresponding values in the NIfTI header fielddim_info
:"PhaseEncodingDirection": "i[-]"
(dim_info >> 2) & 0x03 == 1
"PhaseEncodingDirection": "j[-]"
(dim_info >> 2) & 0x03 == 2
"PhaseEncodingDirection": "k[-]"
(dim_info >> 2) & 0x03 == 3
"SliceEncodingDirection": "i[-]"
(dim_info >> 4) & 0x03 == 1
"SliceEncodingDirection": "j[-]"
(dim_info >> 4) & 0x03 == 2
"SliceEncodingDirection": "k[-]"
(dim_info >> 4) & 0x03 == 3
Additionally,
SliceTiming
can be consistent or inconsistent with the following fields: