The present relates to a method and system for determining the position and orientation of implants located in a body part of a patient. The method and system comprise determining voxels having an intensity value corresponding to implants in a three-dimensional radiographic representation of the body part. The method and system further comprise generating multiple random virtual implants, providing a score for each virtual implant, until obtaining a score that identifies implants. The score is based on a number of voxels having an intensity value corresponding to implants contained in each generated virtual implant. And the method and system comprise determining, based on the score of virtual implants, the position and orientation of the implants located in the body part.