According to an embodiment, a device includes first and second generators, a detector, and a corrector. The first generator is configured to generate a first image based on data corresponding to photons with a first energy from among data that is obtained based on an energy of radiation that has passed through a subject. The second generator is configured to generate a second image based on data corresponding to photons with a second energy. The detector is configured to detect, in the second image, a second block having a similar pattern of pixel values to a first block included in the second image. The corrector is configured to correct pixel values of a third block in the first image corresponding to the first block based on new pixel values of the third block that are calculated by using pixel values included in a fourth block in the first image.