Nifti option fod2fixel

Hi all,

I tried to have a look at the fixel data in nifti format. I used the -nii option when segmenting the fixels but when I try to open the nifti files it gives a error when trying to read the image header. I suppose it has something the do with the way mrtrix stores the fixel files…
Anyone who knows how I can open the nifti files in a viewer?

Best,

Lotte

Hi,

What do you use to open it and what is the error?

The image is likely a NIfTI-2 image, not every version/software is able to read those. However, current MRtrix3 commands should be able to handle this data. If not, what was the command you used to generate the data?

Hi,

I generated the images via the nifti option in fod2fixel and tried it as well using mrconvert which didn’t work but I guess the nifti option just uses mrconvert so no surprise there. I tried to open the images using Mipav and MRIcron.

The index image is a nifti-1 and the directions image a nifti-2. I am able to open other nifti-1 images that I converted via mrconvert without any problems using the aforementioned programs. If I try opening the directions images Mipav says ‘the header file is not in NIfTi format [the first 4 bytes do not have the value 348]’ and MRIcron says ‘nifti header file error’. I can open the index file but only the second volume of the 4th dimension (index of first fixel) (not the first) and only in mipav. MRIcron says ‘unable to read this image format 768’.

MRIcron supposedly supports or is going to support NIfTI-2, mipav mentions it in its NIfTI documentation. You might want to check for the latest version of these packages.

If your software can read NIfTI-2 data (test data here) but not that generated with MRtrix3, the fault might be with MRtrix3’s NIfTI-2 writer or due to those software packages not supporting all NIfTI-2 features. If you find that the NIfTI-2 test data works in these tools but not the MRtrix3-generated NIfTI-2 data, please let us know and it might be worth contacting the developers of these tools as well.

In any case, I’d suggest you use mrview or other MRtrix3 tools for your FBA analysis and visualisation and continue your analysis after that with non-MRtrix3 tools if needed. If you want to use the fixel files to develop new analysis methods, I’d suggest you try to read NIfTI-2 files with for instance nibabel or use .mif files and our Matlab bindings (matlab/read_mrtrix.m) or directly our C++ API.

It’s worth explaining a few things here: MRtrix3 will by default store data in NIfTI-1 format, and will only resort to NIfTI-2 if it hits the limitations of the NIfTI-1 standard. For our purposes, the main limitation of NIfTI-1 is the 16-bit limit on image dimensions, which limits the size of the dataset along any axis to a maximum of 65,535. This applies to any command in MRtrix (whether fod2fixel or mrconvert): if the data was produced in NIfTI-2 format by fod2fixel, trying to convert it via mrconvert will produce the same thing.

Second, like @maxpietsch says, not all other software packages will support NIfTI-2 yet. The Mipav error message strongly suggests that it only supports the NIfTI-1 format (the size of the header is 348 bytes for that version of the standard, should be 540 for NIfTI-2). The MRIcron error is less clear-cut, but I wouldn’t be surprised if whatever version you’re running is also not yet capable to handling NIfTI-2.

Also bear in mind that it’s unlikely to make sense to display these fixel images in other packages: all images other than the index have funny dimensions: very very long along x, and 1 along all other axes (apart from the directions files which will have size 3 along the y axis). My guess is most viewers will struggle to display something so strange…

Thanks for the explanation!
I’ll just stick with viewing mif files in mrview then cause that indeed makes a lot more sense.