1. A method, comprising: receiving at a processor an input indicative of respective measured locations of a plurality of points disposed along a length of a probe inside a body of a subject, the probe having a predetermined shape; applying a model of known mechanical properties of the probe to the respective measured locations with respect to a plurality of shapes of the probe different from the predetermined shape; choosing a shape of the plurality of shapes and determining preliminary coordinates of the respective measured locations responsively to the chosen shape; minimizing differences between the respective measured locations and the preliminary coordinates; and generating corrected coordinates of the points along the length of the probe based on the minimized differences.