1. A computer-assisted method for detecting edges of a mechanical diaphragm in an image of a subject, caused by gating radiation for producing the image with the mechanical diaphragm before said radiation penetrates the subject, said image containing a closed polygon formed by said edges of said mechanical diaphragm and also containing anatomical image edges representing anatomy of the subject, comprising the steps of: supplying image data representing said image to a computer together with information, separate from said image data, describing a relationship of multiple sides of said closed polygon to each other; and in the computer, automatically analyzing said image data to detect all image edges in the image, and automatically distinguishing said edges of said mechanical diaphragm in said image data from said anatomical image edges using said information describing said closed polygon.