ADD - Add images

(11/01/12)

PURPOSE

Adds two or more images or volumes together and places sum in an output file. All inputs must have same dimensions.   Example.

SEE ALSO

AD S [Add Series of images]
AS R [Average image/volume series, optional subset]
ADD 2 [Pairwise add series of real or complex images]
PA [Patch image into a larger existing image/volume]
ADD R [Add two images with ratio]
ADD F [Add two images with factors]

USAGE

.OPERATION: ADD

.INPUT FILE: PIC001
[Enter the name of the first file to be added. (Header positions from this file are transferred to output.)]

.NEXT INPUT FILE: PIC002
[Enter the name of the next file to be added. Can be same as first input file.]

.OUTPUT FILE: PIC999
[Enter the name of the output file. Can be same as either input file]

SPIDER will ask:

.NEXT INPUT FILE: PIC003
[Enter the name of the third file to be added.]

'ADD' will continue in this manner until an asterisk ('*') is given as the name of the next input file.

NOTES

  1. 'ADD' only works for files with the same dimensions. To add files of different dimensions, use ''PA' (PATCH).

  2. For adding an entire file series, is is more practical to use operation 'AS R'. This will also produce a variance map.

  3. To add a long series of images within a procedure use the following set of operations:
     
     BL                ; Create constant value file 
       out999          ; File name                  (output) 
       64 64           ; Dimensions of output file  
       N               ; Do not use average 
       0.0             ; Image value is zero 
     DO  [num]=1,4     ; Creates running sum 
       ADD             ; Add files operation  
         inp{***[num]} ; First  file               (input) 
         out999        ; Second file               (input)  
         out999        ; Summed File               (output) 
         *             ; Put asterick here  
     ENDDO 
    

SUBROUTINES

ADD

CALLER

UTIL2