The invention relates to X-ray imaging. In order to improve flexibility, for example in relation with phase-contrast imaging, the X-ray imaging device (10) comprises an X-ray source arrangement for providing an X-ray beam (11). Further, it is provided at least one grating (13, 14) and a line detector (15) with a plurality of sensor lines, which sensor lines are each provided by a plurality of sensor elements, and which sensor lines are provided for detecting respective portions of the X-ray beam (11) passing the at least one grating during operation. The X-ray imaging device is arranged for moving the line detector (15) and an object (21) to be imaged relative to each other, such that in response to the portions of the X-ray beam a number of interference patterns are detectable at respective different relative positions of the line detector and the object for reconstructing an image of the object (21). The at least one grating (13, 14) comprises at least one first segment (161) and at least one second segment (162) arranged adjacent to each other in a direction perpendicular to the direction of the line detector (15). The X-ray imaging device is arranged for moving the line detector (15) and the at least one grating relative to each other between at least a first relative position and a second relative position, such that in the first relative position, a portion of the X-ray beam (11) during operation passes through the at least one first segment (161), while the at least one second segment (162) is arranged outside said portion of the X-ray beam (11), and that in the second relative position, said portion of the X-ray beam (11) during operation passes through the at least one second segment (162), while the at least one first segment (161) is arranged outside said portion of the X-ray beam (11).L'invention se rapporte à l'imagerie par rayons X. De façon à améliorer la flexibilité, par exemple par rapport à une imagerie par contraste de phase, le dispositif d'image