# scan2d_overlay.pro

At APS this program is installed in the /usr/local/epics/extensions/bin/$HOST_ARCH directory. This is a flexible 2D image displaying widget program. This program dynamically constructs the 2D composite image from the selected images for a given 2D scan and pops up new composite image window.

This program is a sub-program of scan2d__define.pro and is dynamically loaded into scan2d__define at the run-time.

# List of Routines

- SCAN2D::OVERLAY

# Routine Descriptions

## SCAN2D::OVERLAY

[List of Routines]

     NAME:
    	scan2d::Overlay

     PURPOSE:
           Using overlay composite image reveals information about the
           superposition of the image of selected detectors. It provides
           another way of data interpretation.

           This method constructs a composite image based on user selected
           detectors for a given 2D scanno. The composite image is composed
           of the basic composite element area. Each composite element area
           consists of ColxRow of squares. In each composite area a single
           vaule from each selected image (or detector) is filled in.
           Each colored square in the element area represents a value from the
           selected detector.

           For each detector the values is filled into composite image area
           by columns then by rows.

           In the basic element area all selected detectors are filled in row
           order until the area is full then it re-starts from the first row
           again, i.e. if more detectors than the available squares are
           selected then the overlay of colored squares may be resulted.

           Default 2x2 squares are used for basic element area which can hold
           4 detects without overlapping. Each square has width of 2 pixels.

           Each detector has a fixed color associated with it, it is linearly
           devided into 16 levels. The detector value is linearly interpreted
           by these colors (see restriction).

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:
           Obj->[scan2d::]Overlay [,Scanno] [,Row=row] [,Col=col] [,Pixels=pixels]
                     [,Selects=selects] [,Discrete=discrete]

     ARGUMENTS:
      Scanno:   Optional, specifies the corresponding 2D scan seq #, normally
                it is internally determined by the [scan2d::View] method.

     KEYWORDS:
      Col:      Specifies the number of squares in the composite area , default 2
      Row:      Specifies the number of squares in the composite area , default 2
      Pixels:   Specifies the number of pixels used for each square, default 2
      Selects:  Specifies the list of selected detectors, default 0,1
      Discrete: Plots selected detecor image seperately with info of min and max

     RESTRICTION:
      The image array size may varies from the scan to scan. In order to
      make sure this method works properly, the scan2d::View method has to be
      called first to establish the proper image array size for the desired
      2D scanno. Then the parameter scanno is not required.

      16 colors are used and they are shaded with gray

           Detector 1            Red
           Detector 2            Green
           Detector 3            Blue
           Detector 4            Yellow
           Detector 5            Cyne
           Detector 6            Magenta
           Detector 7            Gray
           Detector 8            Orange
           Detector 9            Light Green
           Detector 10           Purple
           Detector 11           Gold
           Detector 12           Light Orange
           Detector 13           Light Cyne
           Detector 14           Light purple
           Detector 15           Dark Gray
           Detector 16           Dark Yellow

      The 'Color ...' button let user access various color tables comes with IDL.
      The 'myColr' button let user switch back to overlay image color table.

     EXAMPLE:
        The 2D image file is '/home/oxygen/LEGNINI/data/root/plla.june97.image'
        The scanno 29 consists of 10 detectors, with 2D image # 202 to 211.

        Example 1 gives the default overlay of detectors 1 and 2 image for
        scanno 29 from this file. The panImage method shows all detectors
        images for the 2D scan.

        The object v2 need to be defined only if it is not yet defined.

        filename='/home/oxygen/LEGNINI/data/root/plla.june97.image'
        v2 = obj_new('scan2d',file=filename)
        v2->view,202
        v2->panimage
        v2->overlay

        Example 2 uses 2x2 composite area with 4 detectors selected, number
        of pixels used for each square is 8.

        v2->overlay,row=2,col=2,pixels=8,selects=[0,1,8,9]

        Toggle the 'myColor' and 'Color ...' buttons from the Overlay window
        to access various color map.

     MODIFICATION HISTORY:
     	Written by:	Ben-chin Cha, Jan 19, 1998.
    	xx-xx-xxxx      comment

(See scan2d_overlay.pro)