A method, including calculating locations of first sensors attached to a probe that has been inserted into a human patient, and calculating positions of second sensors attached to a sheath via which the probe is inserted. The method also includes calculating respective shapes of the probe and the sheath, to achieve a best fit to the calculated probe sensor locations and sheath sensor positions, while restricting the probe to pass through the sheath. The calculated respective shapes of the probe and the sheath are used to present an image of the sheath aligned with the probe.