# Motion correction for dMRI

One of the things that I have been thinking about in the last couple of weeks is head motion correction for diffusion MRI. A few things have come together: the first is that I have been interested in the idea originally proposed in this paper for a few years. The idea, which is now used in some of the most popular algorithms for motion and eddy current correction, is that direct registration of a diffusion-weighted image to a non-diffusion-weighted image (for example, to the b0 normalization image in a particular scan) is not a great idea, because diffusion-weighted images are supposed to look different from the non-diffusion-weighted images. In particular, in parts of the image that contain large bundles that curve around, slightly different diffusion-weighting directions should cause slight shifts in the location of the brightest pixels. If registered directly, this would cause all kinds of mis-registrations. The idea is instead to use the available data to create a model of the signal in each voxel and to use this model to predict what the image should look like in a particular volume (diffusion-weighting direction) and then register to the predicted image. An algorithm based on this idea would be useful in dmriprep, so I have been working to implement it. Another thing that should help with this is that my previous work demonstrated that a regularized sparse fascicle model provides very accurate predictions of diffusion data. Previously, we used the Elastic Net algorithm to fit this kind of model, with non-negativity constraints. But for motion correction, we don’t really care if the parameters are aphysical (i.e., negative weights in the fODF), so it makes sense to use ridge regression, as implemented in fracridge. In parallel, DIPY now has a simplified API to registration, which should make implementation of the registration part much more straightforward. Taking all these bits and putting them all together is going to be non-trivial, though. An initial sketch of an implementation is here, but I should really move that into a PR on dmriprep soon.