The present invention relates to a method for adjusting a collimator (104) of an X-ray source (101), comprising the steps of detecting (401-403) an arrangement of an X-ray detector (108) with respect to the X-ray source (101),automatically determining an adjustment for the collimator (104) based on the detected position of the X-ray detector (108) with respect to the X-ray source (101), andautomatically adjusting the collimator (104) based on the determined adjustment for the collimator (104).