While a catheter that includes (i) a catheter body, and(ii) a catheter shaft, which includes a sensor and which isdisposed inside a lumen of the catheter body, is inside abody of a subject, a position and an orientation of a distalend of the catheter body with respect to the sensor areascertained, based on (a) a calibration image, acquired byan imaging system, that shows an indication of the distalend of the catheter body, and (b) a signal from the sensor,but not based on any indication of the sensor shown in thecalibration image. Using the ascertained position andorientation of the distal end of the catheter body withrespect to the sensor, a visual output is generated. Otherembodiments are also described.