Help for SARGONB

 PURPOSE:

 SARGONB is a VICAR applications program which performs operations on user
 specified polygons. SARGONB operates on byte or halfword data, and is a
 batch version of SARGON.  The maximum image line length supported is
 10,000 samples.  SARGONB will interpolate over arbitrary polygons.
 It can handle up to 25 polygons of up to 25 vertices each.

 SARGONB stores all operations (parameters FUNCi and CONSTi) and areas (VERTi)
 specified, then operates on each area in order. Only one operation can be 
 performed for each VERT specified.  Each operation is specified by the
 associated FUNC parameter (specifies type of operation) and CONST parameter,
 which specifies 0-4 numerical constants needed.  (Most operations require
 only one CONST;  operation ZERO does not require any, and operation INTERP
 requires 4, which may be defaulted.)

 INTERPOLATION:

 For interpolation (FUNCi = INTERP), the associated values of CONSTi are:
   RADI, PERC,   MIN,   MAX.
   (200,   30, -9999, 32767) are the respective defaults.

 Those pixels pixels exterior to the polygon with MIN < DN < MAX will be saved
 for use. If PERC < 100, these exterior points will be randomly weeded out
 until the proper percent remains.  These final points will be fed to subroutine
 EXTRAP, which interpolates.  For each point being interpolated, only exterior 
 points within a radius of RADI will be used in the formula. The use of RADI
 and PERC, can greatly enhance the speed of the algorithm for large areas. 
 However, a small PERC can give unrepresentative results for small areas. 
 MIN and MAX are important for painless interpolation. For example, if a large
 dark gore is to be removed, one can set MIN above the gore's DN. Now if one
 side of the polygon accidently crosses into the gore, the interpolation
 formula will ignore the border points collected from within the gore.

 EXECUTION:

 The following is the execution statement for SARGONB:

   SARGONB  INP  OUT  FUNC1 CONST1 [FUNC2 CONST2 VERT2 ...]

 where INP, OUT, FUNCi, CONSTi, and VERTi are parameters discussed in their
 respective parameter section in TUTOR mode.  

 Note that SARGONB does not use a SIZE parameter!  This is because the
 parameters were designed to allow all to be specified postitionally, with
 up to 25 groups of (FUNC, CONST, and VERT).  See EXAMPLES (below) for
 details.
 EXAMPLES:

    SARGONB A B INTERP VERT1=(72,1,86,121,118,298)

 This example interpolates over a large area.  Note that INTERP
 has been specified positionally;  it is a string-valued parameter,
 not a keyword, so that 'INTERP would not be valid!  (After all,
 there are 25 parameters with INTERP as valid values, so 'INTERP
 would not be unique!)

    SARGONB A B INTERP -- (72,1,86,121,118,298)

 This is identical to the preceding operation, with all parameters
 specified positionally.  The "--" (null value) for the CONST1
 parameter indicates that the default values are to be used.
    SARGONB A B ZERO 0 (100,100,200,200,100,200)

 This example zeroes out a triangular area.  Again, all parameters
 are specified positionally; the "0" was not necessary, since the
 ZERO value for FUNC1 does not need a value.  However, if that "0"
 was omitted, then the next parameter would have to be preceded by
 the parameter-name "VERT1=", since it would no longer be specified
 positionally (because the parameter following FUNC1 is CONST1).

    SARGONB A B SETTO 50 (20,20,20,200,40,200,40,20)

 This example sets a rectangular area to DN=50.  All parameters
 are specified postionally.
    SARGONB A B ADD 10 (2,2,2,10,10,10,10,2)       mult 2 (81,12,81,20,90,20,90,12)       divide 3 (21,21,21,25,30,25,30,21)       setto 250 (31,42,31,47,41,47,41,42)       zero 0 (51,51,51,55,55,55,55,51)

 This example operates on 5 polygons, with all parameters specified
 postionally.  
 RESTRICTIONS:

	1. Maximum number of vertices for a given area is 25.

	2. Sides of any given polygon should not cross.
	
 	3. Maximum line length of input image is 10000 bytes.

        4. Maximum number of areas is 25.

 TIMING: None available for the VAX

 WRITTEN BY: 	CHARLES C. AVIS		20 OCTOBER 1982

 COGNIZANT PROGRAMMER: FLORANCE MOSS

 MADE PORTABLE FOR UNIX: CRI            01 JULY 1994


PARAMETERS:


INP

An input data set

OUT

An output data set

FUNC1

Operation to be performed on the 1st polygon. Valid strings are: ADD, SUBTRACT,MULT,DIVIDE, SETTO,ZERO,INTERP.

CONST1

Constant(s) required by FUNC1.

VERT1

1st polygon to be operated on. 3:25 pairs of real numbers.

FUNC2

Next operation, see FUNC1.

CONST2

Next constant, see CONST1.

VERT2

Next polygon, see VERT1.

FUNC3

Next operation, see FUNC1.

CONST3

Next constant, see CONST1.

VERT3

Next polygon, see VERT1.

FUNC4

Next operation, see FUNC1.

CONST4

Next constant, see CONST1.

VERT4

Next polygon, see VERT1.

FUNC5

Next operation, see FUNC1.

CONST5

Next constant, see CONST1.

VERT5

Next polygon, see VERT1.

FUNC6

Next operation, see FUNC1.

CONST6

Next constant, see CONST1.

VERT6

Next polygon, see VERT1.

FUNC7

Next operation, see FUNC1.

CONST7

Next constant, see CONST1.

VERT7

Next polygon, see VERT1.

FUNC8

Next operation, see FUNC1.

CONST8

Next constant, see CONST1.

VERT8

Next polygon, see VERT1.

FUNC9

Next operation, see FUNC1.

CONST9

Next constant, see CONST1.

VERT9

Next polygon, see VERT1.

FUNC10

Next operation, see FUNC1.

CONST10

Next constant, see CONST1.

VERT10

Next polygon, see VERT1.

FUNC11

Next operation, see FUNC1.

CONST11

Next constant, see CONST1.

VERT11

Next polygon, see VERT1.

FUNC12

Next operation, see FUNC1.

CONST12

Next constant, see CONST1.

VERT12

Next polygon, see VERT1.

FUNC13

Next operation, see FUNC1.

CONST13

Next constant, see CONST1.

VERT13

Next polygon, see VERT1.

FUNC14

Next operation, see FUNC1.

CONST14

Next constant, see CONST1.

VERT14

Next polygon, see VERT1.

FUNC15

Next operation, see FUNC1.

CONST15

Next constant, see CONST1.

VERT15

Next polygon, see VERT1.

FUNC16

Next operation, see FUNC1.

CONST16

Next constant, see CONST1.

VERT16

Next polygon, see VERT1.

FUNC17

Next operation, see FUNC1.

CONST17

Next constant, see CONST1.

VERT17

Next polygon, see VERT1.

FUNC18

Next operation, see FUNC1.

CONST18

Next constant, see CONST1.

VERT18

Next polygon, see VERT1.

FUNC19

Next operation, see FUNC1.

CONST19

Next constant, see CONST1.

VERT19

Next polygon, see VERT1.

FUNC20

Next operation, see FUNC1.

CONST20

Next constant, see CONST1.

VERT20

Next polygon, see VERT1.

FUNC21

Next operation, see FUNC1.

CONST21

Next constant, see CONST1.

VERT21

Next polygon, see VERT1.

FUNC22

Next operation, see FUNC1.

CONST22

Next constant, see CONST1.

VERT22

Next polygon, see VERT1.

FUNC23

Next operation, see FUNC1.

CONST23

Next constant, see CONST1.

VERT23

Next polygon, see VERT1.

FUNC24

Next operation, see FUNC1.

CONST24

Next constant, see CONST1.

VERT24

Next polygon, see VERT1.

FUNC25

Next operation, see FUNC1.

CONST25

Next constant, see CONST1.

VERT25

Next polygon, see VERT1.

MIN

REAL/INTEGER - OPTIONAL - Minimum DN

MAX

REAL/INTEGER - OPTIONAL - Maximum DN

RADIUS

REAL/INTEGER - OPTIONAL - Interpolation radius

PERC

REAL/INTEGER - OPTIONAL - % of border used

DBUG

KEYWORD - OPTIONAL - produce debug print

See Examples:


Cognizant Programmer: