The application relates to an X-ray imaging unit (100) for X-ray imaging. The unit comprise a processor part (372), a gantry part (120), an X-ray source part (124) for emitting X-rays, and an X-ray imaging detector part (126) for receiving the X-rays from the source part. The gantry part comprises the source and detector parts. The processor part is configured to control the source and detector parts in order to obtain (205, 216) an image data. The processor part is further configured to determine (208) at least one reference structure (235, 236) of a patient (201) from the image data and determine (212) a position of a head (237) of the patient on a grounds of the at least one reference structure.