Is there any chance you can share a dataset that exhibits this issue along with the specific tools and steps that lead to the problem? Maybe you could reproduce the issue using the DWI dataset that is available in Slicer’s SampleData module? Or maybe a scan of a phantom?
There are lots of ways to flip the image data, but correctly transforming the gradients can be tricky and maybe there’s an issue with the converter.
Thanks for the reply. I am attaching my .nrrd file that I have been using in Slicer.
Than I used the following command via Slicer to convert the .nrrd file to nifti. Looks like I cannot upload these types of files. Could I perhaps email them to you?
Thanks for sharing the data - I was able to load it and work with it but wasn’t able to replicate the flipping issue you reported.
The command line I tested (below) was pretty much the same as yours. I tried converting the nrrd you sent and when I loaded the resulting nii file there was no flipping. Then I also downloaded the nii file you provided and again I didn’t see any flipping compared to the nrrd.
Can you doublecheck that when you load the nii and nrrd you uploaded into Slicer they don’t match?
I was using the nightly build from May 29 2017 on a mac. If you were using the 4.6.2 version you might try a more recent nightly although I don’t think this code has changed much.
If you loaded and re-saved the nii file in other software then perhaps other things happened (nifti can be a tricky format which is why we try to avoid using it).
I am noticing that the nrrd file and the nifti file look the same on Slicer. However, when I load the nifti file in the fsl viewer, things look a bit different. It may just be a matter of differences in how Slicer and FSL present the data.
I had initially (not the files I sent you) converted the nrrd file from a type unsigned short to just a short and then converted the file to nifti. In that process, the nifti file was flipped compared to the nrrd file in Slicer. When I left out the conversion to short from unsigned short, I did not see the flipping issue (the files I sent you).
Thanks for doublechecking Emily - there are a lot of issue with coordinates
that can pop up when going between packages and formats. This wiki page
might help but also check the display options for other software (some use
"neurological" convention while Slicer strictly uses "radiological"
convention for display).
I have the same problem discussed in this conversation. Yet, all the the steps I’m taking are done via slicer 5.6.1 (creating lesion map, exporting lesion map into nifti format and viewing the lesion map .nii separately).
Here is the link to my data:
The problem:
When I open the scene / .nrrd file, the lesion appears in the correct location.
Note the lesion is more to the right superiorly and then moves to the middle of the brain in more inferior slices.
I then export the lesion map in a .nii format
when I open the .nii file (in slicer) the lesion is to the left in the more superior slices and moves to the middle in more inferior slices.
@ReNeu - You’ll need to change the permissions on the google drive so that others can access it.
Also, please try the latest versions of Slicer to confirm there is still an issue. If it is, please describe exactly what steps you take (add screenshots to clarify as needed).
Thanks for sharing - can you do one more test to see if you see this issue when saving to nrrd?
If you’ve looked you probably saw that the nifti format is not very popular among Slicer developers due to a long history of issues (the standard itself defines multiple, possibly contradictory, ways of encoding geometry information and many other software packages have inconsistent or buggy ways of interpreting this data, etc).
So, while we’ll probably be able to explain why this data doesn’t work, it’s likely something intrinsic to nifti. Or it could be a regression in the Slicer/ITK nifti pipeline which has been edited in the last few years to try to better handle issues with the format. Knowing if nrrd works will help whoever does the next level investigation.