-
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
nii2mnc miscalculates minc start values #32
Comments
Can you submit a test case (e.g. a NII file) that exhibits the problem? |
example.zip
But if we apply nii2mnc to the Nifti file inside the zip archive, the resulting Minc file has these dimensions:
I can produce more examples if needed. |
@jesperfr You might want to try to code from the develop branch. I just tried your example files with a build from the develop branch, and it seems more correct to me. |
I have just tried the develop branch of nii2mcn:
But it still give exactly the same start values as the master branch, which clearly are different than for the Minc file created directly from the Dicom files:
Which differs from the start values from the Minc file generated directly from Dicom (which is placed correct):
|
@rdvincent Any progress on this issue. I have similar issues with nii2mnc. |
@fristed No, I think I need a better test case to reproduce the exact problem. As far as I have been able to tell, we correctly convert the NIfTI header's transform. If you have a specific dataset that exhibits this issue I'd be happy to check it out. |
sagittal.zip Each zip file contains 3 files: Please contact me, if you need more information or examples. |
@rdvincent Can you reproduce the problem from the images uploaded by @jesperfr ? |
@jesperfr It would be great if I could get the original DICOM for at least one of these examples. |
@rdvincent These acquisitions were made on a patient, so the complete dataset can not be made available. Would the first and last Dicom slice be enough? They should provide enough spatial information to produce the image geometry and orientation. |
That should be enough. |
@rdvincent That sounds fine! |
@rdvincent Did you have time to test the example? |
@rdvincent I have another test case attached. This is a nifti file with a binary mask. When I do nii2mnc and mnc2nii the image is reshaped. Here are the XYZ dimensions: Original: 240 256 176 As you can see the dimensions are consistent after the first conversion, however, the dimension order changes. I use a freshly updated version of the develop branch from minc-toolkit-v2 |
@fristed Are all of the files correct in the sense that they all have the same geometry in world space? As of now, mnc2nii always reorders dimensions to yield an nii file with ZYX organization. This was done to make the conversion simpler, since for files with vector or time dimensions we must reorder things to be compatible with NIfTI (NIfTI supports arbitrary ordering of spatial dimensions, but enforces specific ordering of nonspatial dimensions relative to the spatial dimensions. MINC doesn't allows you to put a nonspatial dimension anywhere you like. My plan is to change this to preserve the organization of the hyperslab if possible, but it hasn't made it into the code base yet. The original bug had to do with an error in the actual computation of the voxel-to-world transform - I think that is now fixed. |
Hi Robert, 2016-11-21 19:24 GMT+01:00 Robert D Vincent notifications@github.com:
|
@jesperfr It should build in minc-toolkit-v2, but you should take care to check out the develop branch of all projects and subprojects. |
@rdvincent Yes, they do align in world space. I guess a simple resampling will have to do, though it would have been nice to be able to convert back and forth in a consistent way. |
@fristed I completely understand. I intend to add a special case to preserve the dimension ordering for spatial-only volumes, but I just haven't had time to implement it yet. |
@rdvincent No worries. We all appreciate the hard work you put into developing and maintaining MINC 👍 |
I made a new tag ( release-1.9.14) for minc-toolkit-v2 two weeks ago that contains all the updated subprojects as of then. |
debs for trusty, xenial and debian jessie available at: |
Hi Robert,
Thanks for your work!!
I downloaded the developer branch 2 days ago and have just finished testing
the nii2mnc conversion. All the cases that failed in March now completes
correctly.
Great work!
Cheers,
Jesper
2016-11-22 15:26 GMT+01:00 Robert D Vincent <notifications@github.com>:
… @fristed <https://github.com/fristed> I completely understand. I intend
to add a special case to preserve the dimension ordering for spatial-only
volumes, but I just haven't had time to implement it yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQ9zpCpBLGY8ZrU2ND5xXZTgzBAZDei2ks5rAvuFgaJpZM4HvRj8>
.
|
@rdvincent While the fixes to nii2mnc seemed to work on all our test data, we have now discovered a dataset where mnc2nii produces a nifti file with swapped orientations. |
Fixed |
We need nii2mnc to convert Nifti files for processing in the Minc file format. But for about half of the files, the start values are miscalculated. It seems that the image orientation is correct (the cosines are ok), but the start values are wrong.
We are running on Ubuntu Server 64-bit 14.04 LTS and the code is from master.
We have verified that the Nifti files are placed correct compared to the input Dicom files. If we use the dcm2mnc program, the minc files are OK!
We have tested on a number of Nifti files with Axial, Sagittal and Coronal orientation, and the conversion seems to fails primarily on Sagittal and Coronal oriented Nifti files.
The text was updated successfully, but these errors were encountered: