A miniature surgical robot is attached directly to the bone of a patient at a surgical site, thereby locating the robot precisely on the bone. Intraoperative two-dimensional images of the robot on the bone together with an image referencing element disposed in a predetermined position relative to the robot, are correlated to form a three dimensional image. One or more windows of this three dimensional image are registered with similarly located windows in a preoperative three-dimensional image of the surgical site, the preoperative image including details of the surgeons plan. This registration of these windows defines the referencing element position in the preoperative image, and hence the robot location in the preoperative image. This enables the robot to be directed to pre-operative determined positions based on the pre-operative plan to perform a surgical procedure.