Eddy motion correction


I was trying to read the source code for the newest version of eddy. And I was wondering how you managed to do the motion correction. Is there a specific function or chunk of code responsible for the motion correction?

I issued several test runs. The command I used is as follows: ./eddy_cpu --imain=…/test_data/test05_sbmot.nii.gz --mask=…/test_data/test05_sbmot_mask.nii.gz --acqp=…/test_data/acqparams.txt --index=…/test_data/index.txt --bvecs=…/test_data/test05_sbmot.bvec --bvals=…/test_data/test05_sbmot.bval --out=…/test_data/test05_sbmot_eddy.nii.gz

And I print out the parameters and found out the place where we changed the parameters are at the volume to volume section and entered the following if statement. I was wondering if you could give me some hint on how you conduct the motion correction in the code. Like I could find where you estimate the difference, but what is the specific function/class the code use to handle and correct the parameter and update the data stored in sm class? What’s your high-level workflow when doing the motion correction?

Thank for your help!

Hi @Charlotte_Ma,

If I understand your question correctly, you’re asking about the internals of the code for eddy? If that’s the case, you really want to address your question on the FSL forum. MRtrix relies on eddy, but doesn’t interact with its code in any way – we just invoke it with the right parameters…

All the best,


Thanks for the quick response! Just to confirm, when you say FSL forum, do you mean JISCMail - FSL List at WWW.JISCMAIL.AC.UK? Or is there other things you are discussing?


Hi Charlotte,

Yes, I guess that’s the one! At least that’s what they state in their own support page
All the best,