PROBLEM TO BE SOLVED: To easily create mask data for visualizing a desired region. A mask generation device 1 includes an image acquisition means for acquiring a plurality of tomographic images, a subject area calculation means for calculating a subject area for each tomographic image based on a signal value of each pixel, and a tomographic image for each. , The subject shape calculation means that approximates the calculated outline of the subject area with a predetermined geometric shape and calculates the parameters of the geometric shape, and for each tomographic image, each pixel of the tomographic image is inside or outside the geometric shape. A mask data generation means for calculating a mask value defining which one is included and generating mask data for holding the mask value for each pixel is provided. [Selection diagram] Fig. 1【課題】所望の領域を可視化するためのマスクデータを容易に作成する。【解決手段】マスク生成装置1は、複数の断層画像を取得する画像取得手段と、断層画像毎に、各画素の信号値に基づいて被写体領域を算出する被写体領域算出手段と、断層画像毎に、算出された被写体領域の外郭を所定の幾何形状で近似し、当該幾何形状のパラメータを算出する被写体形状算出手段と、断層画像毎に、断層画像の各画素が前記幾何形状の内部か外部のいずれに含まれるかを定義したマスク値を算出し、各画素に対するマスク値を保持するマスクデータを生成するマスクデータ生成手段と、を備える。【選択図】図1