A method for registering digitized images using Markov Random Fields (MRFs) includes providing a source image f and a target image g, defining a deformation grid of
control points, defining a coordinate transformation as where x is a point on the source image, p is a position vector of control point p, dp is a displacement vector for each control point, up is a label for point p associated with displacement dp, and η( ) is a weighting function for the displacement vector, defining an MRF energy functional to be minimized by T as
wherein |G| is a number of control points, |E| is a number of pairs of neighboring control points on a neighborhood system, t is an iteration counter, and associating the MRF with a primary linear program and solving the primary linear program using a fast primal-dual algorithm to yield a coordinate transformation that minimizes the energy functional.