A method, including inserting a catheter having at least one electrode into a chamber of a body organ of a patient and recording at a sequence of times respective sets of currents between the at least one electrode and a plurality of patches positioned on skin of the patient. The method further includes, while recording the sets of currents, acquiring x-ray images of the at least one electrode, and determining locations of the catheter from the images. A relation is derived between the locations and the respective sets of currents based on the sets of currents and the images. The method also includes recording subsequent sets of currents between the at least one electrode and the patches, and determining, based on the relation, subsequent locations of the catheter in response to the subsequent set of currents.