Skip to content
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

Direction/Orientation matrix DICOM vs Nifti #259

Closed
rcorredorj opened this issue Jul 16, 2020 · 3 comments
Closed

Direction/Orientation matrix DICOM vs Nifti #259

rcorredorj opened this issue Jul 16, 2020 · 3 comments

Comments

@rcorredorj
Copy link

Hi guys,

I already posted a related question in the SimpleITK Discourse (https://discourse.itk.org/t/direction-orientation-matrix-dicom-vs-nifti/3289) and NeuroStars (https://neurostars.org/t/direction-orientation-matrix-dicom-vs-nifti/14382).

In short, I'm reading a DICOM series using SimpleITK and I save the itkImage as MHD and Nifti. When I read the MHD and Nifti using a itkImageFileReader, I notice that the direction matrix of the MHD is more similar to the DICOM's. Here I'm talking about numerical differences mainly after the 6th decimal. When I run elastix 4.9 using MHDs and Niftis, I get differences in the results that may affect later steps in our pipelines (I'm using the same parameters described on #89 (comment)).

Already the reply in the ITK discourse is:
"Unfortunately, what you are seeing is a limitation of the nifti file format. You will have to use another format if you require this level of precision."

Is there a way to set properly the precision that is used during the registration in a way that make it less sensitive to small variations in the direction matrix? I already tried to set the DefaultOutputPrecision parameter to a lower value but didn't change.

Thanks in advance!

RaC

@rcorredorj
Copy link
Author

Maybe this post in the ITK discourse is useful for you guys. ANTs was also perceiving issues with Niftis apparently...
https://discourse.itk.org/t/direction-orientation-matrix-dicom-vs-nifti/3289/3

@mstaring
Copy link
Member

Thanks for the report. The ITK is indeed the right place to fix it.

@rcorredorj
Copy link
Author

Thank you. At the end, part of the answer was on the ITK post and in the Neurostars one. However, we decided to run elastix always with specific image properties:

  • Origin to 0, 0 ,0
  • Rounding spacing to 3-4th decimal
  • Set a fixed image orientation
  • Use the "identity" matrix instead of the original direction matrix.
    After the registration procedure is finished we restore the original image properties of the fixed image.
    Probably not the ideal, but helpful to preserve reproducibility.
    Thanks again for your replies.

Cheers,

RaC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants