Apparatus and methods are described including acquiring 3D image data of a skeletal portion. While a tool that is coupled to a robot is disposed at a first location along an insertion path, two 2D x-ray images are acquired from respective views. A computer processor (i) determines the first location with respect to the 3D image data based upon identifying the first location within the 2D x-ray images and registering the 2D x-ray images to the 3D image data, and (ii) derives a relationship between the first location and a given location within the 3D image data. Subsequently, the robot moves the tool to a second location responsively to the derived relationship. The processor tracks the motion of the robot relative to the first location, derives the second location, and drives a display to display the second location. Other applications are also described.