Nifiti or mif?

Dear mrtrix experts,

As described in the recommended HCP pipeline https://mrtrix.readthedocs.io/en/latest/quantitative_structural_connectivity/ismrm_hcp_tutorial.html, we need to transform the nifiti data to mif format firstly, as

mrconvert data.nii.gz DWI.mif -fslgrad bvecs bvals -datatype float32 -strides 0,0,0,1

was this step necessary? Or I can use nifti data directly to process the rest step, such as dwi2response ,dwi2fod to get fod.mif?

No, it’s not strictly necessary. You can always use your nifti images, but you’ll also need to supply the DW encoding information to every command that requires it, using the -fslgrad bvecs bvals option. You’ll also need to keep track of which bvals+bvecs files are the right ones, considering some processing steps can alter the directions. Using the .mif format ensures that the DW encoding resides directly with the data, and is kept consistent with it at all times, so you don’t have to keep track of this.

Thanks for your reply! I have another question, how to determine the datatype? Is float32 suitable for all raw DWI data, as my nifti datatype is int16.

Well, uint16 is generally what comes off the scanner, so there’s little point in changing the datatype from that at that point, it’ll just take up more space. But as soon as any processing is done on it that generates a floating-point output, then using an integer type will lead to some loss of precision – and most processing steps produce floating point output (including dwidenoise, mrdegibbs, eddy and by extension dwipreproc, etc). Basically, as soon as anything non-trivial has been done to your raw DWI, it’s best to store them as float32.