-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DWI metadata fixes for master #3011
base: master
Are you sure you want to change the base?
Conversation
This commit is a manual replication of the contents of #2917, but targeting 3.0.x.
Do not convert contents of text JSON file to integers / floats then convert back to strings for storage in a KeyValues instance; instead just use the string representation. This fixes an issue whereby if a JSON is generated from an image, but that image also retains the same metadata fields in its own header, and then the JSON contents are re-imported, the two values for floating-point metadata elements could differ due to floating-point imprecision, and this would lead to the field being reset to the value "variable".
In order for a bvecs file to be properly read in, the information about how the image was transformed upon image load needs to be available. However if an attempt is made to perform such a read based on a Header that it has itself been constructed from an arbitrary ImageType, this information is lost. Therefore, reading from a bvecs file needs to be done using the Header class in which the corresponding NIfTI was originally opened. In the process, some functionalities of the tracking of that transformation on image load have been made more explicit. Also fixes some syntax errors relating to the manual back-porting of #2917 in #3011.
Encountered a trap here that simply checking metadata didn't catch, but shows up when testing all commands. Reading Prior to a6a4a87 (Edit: replaced with 2be257c), this compiled fine specifically because of a non-explicit templated I decided against the option of integrating this internal realignment information into the |
In order for a bvecs file to be properly read in, the information about how the image was transformed upon image load needs to be available. However if an attempt is made to perform such a read based on a Header that it has itself been constructed from an arbitrary ImageType, this information is lost. Therefore, reading from a bvecs file needs to be done using the Header class in which the corresponding NIfTI was originally opened. In the process, some functionalities of the tracking of that transformation on image load have been made more explicit. Also fixes some syntax errors relating to the manual back-porting of #2917 in #3011.
a6a4a87
to
178f1cc
Compare
In order for a bvecs file to be properly read in, the information about how the image was transformed upon image load needs to be available. However if an attempt is made to perform such a read based on a Header that it has itself been constructed from an arbitrary ImageType, this information is lost. Therefore, reading from a bvecs file needs to be done using the Header class in which the corresponding NIfTI was originally opened. In the process, some functionalities of the tracking of that transformation on image load have been made more explicit. Also fixes some syntax errors relating to the manual back-porting of #2917 in #3011.
178f1cc
to
2be257c
Compare
Re-implementation of #2917.
Closes #2477.
Closes #2998.
Supersedes #2900.
Supersedes #2912.
As mentioned in #2917, these changes are all ultimately bug fixes, so should have been implemented on
master
from the outset. But because of the mass reformatting changes ondev
, I had to transfer most of this changeset manually.The tool over at https://github.com/Lestropie/DWI_metadata is now containerised, and currently configured to download and test this branch. It shows that with these changes, the only tests not passing are those that take sagittal DWIs from
dcm2niix
as input, asdcm2niix
gets the polarity of itsbvecs
incorrect in those data.