Error with dwipreproc

Hello Mrtrixers, I have problems with preproc command. It shows me always following error message:

Error: unrecognized arguments: -pe_dir
Usage: dwipreproc [ options ] pe_dir input output
Usage: (Run dwipreproc -help for more information)

I typed following command: dwipreproc -rpe_none -fslgrad bvec.bvec bval.bval -export_grad_fsl bvec_new.bvec bval_new.bval -pe_dir AP dwi.nii dwi_preprocessed.nii

I use mrtrix3 and fsl, python are up to date.
I checked already the Forum for comparable error messages but could not get a solution.
Thank you for any kind of help.
Best
Max

Dear @Max_Wichmann,

could you try your command without -pe_dir? i.e.

dwipreproc -rpe_none -fslgrad bvec.bvec bval.bval -export_grad_fsl bvec_new.bvec bval_new.bval AP dwi.nii dwi_preprocessed.nii

According to the usage, phase-encoding direction is not specified using -pe_dir option, but as a stand-alone command line argument.

Max

It looks to me like you’re using an out-of-date MRtrix3 installation. From the 3.0_RC1 version tag, the phase-encoding direction is optionally provided as a command-line option; previously, it was a compulsory argument. This is why the script complains that it doesn’t recognise the option -pe_dir, but in the example usage, “pe_dir” is specified as the first compulsory option.

If you’ve updated MRtrix3 but are still encountering this problem, you need to make sure that all traces of the previous installation are gone, and that you’re not unwittingly invoking another version of MRtrix3 installed elsewhere on your system (use “which dwipreproc” to check).

Cheers
Rob

Dear @Antonin_Skoch, dear @rsmith, thank you for your quick reply and help.

I first tried your suggestion Antonin and it works, after that I wanted to try option 2 (Reversed phase encode b=0 pair(s)) but an error occurs again. So I guess I have to reinstall mrtrix, like you said @rsmith?

first I did it the way (merge the b0 images via mrcat) it supposed to do in the documentation. But then it said

Error: argument -rpe_pair: expected 2 arguments
Usage: dwipreproc [ options ] pe_dir input output
Usage: (Run dwipreproc -help for more information)

After that I gave it both different single phase encoding images
Here is my command line code:

dwipreproc -rpe_pair blipup.nii blipdown.nii -se_epi -fslgrad bvec.bvec bval.bval -export_grad_fsl bvec_new.bvec bval_new.bval AP dwi.nii dwi_preprocessed.nii

Error: unrecognized arguments: -se_epi
Usage: dwipreproc [ options ] pe_dir input output
Usage: (Run dwipreproc -help for more information)

Thank you again
Best
Max Wichmann

Max

If you are running an out-of-date MRtrix3, but referring to the online documentation (which by default refers to the most up-to-date code version), you will encounter issues due to the changes that have been made to the command-line interface to the script. For instance: If you run: “dwipreproc -help”, and compare that information with the online documentation, you should see noticeable differences in the example usage and the available command-line options. This also means that the new dedicated dwipreproc tutorial page - which is designed specifically to highlight the changes from previous MRtrix3 versions to the 3.0_RC1 update - will not be applicable for your code version.

If you are able to update your MRtrix3 installation (it’s really easy), that will most likely sort out the confusion. If however you are restricted to using the existing installation, it will be necessary to rely on the command / script help pages, and/or the documentation that corresponds to the version that you are using (e.g. here is the documentation for version 0.3.15).

Rob

Thank you so much! I will try to update.

Thank you both

Cheers
Max

Hi,

I’m writing to ask about the dwipreproc the -pe_dir input. (-pe_dir is needed if I don’t have the header information in the up to date MRtrix3 version)

dwipreproc -rpe_none -fslgrad bvecs bvals -export_grad_fsl bvecs_Eddy bvals_Eddy -pe_dir j -readout_time 0.030115 dTI_denoised.nii DTI_Eddy.nii -force

I used the notation of i, j an k. (which I think it means 1st, 2nd and 3rd dimension of the volume, am I right?) But it takes forever to run the code. (More than 12 hours, does it mean that I miss some parameters and make it unable to converge?)

Thanks a lot for your help. Sincerely,

Yixin

This might be due to there being lots of b=0 images, which topup takes ages to process – see this recent thread on this issue.