A computer-implemented medical data processing method for determining the position of an anatomical tracking structure in a tracking image usable for controlling radiation treatment such as at least one of radiotherapy or radiosurgery of a patient, the method comprising the following steps: a) planning image data is acquired which describes a planning image of the tracking structure; b) reference image data is acquired which describes a reference image of the tracking structure; c) the position of the tracking structure in the reference image is determined; d) the reference image is processed to generate a binarized reference image being a binarization of the reference image; e) a selection is made from the binarized reference image based on the position of the tracking structure in the reference image, wherein the selection includes the tracking structure; f) the planning image is processed to generate at least one binarized planning image being a binarization of the at least one of the planning images; g) the position of the tracking structure in the binarized planning image is determined and a selection is made from the binarized planning image, wherein the selection includes the tracking structure; h) a template for determining the position of the tracking structure in another image is generated based on the selection from the binarized reference image and the selection from the binarized planning image; i) a two-dimensional monochrome image is acquired which describes the tracking structure; j) the monochrome image is processed to generate a binarized monochrome image being a binarization of the monochrome image; k) the position of the tracking structure in the binarized monochrome image is detected by matching the template with the binarized monochrome image. a) planning image data is acquired which describes a planning image of the tracking structure; b) reference image data is acquired which describes a reference image of the tracking structure; c) the position of the tracking structure in the reference image is determined; d) the reference image is processed to generate a binarized reference image being a binarization of the reference image; e) a selection is made from the binarized reference image based on the position of the tracking structure in the reference image, wherein the selection includes the tracking structure; f) the planning image is processed to generate at least one binarized planning image being a binarization of the at least one of the planning images; g) the position of the tracking structure in the binarized planning image is determined and a selection is made from the binarized planning image, wherein the selection includes the tracking structure; h) a template for determining the position of the tracking structure in another image is generated based on the selection from the binarized reference image and the selection from the binarized planning image; i) a two-dimensional monochrome image is acquired which describes the tracking structure; j) the monochrome image is processed to generate a binarized monochrome image being a binarization of the monochrome image; k) the position of the tracking structure in the binarized monochrome image is detected by matching the template with the binarized monochrome image.