An approach to radiotherapy is disclosed which allows the therapeutic beam to be more accurately directed towards a target region. Instead of stopping acquiring images during treatment, the system continues to acquire images as treatment is ongoing. This ongoing pipeline of images is used to update the previously created 3D reconstructions of each breathing phase. Thus the position of the target region can also be updated. The surrogate is recorded simultaneously with the image acquisition although it is not used to determine the breathing phase. As new images are used to update the 3D reconstructions of each breathing phase the values of the surrogate associated with that phase are also updated. This means that the correlation with the surrogate can also continue to be evaluated, and the correlation refined, thus improving the ability of the system to track the motion of the target.