1. A method, comprising: receiving a target image, wherein the target image is a distorted magnetic resonance image; receiving a reference image, wherein the reference image is an undistorted magnetic resonance image; selecting an image registration method for registering the target image to the reference image, wherein the image registration method uses an image transformation; performing image registration of the target image with the reference image, wherein the image registration provides a plurality of optimized parameters of the image transformation; and generating a corrected image based on the target image and the plurality of optimized parameters of the image transformation.