A method for visualization includes receiving an input indicative of respective apparent coordinates of a plurality of points disposed along a length of a probe inside a body of a subject, and applying a model of known mechanical properties of the probe to the apparent coordinates so as to compute a cost function with respect to shapes that can be assumed by the probe in the body. A shape is chosen responsively to the cost function, and corrected coordinates of the points along the length of the probe are generated based on the shape. The representation of the probe using the corrected coordinates is then displayed.