
			        VW2D
                  (scanSee 2D Image  Displayer)

				OVERVIEW

VW2D is a complete mouse driven 2D image displayer for scanSee 2D 
data.  It provides very flexible 2D scan image accessing and
displaying. It also provides automatical hard copy generation.

For each 2D image it provides following types of IDL plot : TV, SURFACE, 
CONTOUR, SHOW3, XSURFACE, and TV Equal Aspect Ratio. The TV, surface and 
contour plot can either plot vs X,Y index or vs real X,Y values. 

For TV plot, it can be user scaled drawing area image or the actual 
pixel image. It defaults to drawing area scaled TV aspect ratio and the 
corresponding axis values are also plotted. It also provides various 
types of image data query options for user scaled equal TV plot. 

The drawing area is 460x400 pixels. The actual TV area is centered in
the drawing area with 300x300 pixels with equal left, right boundary 
margin of 80 pixels, and top, bottom of 50 pixels.
 

This program takes the 2D scan file which is automatically generated by
the IOC scan software. The acquired 2D scan data are saved as separate
file by IOC.  The number of images saved for a given 2D scan depends 
on the number of detector PV names defined for the first (inner loop) 
scan record. For a given 2D scan number there are at most 15 images.
Through a set of image buttons, it allows the user freely to point 
to any desired image data in the scan file. 


		  	   COLOR SCHEME

If vw2d is invoked by the runtime version of scanSee, only 32 color 
numbers are used by the vw2d. Otherwise as many colors as available by 
the IDL are used. For 24 bit visual display it uses 256 colors. 

If the color table has not been loaded into the IDL when vw2d is invoked, 
the default color table 39 (rainbow plus white) will be loaded into IDL 
by vw2d. Otherwise the current color table used by IDL will be used. 

Three color schemes allowed, The default option is same as the IDL TVSCL 
color scheme.  The maximum value is displayed in color of the largest 
index of the color table , the minimum value is displayed in color of the
lowest index of the color table.

IDL provides 40 conveninent color tables.  A user can use the Color Menu 
in vw2d to change the color table to fit his/her desire. 

			   SCAN FILE 

The 2D scan file used by VW2D is automatically created by the IOC scan 
saveData software.  The file name is determined by the saveData scan 
number and  the saveData fileSystem.



			    USER INTERFACE

The user interface is very simple, first use the File->Open menu to
select the 2D scan file and the total number of 2D images found in 
the file are printed and the data is properly setup. Then the 
last image in the scan will be displayed in the drawing area. If more 
then one images (detectors) were saved, the user can use the image 
button to access the desired images within the scan.

The function of each widget is briefly given below.

				File

The File pulldown menu consists of four selection items: 'Open ...',
'Printer ...', 'Print', 'PS_close', and 'Quit'.

The 'Open ...' button pops up the IDL file selection box which allows the 
user to select the 2D image file for viewing.  The default setting is
'catch1d.trashcan.image'.  

The 'Printer ...' button allows the user to override the default printer
for the postscript plot. Default color postscript file is generated.

The 'Print' button will create a post script plot 'vw2d.ps' and 
send a copy to the user's default printer. 

The 'PS_close' button closes the post script plot device, and restores
the X window plot device.
 
The 'Quit' button exits the VW2D program.


				Printer ...

This button brings up the setup PS printer dialog. Vw2d automatically 
uses the color PS device with 8 bit depth and the default printer attached
to the workstation is used. This dialog allows the user to override the
default settings. If printer name is not set the default is assumed.

The TV plot title and legend are using the first color from the color 
table. If the selected color table with first color as white, even though 
the TV plot shown as fine on the user visual display, the white plot title 
and legend are not readable on the PS plot. 
If this is the case the gv (ghostview) is automatically invoked by the 
printer setup to let user preview the PS plot. If text is not shown on the
gv display, the user has to select the reverse legend color to 'Y' on 
printer setup dialog then re-send the PS plot again.


				Color

This menu allows the user dynamically to load and change the color table 
used by the program. The default color table used by vw2d is 'Rainbow+
white'.

The Color pulldown menu consists of four selection items: 
'Save Private Color Table', 'Load Private Color Table',
'Change Color Table ...', and 'Z-range Scheme' sub-menu.

The 'Save Private Color Table' button will save the current color table
'pvtcolors.dat' at the startup directory.

The 'Load Private Color Table' button will load the private color table
'pvtcolors.dat' into IDL from the startup directory.

The 'Change Color Table ...' button pops up the IDL XLOADCT program which
allows the user have very flexible control on the color table used for 
current IDL session.

The 'Image Color Scheme ...' button pops up the image color scheme dialog.
There are three schemes: 'Auto Scaled", 'User Scaled', and 'Normalized'.
The auto scaled scheme uses the z-max and z-min of the data image.
The user scaled scheme let the user enter arbitrary Zmin/Zmax values for
linear color table translation. The normalized color scheme, let user
pick a detector then every value will be normalized against the value of
the selected detector. 


				Help

This menu gives this on-line help information.



			DROPLIST - View as

	TV 	    - view data as a 2D image
	Eq.TV.AspRt - view data as a 2D image with equal X,Y TV aspect 
		      ratio
	SURFACE     - view data as a surface plot
	CONTOUR     - view data as a contour plot
	SHOW3       - view TV + SURFACE + CONTOUR plot all together
        XSURFACE    - view data through XSURFACE which provides more viewing
                      controls 



			DROPLIST - Pixel

	By User  - TV image plot scaled pixel vs X and Y data ranges 
	By Image - TV image plot as real pixel 


			DROPLIST - Plot vs

	Values  - plot vs the x and y position values (SURFACE/CONTOUR)
	Step #  - plot vs the x and y step number (SURFACE/CONTOUR)



			ASCII ... Dialog

This button saves a ASCII file 'vw2d_data.txt' in the startup directory,
which shows image data corresponding to x, y values. Then it pops up 
a scroll terminal to show the contents of the ASCII file. 


			   ReNew Button

Press the 'ReNew' button turns off the zoom mode and the TV 
image will be drawn in the original VW2D default setting.



			   Images Group 

Images group consists of 15 buttons. For a given scan set at most
15 images are available. The actaul number of images depend on the scan 
record setup.  If the selected button with image it will be plotted right
away, it the selected button without image the error message window will
pop up. 



			    Drawing Area


The drawing area is used for displaying TV, SURFACE, CONTOUR, and SHOW3 
plot.  The XSURFACE uses its own drawing window.

In TV image mode, clicking the Left Mouse Button (LMB) in the drawing area 
will redraw the cursor cross-hair and update the X, Y, Z value widgets.

In TV image mode, click the Middle Mouse Button (MMB) in the drawing area 
will popup the XZ and YZ image value query windows and update the image 
information widgets: cursor location X, Y, and Z value.

In TV image mode, click the right mouse button in the drawing area will
draw a bounding box which can be re-sized and re-positioned by the mouse.
Click the right mouse button again will zoom the region enclosed by the
bounding box. 


			    PROBE XZ Button

The XZ button turns on the XZ query mode, a user must use the left mouse
button to query the X and Z values in the XZ profile window. The values 
at the cursor are updated beneath the XZ button.  The middle or right mouse 
button terminates this query mode.



			    PROBE YZ Button

The YZ button turns on the YZ query mode, a user must use the left mouse
button to query the Y and Z values in the YZ profile window. The values 
at the cursor are updated beneath the YZ button.  The middle or right mouse 
button terminates this query mode.


			    X, Y Plot Ranges

Four text fields Xmin, Xmax, Ymin, Ymax are settable by the user
which specifies the image index ranges shown in the drawing area. 
The default user plot range is Ymin=0, Ymax=100, Xmin=0, Xmax=100. 
The new value will be in effect as soon as the carriage return
is pressed.

Proper range must be entered.  If the values entered are outside the
x and y index range, the IDL will not be able to show the data.


                            Z Scale Color Range 

These fields are tightly coupled with the 'Image Color Scheme ...' dialog.
They are settable by the user only when it is in the UserScaled color mode.

The Zmin and Zmax text fields are used for linear color translation.
The Zmin is assigned to the first color, and Zmax is assigned to the 
last color. The TV value below Zmin will be shown in same color as Zmin,
above Zmax will be shown in same color as Zmax. 



                             PanImages Button

The PanImages Button pops up / updates the image-strip window to show 2D 
image of all detectors defined. Each detector has its own 2D TV image
based on its own data range. If no data available for the detector 
the text 'Di' is drawn instead. For detailed TV image use the image
button to select the desired detecor.


			    Information Block

The information block shows the information about current displayed
image. They include scan #, detector #, scan record PV names, 
1D root filename used, corresponding 1D scan range, image width, and 
height.


