Issue with slice dimension ordering in MRtrix vs FSL

Good morning,

I’m encountering an issue with some fetal MRI sequences.

When inspecting the nifti file with mrinfo, the slice dimension does not appear as the third axis. In this case, it is the first axis, but in other instances, it is the second.

However, when loading the same nifti file in FSL, the dimensions are displayed correctly.

This discrepancy causes problems downstream, as dwifslpreproc fails with the following error:

[ERROR] Cannot use slice timing information in image header for slice-to-volume correction: number of entries (48) does not match number of slices (128).

Has anyone encountered a similar issue? Any idea what could cause this behavior and how to fix it?

Thanks in advance for your help!

Hi Mattia,
Welcome to the forum!

This appears to be a strides issue.

Specifying strides when converting between file formats may help. For example, when creating the dwi.mif file, the following command can be used:

mrconvert <dwi.nii> -strides <dwi.nii> -fslgrad <bvec> <bval> dwi.mif

This will use the strides from dwi.nii as a template for dwi.mif, and mrinfo should return dimensions of 128x128x48x13 for the updated dwi.mif.

Hope this helps!

Cheers,
Arkiev

Hello Arkiev,

Thanks for the reply!

I tried to used the stride option during conversion as you mentioned with -strides -1,2,3,4. However mrinfo still display the axes in the “wrong” order.


Image name: “dwi.mif”


Dimensions: 48 x 128 x 128 x 13
Voxel size: 2 x 2 x 2 x 7.1
Data strides: [ -1 2 3 4 ]
Format: MRtrix

FSL on the other hand now shows them in the same order as mrtrix:

Number of dimensions 4D
dim1 48
dim2 128
dim3 128
dim4 13

Hi Mattia,

My mistake, I think I misunderstood the issue…

I’m not too experienced with strides, but it might be worth giving this a go…
mrconvert <dwi.nii> -strides 2,3,-1,4 -fslgrad <bvec> <bval> dwi.mif

Cheers,
Arkiev

Hello,

I tried but nothing changed.

I’m going to use eddy directly instead of dwifslpreproc since I’m not getting any errors that way.

Thank you anyway for the help,
Mattia