Getting flipped image on using DWIConvert to convert nifti to nhdr/nrrd

Operating system: Ubuntu 18.04
Slicer version: 4.10.2
Expected behavior: Orientation of nifti image is same as nhdr/nrrd
Actual behavior: Image is getting rotated and there is shift in dimensions of 4D data volume.

Dear Slicer Experts

I want to convert some Nifti DTI volumes to nhdr/nrrd format using available .bval and .bvec files. Currently, I am using DWIConvert from Slicer modules and have selected FSLtoNrrd conversion option.

Link to data :
I am using 64 directions b=3000 hardi volume of SNR 30 with available bval and bvec files.

Problems I am facing:

  1. bvectors are getting negated in nhdr file (I am not sure if some parameter is set in nhdr too compensate for that).
  2. Original data size is as 50x50x50x65. After conversion to Nhdr I am getting a size of 65x50x50x50.
    Apart from this visible shift in dimension (65 from dim-4 to dim-1), there is also change in orientation along other three dimensions.

I am using python’s nibabel and pynrrd libraries to read nifti and nrrd formats but the two image volumes I am getting are not in same orientation. I need nrrd data to allign with the orientation of original nifti image volume.

I basically want to bypass this reorientation by slicer while loading data. Can you please help me with this?

Thanks in advance.

Hi @Ashutosh_Vaish -

It sounds like a good first step would be to try dcm2niix, which is newer than DWIConvert and the most recent versions include nifti to nrrd dwi conversions. You can get it as a Slicer extension but probably you want the command line version with all the options exposed. Let us know how that goes.


Hi Steve

Thank you for your response. I looked at the dcm2niix Git-repo that you redirected me to and in the list of tools that utilize dcm2niix, I found another Git-repo : , specifically for nifti-nhdr conversion. I am able to write an .nhdr for my nifti without any orientation change using this script.

Thank you for your help. I was really struggling for where to look at.

1 Like