A system for optimizing a position of an implant having an individually customized implant hat (H) and at least one implant protrusion (P) extending from the implant hat (H) in the direction of an implant axis (A) in an anatomical joint of a patient, the system comprising a storage media and a processor , wherein the processor is configured to: receive medical image data representing a three dimensional image of the joint from the storage media ; obtain a three dimensional virtual model of the joint which is based on the received medical image data; identify damage in the joint based on the received medical image data and/or the three dimensional virtual model of the joint; define an implant area that covers at least a major part of the identified damage; position a virtual implant template having an implant hat (H) corresponding to said implant area, in the three dimensional virtual model of the joint; and generate a customized top surface of the implant hat (H) to correspond to a simulated healthy cartilage surface; wherein the processor is configured to position the virtual implant template by: placing the virtual implant template so that the cross section area of the implant hat (H) in a direction perpendicular to the implant axis (A) covers at least a major part of the damage; and optimizing the tilt of the implant axis (A), while maintaining the position of the cross section area of the implant hat (H) in the joint, by minimizing one of: the maximum penetration depth D max into the bone along the circumference of the implant hat (H); the total volume of bone and/or cartilage to be removed for implanting the implant; or the surface area of the implant penetration into the bone. receive medical image data representing a three dimensional image of the joint from the storage media ; obtain a three dimensional virtual model of the joint which is based on the received medical image data; identify damage in the joint based on the received medical image data and/or the three dimensional virtual model of the joint; define an implant area that covers at least a major part of the identified damage; position a virtual implant template having an implant hat (H) corresponding to said implant area, in the three dimensional virtual model of the joint; and generate a customized top surface of the implant hat (H) to correspond to a simulated healthy cartilage surface; placing the virtual implant template so that the cross section area of the implant hat (H) in a direction perpendicular to the implant axis (A) covers at least a major part of the damage; and optimizing the tilt of the implant axis (A), while maintaining the position of the cross section area of the implant hat (H) in the joint, by minimizing one of: the maximum penetration depth D max into the bone along the circumference of the implant hat (H); the total volume of bone and/or cartilage to be removed for implanting the implant; or the surface area of the implant penetration into the bone. the maximum penetration depth D max into the bone along the circumference of the implant hat (H); the total volume of bone and/or cartilage to be removed for implanting the implant; or the surface area of the implant penetration into the bone. <EOS>