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