[ERROR] If using -rpe_all option, input image must contain an even number of volumes

Hello,

I’m having trouble running dwipreproc and am trying to figure out if there is a way around it or if it is a problem with my data.

I have the following files:
(Collected A>>P)
hardi48.nii.gz
hardi48.bval
hardi48.bvec

(Collected P>>A)
hardi49.nii.gz
hardi49.bval
hardi49.bvec

At first I tried running mrcat with the nifti files, however in the dwipreproc command I received an error saying no gradient table found.

I’ve since combined all my files for each scan in to a single hardi48.mif and hardi49.mif so that the gradient information is included, and then combined these two in to a single all_hardi.mif using mrcat:
mrcat all_hardi48.mif all_hardi49.mif all_hardi.mif -axis 3

I use the following command to start:
dwipreproc all_hardi.mif preprocessed.mif -pe_dir AP -rpe_all

But run in to this error:
Command: dirstat dwi.mif -output asym
dwipreproc: [WARNING] sampling of b=1000 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " … --slm=linear … "
dwipreproc: [WARNING] sampling of b=2000 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " … --slm=linear … "
dwipreproc: [WARNING] sampling of b=3000 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " … --slm=linear … "
dwipreproc: [ERROR] If using -rpe_all option, input image must contain an even number of volumes

Is this a problem with the way I’ve set up my data, or could it be due to the data itself, with one scan using 48 diffusion directions and the other using 49?

Any help is appreciated!

Hi,

This is the reason, to use -rpe_all, do you need the same number of volumes in both acquisitions. You could try to remove one of the volumes of your 49 acquisition, matching the one of 48, making the bvalues, bvecs and images equal (just with the difference of the phase encoding direction). Other option is to concatenate a couple of B0s (one from each image) and use the option -rpe_pair.

Best regards,

Manuel

1 Like

Manuel is spot on: the -rpe_all option expects that each image is paired with its opposite PE version, so you should have two datasets that are identical in all respects, including number of volumes, but also bvecs/bvals, resolution, etc. – the only difference should be the PE direction.

Yes, it’s not just a matter of having “the same number of volumes” with each reversed phase encoding direction; that’s just a sanity check that can be applied trivially in order to determine whether or not the DWI data that have been provided to the script are appropriate for use with the -rpe_all option.

When you concatenate the data and use the -rpe_all option, for each of the first 48 image volumes, there needs to be a corresponding volume somewhere in the last 48 image volumes for which the diffusion sensitisation direction is equivalent but the direction of phase encoding is the opposite of what you have specified with the -pe_dir option. If this is not the case, then the script is not able to perform explicit volume recombination of all provided image volumes, which is generally the motivation behind acquiring all DWIs with reversed phase encoding.