1. A non-transitory computer readable medium encoded with a program for execution on a processor, the program, when executed on the processor performing a method of determining a transformation between a first image and a second image, the method comprising acts of: (a) for each region of a plurality of regions in the first image, each region of the plurality of regions comprising a plurality of pixels included in the first image, each of the plurality of pixels having at least one attribute, determining a corresponding region in the second image as a function of a transformation parameter, and determining a similarity function between the region in the first image and the corresponding region in the second image as a function of the transformation parameter; (b) determining a similarity function between the first image and the second image using the similarity function determined for each region of the plurality of regions; and (c) determining a value of the transformation parameter, wherein the value substantially optimizes the similarity function between the first image and the second image.