Rotate bvecs for motion correction?

Hi AFNI experts,

I’m trying to do probabilistic tractography with 3dDWUncert & 3dProbTrackID. I followed the instructions on this blog. Here it is recommended to rotate the bvecs. However, this blog is rather old and might be outdated.
Therefore my question: Is it enough to convert by bvecs like this

1dDW_Grad_o_Mat++ \
    -in_col_vec bvecs \
    -in_bvals bvals \
    -out_col_matA bvecs_matA.txt

and use the output then for 3dDWUncert & 3dProbTrackID?

Would be great to get some feedback on this!

Hi, Steph-

While that blog is useful, a full processing description, from DICOM conversion through tracking, and including distortion correction with the recommended TORTOISE tools (also freely available from NIH, is available from here:

There are descriptions of outputs, and each program generates automatic QC images along the way, too. That goes hand-in-glove with the FATCAT_DEMO2 in AFNI, available via running:


It is the same data set as processed in that tutorial, with a full script (parts of which are segmented in the tutorial pages).

The above pipeline is for data acquired with dual phase encoding: one set of DWIs with phase encoding say, in the anterior->posterior direction, and another set of the same DWIs with the phase encoding in the opposite, posterior->anterior direction. That facilitates EPI (AKA B0 inhomogeneity) distortion correction, accomplished with the DR_BUDDI tool in TORTOISE. If you don’t have that, you can slightly modify the script.


Hi Steph,

As author of the blog, I wanted to chime in and agree with Paul - I highly recommend using TORTOISE to process your diffusion data. I’ve updated the post to include this information at the top as I’ve been doing for other older posts.

Also - Thanks for the vote of confidence Paul!


Thanks so much to both of you! This is super helpful and I’m very grateful for your immediate responses!!