The exact positioning of patients during radiotherapy is essential for high precision treatment. The registration of portal image sequences can help to control the patient position. The particular problem of such megavoltage X-ray imagery is its extremely low contrast, rendering accurate feature extraction a difficult task. To circumvent the step of feature extraction, the algorithm presented in this paper relies on an area-based matching of the image signal using deformable templates. This strategy contrasts with most state of the art registration algorithms for portal imagery. The paper includes the mathematical formalism of the least squares template matching method, as well as the framework for automated quality control, together yielding a fast, robust and very accurate image matching procedure. Tests on 17 portal image series with more than 100 images in total have shown very satisfying results. Artificially rotated and shifted images demonstrate the performance of the method ...