A new image registration algorithm for the alignment of histological sections that combines the ideas of B-spline based elastic registration and consistent image registration, to allow simultaneous registration of images in two directions (direct and inverse).