An apparatus, comprising: a plurality of body surface electrodes, which are adapted to be fixed to a surface of a body at respective locations; a controller having current-measuring circuitry, which is adapted to be coupled to a catheter having a distal portion and at least one catheter electrode disposed on the distal portion and to body surface electrodes, the controller being operative for passing electrical current through the body between the at least one catheter electrode (100, 102, 104, 106) and the body surface electrodes, and for determining position coordinates of the catheter by measuring respective characteristics of the electrical current passing through the body surface electrodes; a sheath having a lumen adapted to receive the catheter, and an outer wall with a perforation formed through the outer wall and placed proximal to a distal end of the sheath; a memory; a processor having access to the memory and configured to be cooperative with the controller to perform the steps of: measuring the electrical current through the at least one catheter electrode with the current-measuring circuitry while the catheter is being moved in a human patient through the sheath; identifying a variation in the electrical current between a first threshold value and a second threshold value while the at least one catheter electrode is passing by the perforation; and responsively to the variation, reporting that a portion of the catheter has transitioned between an in-sheath condition and an out-of-sheath condition. a plurality of body surface electrodes, which are adapted to be fixed to a surface of a body at respective locations; a controller having current-measuring circuitry, which is adapted to be coupled to a catheter having a distal portion and at least one catheter electrode disposed on the distal portion and to body surface electrodes, the controller being operative for passing electrical current through the body between the at least one catheter electrode (100, 102, 104, 106) and the body surface electrodes, and for determining position coordinates of the catheter by measuring respective characteristics of the electrical current passing through the body surface electrodes; a sheath having a lumen adapted to receive the catheter, and an outer wall with a perforation formed through the outer wall and placed proximal to a distal end of the sheath; a memory; a processor having access to the memory and configured to be cooperative with the controller to perform the steps of: measuring the electrical current through the at least one catheter electrode with the current-measuring circuitry while the catheter is being moved in a human patient through the sheath; identifying a variation in the electrical current between a first threshold value and a second threshold value while the at least one catheter electrode is passing by the perforation; and measuring the electrical current through the at least one catheter electrode with the current-measuring circuitry while the catheter is being moved in a human patient through the sheath; identifying a variation in the electrical current between a first threshold value and a second threshold value while the at least one catheter electrode is passing by the perforation; and responsively to the variation, reporting that a portion of the catheter has transitioned between an in-sheath condition and an out-of-sheath condition.