This program was used to find the radial grey level distribution.
It was used on both Apollo and Hewlett Packard work stations.
The user specifies the name of the data file which must have the standard
8-bits format used at the Cooperative Phenomena group, or the corresponding
quasi 16-bits format used by the software described in section
.
It is optional to specify the center position. If this position is not specified,
the geometrical middle of the picture is used.
The calculation of the grey level distribution is done simply by scanning through the picture, pixel by pixel. Then the intensity of all the pixels at one radius is added up while the program keeps track of the number of pixels at this specific radius. The radial grey level is the ratio of the total grey level intensity of a radius to the number of pixels at this radius.
The main loop updating this is shown below. Here x and y are the coordinates of the current point. The current point runs through the whole picture. xsize and ysize gives the size of the picture. xcentre and ycentre give the center measured from the upper left corner. pixelvalue(x,y) is a procedure returning the value of pixel (x,y).
for (y=0;y<ysize;++y) /* For all pixels in y-direction */
for (x=0;x<xsize;++x) /* For all pixels in x-direction */
{
radius=sqrt((x-xcentre)*(x-xcentre)+(y-ycentre)*(y-ycentre));
if (radius<MAXRAD) /* Check if inside array limits */
{
radint[radius]=radint[radius]+pixelvalue(x,y);
radant[radius]++;
}
}