boximage
Simple boxing program to create circular or polygonal box with no change in image size.
C*BOXIMAGE.FOR************************************************************** C Simple boxing program to create circular or polygonal box with no C change in image size. C This makes it quite suitable for the FFT cross-correlation method. C Input original image on stream 1 (IN) C Output boxed image on stream 2 (OUT) C C derived from BOXIM (27-AUG-82) program by JMS, version 2.0 C Version 2.1 7-JUL-84 RH Simpler boxing and explicit origin C uses grid units to specify area and C does not move boxed off area to corner. C VERSION 2.2 29-SEP-85 RH Does not float the densities so that C program will work for integer*1 images. C VERSION 2.3 28-May-87 RH Real*8 DTOT accumulation. C VERSION 2.4 23-Mar-88 RH vertices of box made non-integer C VERSION 2.5 18-Jul-91 RH double circular torus-shaped box option C VERSION 3.0 01-Jan-92 RH convert to UNIX for Alliant C VERSION 3.1 21-Sep-95 RH moved to Dec Alpha, debug RAD3,RAD4 C VERSION 3.2 25-Nov-95 RH check number of vertices on input C VERSION 3.3 22-Apr-96 RH change JINT INT (JMS compatibility) C VERSION 3.4 24-Jul-96 JMS write centre of gravity to file C boximage.tmp C VERSION 3.41 29-Mar-00 JMS zorigin inserted in ialorg for compatibility C with imsubs2000C C card input C CHENN> C 1. NOVERT,IOUTZERO -number of vertices (or 0 for circcular or C 1 for square box), flag for setting outside C of box to zero or float to average C (1=zero,0=average) CCCCCCCCCCCCC NOVERT -number of vertices, 0 for circular box (*) CHENN< C 2. OX,OY -phase origin position (*) C 3a. CX,CY,RAD1,2,3,4 -centre coords and radii if circle (*) C :note four radii are for a tapered toroidal C :mask. A simple circle would have RAD1,2=0 C :and rad3,4 equal to the required radius. C or 3b. PX(I),PY(I) -coords of vertices if polygon (*) C :note origin is (0,0) at lower left corner. CHENN> C or 3c RCX,RCY,RLENBO -centre coords and side-lenght for square C C 4, IOUTZERO -setting outside of box to zero? 1=y,0=average. CHENN< C C NOTE : Specify points in image wrt origin (0,0) in bottom left corner. C Therefore the middle of a 1024x1024 image is (512,512). C C IMPORTANT NOTE : This program does not float the image, but replaces C densities outside box by the average along the C inside perimeter. C C****************************************************************************