A method of virtually planning a cranial drilled implant guided surgery in a subject is disclosed. The method comprises generating (100) a first data set based on input data obtained from a reference structure having a defined relation to a bone structure of said subject, generating (110) a second data set based on input data obtained from a master structure for a surgical template, said master structure having a defined relation to said reference structure, and associating (120) said first data set with said second data set such that said relation of said reference structure to said master structure is preserved whereby a third data set for production of said surgical template is provided. In this manner a repositioning of the surgical template to a previous position of the master structure in a patient is obtained.