A method for removing ghost markers from a measured set of medical markers, wherein the measured set of markers represents the positions of real markers and the positions of ghost markers, comprising the steps of: —;calculating all possible minimal marker sets, wherein a minimal marker set is a subset of the measured set and a minimal marker set consists of the smallest possible number of markers which would cause the measured set to be measured; —;calculating the smallest extent of each minimal marker set, wherein the smallest extent is the smallest extent among the extents in three orthogonal directions; and —;selecting the minimal marker set having the smallest out of the smallest extents as a marker set without ghost markers.