Affine alignment cannot correct for image distortions due to magnetic field imperfections, which can be caused by either poor shims or unavoidable distortions of the field near air-tissue or bone-tissue interfaces. One strategy is to correct image distortions based upon acquired field maps. However, another method is use a non-distorted target image, acquired using conventional multi-shot methods, as a template for distorted images, which presumably were acquired using methods like EPI that are more susceptible to field distortions.
This algorithm incorporates these features:
1) Non-linear distortion fields can be specified in all or selected directions.
2) Overlapping 3-dimensional basis functions specify the distortion fields.
3) The MI cost function is penalized by the 2nd derivative of the fields.
4) Limits can be set on the Jacobian of the local transformation matrix.
5) A multi-resolution procedure adjusts basis functions from coarse to high resolution.
Items 2-5 enforce smoothness upon the resulting distortion fields. Use of a higher rigidity (#3) and/or a lower Jacobian (#4) reduce the amount of stretching applied to images. A Jacobian limit of 2 means that the distance between neighbors cannot be expanded or compressed by more than factors of 2 or 1/2, respectively. These criteria enforce diffeomorphism in almost all cases (this information is output during alignment).
Note that low-resolution basis functions are composed as linear combinations of high-resolution basis functions, so that distortion fields can be represented identically at all resolution levels. The graphic below shows two neighbor basis functions at very low resolution (16x down-sampling). The default adjustment procedure starts at 8x down-sampling and proceeds to 4x and 2x down-sampling.
Non-linear alignment occurs AFTER affine alignment. The default parameter set works fairly well in most cases. In many cases, depending upon the relationship between your template and the slice-selection direction, there may be no need to adjust z distortion fields. Good values for rigidity are 5 or 10, and there generally is no need to use Jacobian values above 2.