Error 'eddy_cuda6.5' not executed during the stage of dwipreproc

Hi everyone,
I’ve been met an issue with dwipreproc while processing a diffusion MRI data. Not only does eddy_cuda fail for processing, but eddy_cuda6.5 gives me an empty error. Has anyone encountered the same problem? My personal computer system is macOS 10.14.6 on Macbook Pro 2015, with FSL version 5.0.9, and installed the newest version of MRtrix3 a month ago.

The command I’ve been trying to use is:

dwipreproc dwi_denoised_unringed.mif dwi_denoised_unringed_preproc.mif -rpe_none -pe_dir AP -eddy_options "--slm=linear "

Here’s the data information:

Image:               "dwi_denoised_unringed.mif"
  Dimensions:        256 x 256 x 47 x 35
  Voxel size:        0.9375 x 0.9375 x 3 x ?
  Data strides:      [ -2 -3 4 1 ]
  Format:            MRtrix
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1          -0           0      -119.5
                               -0      0.9992     0.04092      -100.1
                               -0    -0.04092      0.9992      -48.26
  EchoTime:          0.0876
  FlipAngle:         90
  RepetitionTime:    13
  command_history:   dwidenoise "dwi" "dwi_denoised.mif"  (version=cac05b6f)
                     mrdegibbs "dwi_denoised.mif" "dwi_denoised_unringed.mif" "-axes" "0,1"  (version=cac05b6f)
  comments:          LU HUI ZHEN (MR1225001) [MR] Ax DTI
                     DOS: 25/12/2016 20:29:44
  dw_scheme:         0,0,0,0
  [35 entries]       0,0,0,0
  mrtrix_version:    cac05b6f

Here’s the error message:

Command:  eddy_cuda6.5 --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --slm=linear --out=dwi_post_eddy
dwipreproc: [WARNING] 'eddy_cuda6.5' not executed ("[Errno 13] Permission denied")
Traceback (most recent call last):
  File "/usr/local/bin/dwipreproc", line 844, in <module>
    (eddy_stdout, eddy_stderr) = run.command(eddy_cuda_cmd + ' ' + eddy_all_options, not eddy_openmp_cmd)
  File "/usr/local/Cellar/mrtrix3/3.0_RC3-166-gcac05b6f/lib/mrtrix3/", line 186, in command
    if tempfiles[index][0] is not None:
IndexError: list index out of range

Here is the temporary output fold:

In addition, how can I get the infomation of the phase encoding direction of the acquisition? I chose the option “-pe_dir AP” which is relatively commonly used for acquiring human data. But I am not so sure.

Thank you for any tips in advance.

Jie Zhang

@jdtournier Could you please help me?

@rsmith Have you met this problem before? Thank you!

It looks like a permission error with your eddy_cuda6.5 executable not with MRtrix3.

What is the ouput of

ls -la `which eddy_cuda6.5` 

This should fix the rights for that executable (assuming you trust that file):

sudo chmod 755 `which eddy_cuda6.5`

Like @maxpietsch says: this looks like an issue with your installation of eddy_cuda6.5. What happens if you try to invoke it directly outside of dwipreproc?

If it’s not automatically extracted from the DICOM data (which looks likely given your mrinfo output shows no hint of the PE direction), then you’d need to know what it was. You can figure out by looking at the images though: if the distortions are symmetric (assuming a transverse/axial acquisition), then it’s likely AP or PA. It they’re strongly asymmetric, then it’s likely LR or RL (very rare, but used in e.g. HCP). It doesn’t really matter whether you specify AP or PA as far as the algorithm is concerned: it’ll just assume the opposite field, but correct the distortions as expected nonetheless.

Thank you very much! I consider I should update my FSL version 5.0.9 to 6.0, since eddy is modified in this version.

So kind of you to provide so much beneficial infomation to me.

If my dwipreproc command is below without -eddy_options " … --slm=linear … ":

dwipreproc dwi_denoised_unringed.mif dwi_denoised_unringed_preproc.mif -rpe_none -pe_dir AP

there would be a warning indicating moderately asymmetric:

[WARNING] sampling of b=1000 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " ... --slm=linear ... "

The complete code is:

dwipreproc dwi_denoised_unringed.mif dwi_denoised_unringed_preproc.mif -rpe_none -pe_dir AP


dwipreproc: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the help page (-help option) for more information.


dwipreproc: Generated temporary directory: /Users/Jallyson/study/006_control/dwipreproc-tmp-Y5940F/

Command: mrconvert /Users/Jallyson/study/006_control/dwi_denoised_unringed.mif /Users/Jallyson/study/006_control/dwipreproc-tmp-Y5940F/dwi.mif

dwipreproc: Changing to temporary directory (/Users/Jallyson/study/006_control/dwipreproc-tmp-Y5940F/)

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: Total readout time not provided at command-line; assuming sane default of 0.1

Command: mrinfo dwi.mif -export_grad_mrtrix grad.b

Command: dwi2mask dwi.mif - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -strides -1,+2,+3

Command: mrconvert dwi.mif -import_pe_table dwi_manual_pe_scheme.txt eddy_in.nii -strides -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt

Command: eddy_cuda6.5 --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --out=dwi_post_eddy

From the code above, I wonder if distortion correction is moderately asymmetric rather “strongly asymmetric” you mentioned, so can I use the option “-pe_dir AP”? Or, is there any better way to know the degree of asymmetry?

Ok, I think there’s a bit of confusion here between asymmetry in the distortion and asymmetry in the diffusion encoding. The former is purely spatial and observable by looking at the images. The latter is more subtle and can’t be observed that easily – but more to the point, has (almost) nothing to do with the kinds of distortion you’re talking about here.

If you just post a snapshot of your data (an axial slice through one of your b=0 images at the level of the brainstem or ear canals will do), we should be able to just tell you whether your data were acquired AP/PA (should look pretty symmetric) or LR/RL (would look clearly asymmetric).