A system for registering, prior to a medical procedure, a three-dimensional image of a body of a subject with a tracking system for tracking an intrabody tool, the system comprising: an electrical interface; and a processor, configured: to receive, via the electrical interface, a plurality of signals from a probe, as the probe is placed at respective locations on a body of a subject, wherein the signals indicate the position of the probe and the orientation of the probe at the respective locations, to derive, from the signals, a set of points that correspond to the respective locations, to register the set of points with the three-dimensional image of the body of the subject, by: first computing a transformation that roughly aligns the points with corresponding voxels of the image; and next identifying, for each point of the points, one or more voxels of the image that are within a given distance of the point and at which respective surface normals are oriented within a given angle of the orientation at which the probe was held at the location to which the point corresponds, and computing a transformation that aligns each point of the points with a selected one of the voxels that were identified for the point, and to track, subsequently, based on the registering, a location of the intrabody tool, in a coordinate system of an imaging device that was used to acquire the image. an electrical interface; and a processor, configured: to receive, via the electrical interface, a plurality of signals from a probe, as the probe is placed at respective locations on a body of a subject, wherein the signals indicate the position of the probe and the orientation of the probe at the respective locations, to derive, from the signals, a set of points that correspond to the respective locations, to register the set of points with the three-dimensional image of the body of the subject, by: first computing a transformation that roughly aligns the points with corresponding voxels of the image; and next identifying, for each point of the points, one or more voxels of the image that are within a given distance of the point and at which respective surface normals are oriented within a given angle of the orientation at which the probe was held at the location to which the point corresponds, and computing a transformation that aligns each point of the points with a selected one of the voxels that were identified for the point, and to track, subsequently, based on the registering, a location of the intrabody tool, in a coordinate system of an imaging device that was used to acquire the image. to receive, via the electrical interface, a plurality of signals from a probe, as the probe is placed at respective locations on a body of a subject, wherein the signals indicate the position of the probe and the orientation of the probe at the respective locations, to derive, from the signals, a set of points that correspond to the respective locations, to register the set of points with the three-dimensional image of the body of the subject, by: first computing a transformation that roughly aligns the points with corresponding voxels of the image; and next identifying, for each point of the points, one or more voxels of the image that are within a given distance of the point and at which respective surface normals are oriented within a given angle of the orientation at which the probe was held at the location to which the point corresponds, and computing a transformation that aligns each point of the points with a selected one of the voxels that were identified for the point, and first computing a transformation that roughly aligns the points with corresponding voxels of the image; and next identifying, for each point of the points, one or more voxels of the image that are within a given distance of the point and at which respective surface normals are oriented within a given angle of the orientation at which the probe was held at the location to which the point corresponds, and computing a transformation that aligns each point of the points with a selected one of the voxels that were identified for the point, and to track, subsequently, based on the registering, a location of the intrabody tool, in a coordinate system of an imaging device that was used to acquire the image.