When a size of a flat panel detector, contained in an X-ray detector containing part, in a body axial direction of a subject is detected, a detected value of a potentiometer, and stored information on a maximum size of a flat panel detector, containable in the X-ray detector containing part, in the body axial direction of the subject are compared with each other. If the size of the flat panel detector contained in the X-ray detector containing part coincides with the maximum size of the flat panel detector containable in the X-ray detector containing part, a reference position information switching part switches reference position information stored in a reference position information storage part. When an operator performs a predetermined operation on an operation part by pressing a switch or performing another action, the stored reference position information is changed to a preset reference position.