**PURPOSE**- Performs arithmetic operations point for point on the input image to create an output image. Example.

**USAGE**- .OPERATION: AR

- .INPUT FILE: PIC001

[Enter name of the input image.].OUTPUT FILE: PIC002

[Enter name for the output image. Can not be same disk image as input.].FORMULA: P2=: P1+0.5

[Enter formula to be used to compute the output image (referred to by P2) from the input image (P1). Formula can be any valid math expression with many variable registers.

Examples of accepted formulae:

(P1-2.)/2.+SIN(P1+2)

(P1/512.)+0.

EXP(LOG((P1/512.)+0.)+[x]+[y])

4+ABS((P1-2.)/2.)

P1**3+P1+EXP((P1-2.)/2.)

**NOTES**

- See documentation for general
rules of
writing arithmetic expressions and functions in SPIDER.
- Order of application of operators follows that in
Fortran (e.g. multiplication/division are performed
before addition/subtraction). Use ()'s to control
the order where necessary.
- Two operators must not follow each other in the formula
e.g. P2=p1*-1.0 is not allowed.
- To rescale an image's range to 0 - 255 using 'AR':
FI [min],[max] ; File info. operation oldfilename ; Input file 8,7 ; Min and max location in header AR ; Arithmetic operation oldfilename ; Input file newfile ; Output file 255 * (P1-[min]) / ([max]-[min])

- Can handle a whole stack now (Sept. 02).
- We have reports of this operation giving incorrect results on Intel based MacIntosh computers (Sept. 07) We think this is fixed now.

**SUBROUTINES**- ARITH, POLISH, CALC

**CALLER**- UTIL2

© Copyright Notice / Enquiries: spider@wadsworth.org