A method of radiotherapy treatment planning involves dynamic target tracking and beam redirection. A set of 3D images of a patient reflecting a movement of the patient is obtained, and each image is deformably registered with one reference image. The accumulated dose is calculated as the sum of the dose distribution over all phases in dependence of the patient movement and the model of the delivery machine, the dose distribution for each phase being deformed by means of the deformation map for the respective phase, to match the reference image.