A method of aligning masks for phase imaging or phase contrast imaging in X-ray apparatus using a pixel-type X-ray detector makes use of non-idealities of all real detectors. A mask may be provided before the sample to generate beams, adjacent to the pixels of the detector or both. The method includes moving the mask into a plurality of translational position increments and identifying the increment for which the intensity has a maximum or minimum. The identified value of the increment may vary over the pixels of the detector. Alignment positions are selected in which steps in a plot of the increment over the area of the detector are minimized and/or aligned with the rows and columns of pixels.ピクセルタイプのX線検出器を用いるX線装置の位相画像形成または位相コントラスト画像形成のためのマスクを整列させる方法は、すべての現実の検出器の非理想性を利用する。ビームを生成する試料の前に、検出器のピクセルに隣接して、またはその両方にマスクが提供され得る。本方法は、複数の並進の位置増分へマスクを移動させること、および、強度が最大値または最小値を有する増分を識別することを含む。増分の識別された値は、検出器のピクセルにわたって変わり得る。検出器の範囲にわたる増分のプロットにおいて、段が、最小化される、および/または、ピクセルの行および列に対して整列される整列位置が選択される。【選択図】図1