A method establishes a spatial position of a part of an x-ray ruler imaged in at least one x-ray image. The X-ray ruler is attached to an alignment of an object to be x-rayed. The X-ray ruler has at least a first part and a second part each having x-ray markers, and the first and second parts are connected to each other by a connection element. A spatial configuration of the x-ray markers is determined on a basis of images of the x-markers in an x-ray image or x-ray images.