1 SUM SUM This program is used to sum many images, handling a weight image in order to produce the average image later on. It computes X(i,j) = X(i,j) + F * Z(i,j) and Y(i,j) = Y(i,j) + F for all non blanked pixels of the input image Z. When called repetitively with the same input/output images X and Y, X contains the weighted sum of all Z images, and Y the weight of each pixels. A parameter is provided to initialise the process. The last step to obtain the average image is to divide X by Y using program COMBINE with option DIVIDE. You can also use SIC command LET to do so, but SUM and COMBINE will handle properly blanking values. 2 START$ TASK\LOGICAL "Initialize weight and sum files" START$ Answer YES when you work with the first image, NO afterwards. 2 Z_NAME$ TASK\FILE "Input image" Z_NAME$ The name of the file you want to add to the running sum. 2 Y_NAME$ TASK\FILE "Weight file" Y_NAME$ The name of the accumulated weight file. 2 X_NAME$ TASK\FILE "Sum file" X_NAME$ The name of the accumulated sum file. 2 WEIGHT$ TASK\REAL "Weight of current image" WEIGHT$ The relative weight you want to attribute to the current image. 1 END