A tracking apparatus for operation in conjunction with an imaging apparatus, which has an imaging volume and is configured to form images of a region within a body of a patient that is positioned in the imaging volume, and which includes a movable bed for transporting the body of the patient through the imaging volume, the tracking apparatus comprising: an invasive probe configured for insertion into a lumen within the body of the patient; a field transducer positioned in the imaging apparatus and defining a tracking volume within the imaging apparatus, and which is configured to generate an indication of a location of the invasive probe within the tracking volume responsively to an interaction between the field transducer and the invasive probe, wherein the field transducer is positioned so that the tracking volume is fixed relative to the imaging volume and so that the tracking volume overlaps the imaging volume; and a controller configured to implement a closed-loop control algorithm comprising: registering a coordinate system of the imaging apparatus with a coordinate system of the field transducer; acquiring the position of the invasive probe using the indication of the location of the invasive probe generated by the field transducer; calculating the distance between a distal end of the invasive probe and a center of the tracking volume based on the acquired position; determining if the invasive probe is within a threshold distance from the edges of the tracking volume based on the calculated distance from the center of the tracking volume; and responsive to the invasive probe being within the threshold distance from the edges of the tracking volume, calculating a speed of bed movement to compensate for the movement of the invasive probe and instructing the imaging apparatus to shift the movable bed at the calculated speed in a direction opposite to the tracked motion of the invasive probe, in such a manner that a distal end of the invasive probe remains within the tracking volume, as well as within the imaging volume. an invasive probe configured for insertion into a lumen within the body of the patient; a field transducer positioned in the imaging apparatus and defining a tracking volume within the imaging apparatus, and which is configured to generate an indication of a location of the invasive probe within the tracking volume responsively to an interaction between the field transducer and the invasive probe, wherein the field transducer is positioned so that the tracking volume is fixed relative to the imaging volume and so that the tracking volume overlaps the imaging volume; and a controller configured to implement a closed-loop control algorithm comprising: registering a coordinate system of the imaging apparatus with a coordinate system of the field transducer; acquiring the position of the invasive probe using the indication of the location of the invasive probe generated by the field transducer; calculating the distance between a distal end of the invasive probe and a center of the tracking volume based on the acquired position; determining if the invasive probe is within a threshold distance from the edges of the tracking volume based on the calculated distance from the center of the tracking volume; and responsive to the invasive probe being within the threshold distance from the edges of the tracking volume, calculating a speed of bed movement to compensate for the movement of the invasive probe and instructing the imaging apparatus to shift the movable bed at the calculated speed in a direction opposite to the tracked motion of the invasive probe, in such a manner that a distal end of the invasive probe remains within the tracking volume, as well as within the imaging volume. registering a coordinate system of the imaging apparatus with a coordinate system of the field transducer; acquiring the position of the invasive probe using the indication of the location of the invasive probe generated by the field transducer; calculating the distance between a distal end of the invasive probe and a center of the tracking volume based on the acquired position; determining if the invasive probe is within a threshold distance from the edges of the tracking volume based on the calculated distance from the center of the tracking volume; and responsive to the invasive probe being within the threshold distance from the edges of the tracking volume, calculating a speed of bed movement to compensate for the movement of the invasive probe and instructing the imaging apparatus to shift the movable bed at the calculated speed in a direction opposite to the tracked motion of the invasive probe, in such a manner that a distal end of the invasive probe remains within the tracking volume, as well as within the imaging volume.