1. A method in image-guided radiation treatment, comprising: determining a measure of similarity of a first image of an object and a second image of the object, wherein each of the first image and the second image has pixel values, and wherein determining the measure of similarity comprises: forming a difference image by subtracting corresponding pixel values of the second image from each pixel value of the first image; and forming a pattern intensity function over all the pixels in the difference image within a neighborhood.