1. A method of registering a digital image with a polygonal mesh comprising the steps of: providing a digital image comprising a plurality of intensities corresponding to a domain of points in a D-dimensional space; providing a polygonal mesh comprising a plurality of vertices that approximates an object in the digital image; propagating a ray from a vertex of the polygonal mesh in a direction into the digital image and calculating a line integral of opacity values wherein each opacity value corresponds to the intensity of a pixel of the image through which said ray passes; terminating the ray at a point in the image when an opacity threshold is reached; and adding the termination point to a set of closest points.