A non-transitory computer-readable medium that stores an image processing program which is executed in a computer, and which constructs on the computer,
- an image acquisition section that acquires a plurality of sectional images obtained by photographing a subject;
- a density classification section that classifies pixels in each of the plurality of sectional images into high density pixels and low density pixels;
- a two-dimensional labeling section that attaches label numbers to high density image portions each of which is constituted by the high density pixels on each of the plurality of sectional images;
- a three-dimensional labeling section that couples label data between the plurality of sectional images;
- and
- a classification section that classifies image portions of each of the plurality of sectional images into a first image group formed by image portions inside the subject and a second image group formed by image portions outside the subject, based on the coupled label data;
- and
- an image processing section that removes the second image group covered in each of the plurality of the sectional images,
- wherein the classification section calculates, when two three-dimensional images formed by two high-density image portion groups respectively are extracted in the classification section, volume of each of the two three-dimensional images, and
- the classification section determines that both of the two high-density image portion groups are parts of a subject image group if volume of one or the two three-dimensional images is not less than a half of volume of the other of the two three-dimensional images.