When a three-dimensional image is generated by reconstructing tomographic images, the size of a structure shown in the image is made to be close to the actual size of the structure, thereby facilitating understanding of the three-dimensional structure and improving the diagnosis accuracy. Radiographic images for different imaging directions taken by applying radiation to a subject from the different imaging directions are obtained, and a plurality of tomographic images of the subject are generated based on the obtained plurality of radiographic images. Then, compression processing in the direction perpendicular to slice planes of the generated tomographic images is applied to the tomographic images to generate compressed tomographic images, wherein a range of the imaging directions is obtained, and a compression rate of the compression processing is set based on the obtained range of the imaging directions.