A method and system is presented in image-guided radiosurgery for
determining the measure of similarity of two digital images, for example
a 2D x-ray image and a 2D DRR synthesized from 3D scan data. A
two-dimensional array of pixel values of a difference image is formed by
subtracting each pixel value of the second image from the corresponding
pixel value of the first image. The pattern intensity function is
constructed by taking the summation of asymptotic functions of the
gradients of the difference image. The neighborhood R is defined so as to
allow the gradients of the difference image to be considered in at least
four directions.