Occurrence of artifact due to a change in grating position between preliminary imaging and main imaging is prevented. In each of a first phase shift differential image produced in the absence of a subject in the preliminary imaging and a second phase shift differential image produced in the presence of the subject in the main imaging, boundaries, at each of which a value changes from n/2 to -n/2 or from -n/2 to À/2, are determined. First and second staircase data in each of which a value changes by n or -n when crossing each of the boundaries in a predetermined direction is produced. The first and second staircase data is added to the first and second phase shift differential images to produce first and second added phase shift differential image, respectively. The first added phase shift differential image is subtracted from the second added phase shift differential image to produce a corrected phase shift differential image.