An apparatus and method for performing treatment on an internal target
region while compensating for breathing and other motion of the patient
is provided in which the apparatus comprises a first imaging device for
periodically generating positional data about the internal target region
and a second imaging device for continuously generating positional data
about one or more external markers attached to the patient's body or any
external sensor such as a device for measuring air flow. The apparatus
further comprises a processor that receives the positional data about the
internal target region and the external markers in order to generate a
correspondence between the position of the internal target region and the
external markers and a treatment device that directs the treatment
towards the position of the target region of the patient based on the
positional data of the external markers.