Systems, methods, and apparatuses are provided for targeting diseased tissue with a radiation beam. Functional models can be used to accurately obtain a location of specific tissue using sensors at identifiable locations of the patients body. Using the relative distances between the identifiable sensor locations can allow a patient to be in various positions. The functional models can be prepared using accurate pre-treatment scans, which can be taken at various body positions (e.g., rotations and/or translations). The trajectory of the beam can be measured efficiently and accurately using beam sensors attached to a beam assembly, where a model maps the beam sensor locations to a trajectory of the beam. Further, a motion model can use measurements made during treatment to obtain a time-dependent functions of the movement of the specific tissue, the change of an optimal beam trajectory over time, or the change in input commands to a beam positioner.