Extended IDL Help

scan2d_overlay.pro

At APS this program is installed in the /usr/local/epics/extensions/idllib directory for EPICS R3.14. This is a flexible 2D image displaying widget program. This program dynamically constructs the 2D composite image from the selected images from a list of 2D XDR image files or 2D image arrays, or from 2D scan objects.

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

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

List of Routines


Routine Descriptions

OVERLAY2DIMAGES

[Next Routine] [List of Routines]
 NAME:
	OVERLAY2DIMAGES	

 PURPOSE:
       This program overlays a selected list of images from an 
       input image_array and displays them as an expanded composite image 
       representation. At most 15 images can be selected from the 
       input image_array. 

 CALLING SEQUENCE:
       Overlay2DImages,Image_array [,Def] [,Vmax,Vmin] [,COL=col] [,Row=row] $
		[,Pixels=pixels] [,Selects=selects] [,Detnm=detnm] $
		[,Discrete=discrete]

 INPUT: 
 	IMAGE_ARRAY(width,height,nd)  
                -  'nd' the number of images (>15) 
                    Initial 2D image array up to 85 2D images
                    Each image contains 'width x height' values
 	DEF(nd)  -  Initial Image presence indicators for image_array 
                    0 not defined, 1 defined, default all defined

 OUTPUT:
	VMAX(15)  -  Maximum value of selected detector images
	VMIN(15)  -  Minimum value of selected detector images

 KEYWORD:
 	COL         -  Columns of dectors in overlay image composition
 	ROW         -  Rows of detectors in overlay image compositon
 	PIXELS      -  Pixel width and height in a unit element of image 
 	SELECTS(15) -  List of sequence number of selected detectors
                      At most 15 detectors can be selected
		       defaults [16,17,...,31]
	DETNM(15)   -  List of selected Detector names assigned
                      At most 15 detectors can be selected
                      defaults ['D01,'D02',...,'D15']
 	DISCRETE    -  Discrete images instead of overlaying images
 
 RESTRICTIONS
   The resultant composite image with new pixel dimension width and height
   as given  
              (60 x pixels x col , 60 x pixels x row)

 EXAMPLE:
     file='/home/spare/sector2/vx2id/2xfm/data01Q4/MarineBio/mda/2xfm_0249.mda'
     v1 = obj_new('scanSee',file=file)
     v1->images,image_array,def
	overlay2DImages,image_array,def,selects=[16,17,18,19,20]

(See scan2d_overlay.pro)


SCAN2D::OVERLAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	scan2d::Overlay

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

       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 small squares. Each colored filled small 
       square area represents a data point from the selected image (or 
       detector). So each composite area is composed of one data point
       from each selected detectors and they are arranged in row order. 

       The resultant composite image with width of ColxWidth,
       and height of RowxHeight squares. (each Detector dimension is 
       Width x Height) 

       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 
       available 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 table associated with it, it is linearly
       divided into 16 levels. The detector value is linearly interpreted 
       by 16 levels (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 1,2 
  Discrete: Plots selected detecor image seperately with info of min and max

 RESTRICTION:
  The postscript "Print" button read the TV sceen and generate the PS output.
  The PS output only good for the screen size within  750x750 pixels.

  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. 
  
  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.
 
 EXAMPLES:
    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 - Use 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 - Use 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=[1,8,9,10]

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

    Example 3 - Plot detector 9's discrete image (pixel scaled by 4) 

	v2->overlay,pixels=4,selects=9,/discrete

    Example 3 - Plot discrete images of detectors 8,9,10 (pixel scaled by 4) 

	v2->overlay,pixels=4,selects=[8,9,10],/discrete

 MODIFICATION HISTORY:
 	Written by:	Ben-chin Cha, Jan 19, 1998.
	01-08-02      Add Print, Printer... button
                     Add slider control on Color Table used
                     Default Color will set Bg slider to bg=128, Fg ratio=8

(See scan2d_overlay.pro)


SCAN2D_OVERLAY[1]

[Previous Routine] [Next Routine] [List of Routines]
 PROGRAM:
	SCAN2D_OVERLAY_SELECTFILES

 PURPOSE:
	Use file selection dialog to select a set of XDR files which should
	contain XDR 2D image, X,Y,Z ragnes data which are saved by the scanSee 
	subprogram image2d 

 CATEGORY:
	Widgets.

 CALL SEQUENCE:
	SCAN2D_OVERLAY_SELECTFILES, XDRFILE_ARRAY [,PATH=path] [,NFILE=nfile] 

 OUTPUT:
  XDRFILE_ARRAY - return an array of XDR image filenames selected from the 
		   2D overlay file selection dialog, at least two file must be  
		   selected

 KEYWORD:
 PATH         - specify the directory where xdr files exists
                At least two xdr files must be selected for image overlaying
 NFILE        - Number of files selected from the directory 

 EXAMPLE:
	SCAN2D_OVERLAY_SELECTFILES,xdrfile_array

(See scan2d_overlay.pro)


SCAN2D_OVERLAY[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SCAN2D_OVERLAY

 PURPOSE:
 	Using an overlay composite image reveals information about the
	superposition of the selected images of XDR 2D image files.

	The region of each 2D image may be different sizes.

	It allows the user to select multiple files from a list of 2D XDR 
	files each contains a 2D image and the corresponding X,Y,Value ranges, 
	then convert the selected images into same geometric scale, and  then
	costruct the display image as according to overlay, discrete, or 
	superpose composite.

 CATEGORY:
	Widgets.

 CALL SEQUENCE:
	SCAN2D_OVERLAY [,PATH=path] [,GROUP=Group] 

 KEYWORDS:
  PATH:         Specify the directory where XDR image files are located
  GROUP:        Specify the parent widget, the destroy of parent
                widget results the exiting of this program

 RESTRICTION:
	The XDR file must be created by XDR image generation program such as
	VIEW2D, VW2D, PLOT2D, IMAGE2D. Each image file consists of image 
	data array and corresponding X,Y,Value ranges which is written by 
	the XDR_WRITE routine (see xdr_open.pro)
 
	All the XDR files must be located in the same data directory.

	At most 15 image files can be selected at one time. The color table 
	spectrum is devided into 16 sub-tables. Each discrete image uses
	its sub color table. A user can use the slider bars and color table
	to manipulate the resultant image color display.

	For WIN system, a user always has to redraw the iamge to reflect 
	the new color table used.

 EXAMPLES:
	SCAN2D_OVERLAY,path='/home/beams/CHA/data/xxx/XDR'

 MODIFICATION HISTORY:
 	Written by:	Ben-chin Cha, July 17, 2002
	07-23-2004  bkc update drawing area when it is true color device

(See scan2d_overlay.pro)


SCANSEE::OVERLAY2D

[Previous Routine] [List of Routines]
 NAME:
	scanSee::Overlay2D

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

       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 small squares. Each colored filled small 
       square area represents a data point from the selected image (or 
       detector). So each composite area is composed of one data point
       from each selected detectors and they are arranged in row order. 

       The resultant composite image with width of ColxWidth squares,
       and height of RowxHeight squares. (each Detector dimension is 
       Width x Height)

       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 
       available 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 table associated with it, it is linearly
       divided into 16 levels. The detector value is linearly interpreted 
       by 16 levels (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 [1,2]
  DISCRETE: Draw each selected image seperately with min and max info

 RESTRICTION:
  The postscript "Print" button read the TV sceen and generate the PS output.
  The PS output only good for the screen size within  750x750 pixels.

  Color table is devided into 15 sub color table schemes. 

  Only 15 images can be passed into the scan2d_overlayImage program, a user
  has to select the desired sub-list images from the 85 detector list first.
  
  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 'Reset' button let user switch back to default overlay image color table.
  There are two sliders which allows the user to control the myColor table.
  The saved 'overlay.tbl' file is used for storing the current myColor table.
 
 EXAMPLES:
    The 2D image file is '/home/beams/CHA/data/xxx/cha_0001.mda'

    Example 1 - Read in the MDA 2D files generated by the IOC, and call
    the 2D overlay2D method for the file. Initailly user has to select
    the interested detectors (among the 85 detectors) at most 15 detectors 
    can be picked from the scroll list. 
    Then the 2D image overlay program pops up. 
    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/beams/CHA/data/xxx/cha_0001.mda' 
       v2 = obj_new('scanSee',file=filename)
       v2->panimage,/sel
       v2->overlay2d

    Example 2 - Instead of overlaying the image discrete images are
    displaied.

       v2->overlay2d,/discrete

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

    Example 3 - Plot detector 9's discrete image (pixel scaled by 4) 

	v2->overlay2d,pixels=4,selects=9,/discrete

    Example 4 - Plot discrete images of detectors 8,9,10 (pixel scaled by 4) 

	v2->overlay2d,pixels=4,selects=[8,9,10],/discrete

 MODIFICATION HISTORY:
 	Written by:	Ben-chin Cha, Jan 19, 1998.
	01-08-02      Add Print, Printer... button
                     Add slider control on myColor table used
                     Reset myColor will set myColor slider to bg=128, ratio=8

(See scan2d_overlay.pro)