DWI motion correction
The correction is fully automated with the eddycor.py command.
eddycor.py -h to get a description of its usages.
The concept of motion correction is to rigidly register each gradient images to the b0 image in order to compensate for motion. Eddy-current however is considered a skewing of the image by the gradient field, therefore an affine registration of all gradient images to the b0 will theoretically compensate for both motion and eddy-current distortions.
The gradient vectors for each direction is then reoriented based on the resulting registration matrix. This is performed using a script in matlab.