Nifti files (*.nii) in ExploreDTI With the nifti file format one can store information about the data in the header, such as properties of the coordinate system (location of origin, angulation of axes, etc.) and data format (type, dimensions, etc.), among others. When reading nifti files with ExploreDTI, most of that information is discarded. Only voxel size, image dimensions, and data type are required as ExploreDTI has its own image based coordinate 1 system . To avoid any accidental axis flipping (e.g., interchanging left and right) and/or permutations (e.g., front-to2 back axis becomes the left-right axis) when using nifti files with ExploreDTI , I strongly recommend to make your nifti files “ExploreDTI compatible” at the very beginning, that is, before using any tools that use nifti files for input.
So how can I check whether converting to *.mat was performed correctly? First, Let me give an example where the conversion from *.nii (with associated *.txt b-matrix file) to *.mat (using menu item ‘Calculate DTI *.mat file’ ‘Convert raw data to DTI *.mat’) went fine. Consider the image below (the original dicom data were converted to nifti format – btw, I can recommend the “dcm2nii” tool to do this step) shown with the MRIcroN viewer:
At this point, I can be sure nothing went wrong in terms of axes being flipped or permuted with the dcm2nii tool: notice that the vitamin pill (signal in yellow circle), which was attached on the right side of 3 the brain, is still showing on the correct (right) side of the brain . From now on, let’s assume that MRIcroN is always correctly showing left/right sides (you could use any trusted dicom viewer or even the scanner console window directly to figure out left/right sides, but for simplicity, we’ll use MRIcroN for now).
1
Admittedly, the ExploreDTI coordinate system is not really a conventional one… but that’s for historic reasons! Note that this behavior may be different across different versions of ExploreDTI, so check this first when using a new release! 3 To add some confusion, this is the left side in the image due to the radiological convention (notice the blue ‘R’). 2
Now let’s convert the *.nii file (with *.txt b-matrix file) to a *.mat file:
And the result looks the same (the default view in ExploreDTI is also the radiological convention):
If you can’t get your head around radiological/neurological conventions, simply rotate the view in ExploreDTI and you can see the 3D representation of the data… you can now definitely tell that things are correct (see below)!
Top of brain
Must be right side of brain
Front of brain
So in this example, all is well and continue with whatever you want to do next ;-)!
In this second example, however, converting to the *.mat file introduces a left-right flip. The *.nii file opened with MRIcroN looks like:
But after loading the data into ExploreDTI, we can see from the axial view below that it is left-right flipped:
So how can I correct for axis flips/permutations? The quickest way to fix for unwanted axis flips/permutations is to simply adjust the setting during the conversion to a *.mat file. For instance, in the example above, where there was a left-right flip, adjust “[AP RL IS]” for the “Flip spatial orientations”:
To “[AP LR IS]”:
Using the same data of “example 2” from above, the result after loading the data into ExploreDTI is now correct:
The quick-fix shown above works fine for the DWI *.nii files, but if you have other data, such as T1 images (in *.nii format), you really want to make sure that these data will not be flipped either when used with ExploreDTI (e.g., while correcting for EPI distortions). The more general “fix” can be achieved with the plugin ‘Flip/permute dimension(s) of 3D/4D *.nii file(s)’, which was also briefly explained previously on the forum here:
To fix, for instance, a left-right flip of a data set, then simply change [0 0 0] to [0 1 0]:
FYI, any nifti file created with any tool in ExploreDTI will contain the header note: “Created with ExploreDTI”. In MRIcroN, go to:
With such an “ExploreDTI compatible” *.nii file, you are always sure that no left-right flipping (or any other flipping/permutation of axes) will occur when used with ExploreDTI!