A method of registering two images using a graphics processing unit
includes providing a pair of images with a first and second image,
calculating a gradient of the second image, initializing a displacement
field on the grid point domain of the pair of images, generating textures
for the first image, the second image, the gradient, and the displacement
field, and loading said textures into the graphics processing unit. A
pixel buffer is created and initialized with the texture containing the
displacement field. The displacement field is updated from the first
image, the second image, and the gradient for one or more iterations in
one or more rendering passes performed by the graphics processing unit.