-
Notifications
You must be signed in to change notification settings - Fork 25
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
mnc2nii label creates wrong affine matrix when direction_cosines is not specified #99
Comments
FYI it seems that |
Hi, Can you post the mincheader outputs of a good vs bad file? |
THe question about this bug is twofold:
This could be classified as an inormalize bug depending on 1. |
Good file header (out.mnc)
bad file header (out_ndc.mnc)
|
From here: If these attributes are not present, they are assumed to have the following default values: For xspace: (1, 0, 0), for yspace: (0, 1, 0), and for zspace: (0, 0, 1)" So I believe the issue is 2, a corner case in mnc2nii |
Additionally, I believe other programs besides inormalize do this, although I haven't tracked them down. |
Thanks, my next stop was to check the file format docs. We need to determine now if the problem is in mnc2nii or in |
Also, I've been bitten by this bug, here's my report #69 You figured out the root cause in terms of the difference in files :) |
If you're interested, here's my temporary workaround to set the default direction_cosine |
Working on this today, some updates:
So there are two possible solutions here
|
miattget is low level call it's not supposed to know about default values of some attributes. |
Thanks @vfonov I dug through the code and came to the same conclusion. I also found that mnc2nii uses minc1 API so ordering control isn't available. As such I've been digging through the logic to see how I can fix nii2mnc |
Fixed. |
The files here example.zip are the exact same, except out_ndc.mnc does not have the direction cosines specified. The spec says that the direction cosines should be assumed to be [1, 0, 0], [0, 1, 0], and [0, 0, 1] if they are not present. These assumed values are the same as in out.mnc, so the two files should have the same coordinate-world transform. However, mnc2nii treats them differently, reversing the axis order (RAS vs SAR orientation). This was tested with minc toolkit 1.9.17. I tried to build a newer version of minc-tools but couldn't get it to compile.
The text was updated successfully, but these errors were encountered: