Mrconvert issue between Nifti and mif

Also, Nifti file generated using mrconvert is not readable in Mango. The image is generated with below command,
mrconvert dwi_den_preproc_unbiased.mif test.nii

and it is not readable with Mango with TR=NaN error.r.
It seems something goes wrong between .mif and .nifti.
Is there any tool can convert each other to compare?

(Sorry the memory leak issue is my fault… partially processed .tck file caused errors)

1 Like

Hi @iPsych,

While I’m not familiar with the Mango software, it looks like it has a strict requirement that TR be finite. The NIfTI format doesn’t actually have a field dedicated to TR; instead, the “voxel size” field extends to all dimensions, not just the three spatial dimensions, and many softwares embed the value of TR within the “voxel size” for the fourth axis (i.e. across volumes). But for any modality other than fMRI that produces > 3D images, this doesn’t actually make sense; we used to write NaN values to reflect that.

This behaviour was however changed in this commit and relevant Pull Request (very long discussion in the latter): we now write a “TR” of 1 in NIfTIs in order to prevent FSL’s fslview from crashing when reading NIfTIs generated by MRtrix3. That code change was part of the 3.0.0 production release. So I am guessing that you are using an out-of-date version of MRtrix3?

Outside of updating MRtrix3, it might be possible to edit the image header in place using something like FSL’s fsledithd. You could also report to the Mango developers that in principle their software should be capable of reading images that do not contain TR information; but that’s only my position.

Cheers
Rob