In the diagnosis of arteriosclerosis, radio-opaque dye is injected into the interior of the arteries to make them visible. Because of its increased contrast sensitivity, digital subtraction angiography has the potential for providing diagnostic images of arteries with reduced dye volumes. In the conventional technique, a mask image, acquired before the introduction of the dye, is subtracted from the contrast image, acquired after the dye is introduced, to produce a difference image in which only the dye in the arteries is visible. The usefulness of this technique has been severely limited by the image degradation caused by patient motion during image acquisition. This motion produces artifacts in the difference image that obscure the arteries. One technique for dealing with this problem is to reduce the degradation by means of image registration. The registration is carried out by means of a geometrical transformation of the mask image before subtraction so that it is in registration with the contrast image. This paper describes our technique for determining an optimal transformation. We employ a one-to-one elastic mapping and the Jacobian of that mapping to produce a geometrical image transformation. We choose a parameterized class of such mappings and use a heuristic search algorithm to optimize the parameters to minimize the severity of the motion artifacts. To increase the speed of the optimization process we use a statistical image comparison technique that provides a quick approximate evaluation of each image transformation. We present the experimental results of the application of our registration system to mask-contrast pairs, for images acquired from a specially designed phantom (described in a companion paper), and for clinical images.