-
-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set better semantics of SetImageIOMetadataFromNIfTI(). It previously populates the metadata dictionary with data from the ‘nifti_1_header’, which is literally the first 348 bytes of the file. This patch populateit from ‘nifti_image’ instead, which is largely the same, but after some processing by nifti_convert_nhdr2nim(). For example, line 3765 forces the ‘qform_code’ field to 0 for Analyze 7.5 files, since that offset in the header had a different meaning pre-NIfTI. By using the literal header fields, SetImageIOMetadataFromNIfTI() is currently providing garbage sform and qform values for Analyze files. Which basically uses the data from ‘nifti_image’ instead. A handful of fields need a little manipulation to get back in the same format. This basically did what nifti_convert_nim2nhdr() does. As a bonus, this removes extra file i/o by eliminating the nifti_read_header() call. There doesn’t seem to be a good way to query if the file read was Analyze 7.5 or NIfTI. This is needed to distinguish because apps need to provide warning when Analyze is opened (to ween users off this format). This patch adds the ‘nifti_type’ field to the metadata to make that info available. Change-Id: I90c5ce48fcc5b6a4909be4030c0e32e4e9212b9d
- Loading branch information
1 parent
b58b590
commit f38b1dd
Showing
1 changed file
with
125 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters