VW2D Program [TOC]


by Ben-chin Cha (05/03/2001)


INTRODUCTION


The vw2d program provides the IDL user with a widget application package for flexibly 2D image processing features for an input 2D scan file. The 2D scan file must be automatically saved by the scan software in XDR format by the IOC scan software.

It provides various 2D image display features, flexible 1D/2D report generation, PS plots generation. Various 1D/2D after data displaying or processing programs can be automatically invoked by the vw2d.

The user interface for vw2d is very similar to view2d except the input file is saved in different format. The vw2d input file is saved by the IOC and view2d input file is saved by the data catcher. The vw2d handles up to 85 detectors while the catcher only supports 15 detectors.

Command Syntax

Please refer User's Reference Guide for VW2D for command syntax.




SYSTEM SETUP

Setup Requirement for Unix System

At APS all IDL programs are installed in the /usr/local/epics/extensions/bin/$HOST_ARCH directory. For proper operation of these programs, a user first has to make sure that the IDL 5.0 or later is used. For example, use IDL 5.2 release, set the following :
 
	source /usr/local/rsi/idl_5.2/bin/idl_setup 
	
In order to access IDL programs installed in the local epics/extensions/bin, a user has to make sure that the following two environment variables are set before invoking IDL :
         setenv EPICS_EXTENSIONS /usr/local/epics/extensions
         setenv IDL_STARTUP $EPICS_EXTENSIONS/bin/$HOST_ARCH/viewer_startup.pro 
	
and make sure the directory /usr/local/epics/extensions/bin/$HOST_ARCH is in his/her IDL search path.

Access VW2D Program

To access the vw2d program in IDL just enter the following command at the IDL prompt:
    IDL> vw2d [,File=file] 
This commnad will automatically load the vw2d.pro program into IDL. If the input file name is specified on the command line, then the file will be automatially loaded into vw2d. If not input file specified at the command line, the user should use File->Open... file to select the desired 2D scan file.

USER INTERFACE

File Menu

	Open...            - Load scan file into vw2d 
	Save Image for AIM - Export image for AiM program 
	Save as TIFF       - Save image as TIFF file
	Save as R-TIFF     - Save image as reverse TIFF file
	Save as XDR        - Save image in XDR format by xdr_write 
	Save as XDR        - Save image in XDR format by xdr_write 
	Printer...         - Set up output printer name
	Print              - Dump image to PS printer
	PS Close           - Call PS_close routine to enforce PS close
	Quit               - Close vw2d program

Color Menu

	Save Private Color Table - Save current color table in 'pvtcolors.dat'
	Load Private Color Table - Load private color table from 'pvtcolors.dat'
	Change Color Table       - Call xloadct to change color table
	Image Color Scheme       - Call view2d_normalize routine 

Help Menu

	Help...       -  Display the online help file vw2d_help.txt 

View as (Droplist Menu)

Set 2D image display method. Plot2d program has its own plot window.
	TV               - Display as TV image (default)
	Eq.Tv.AspRt      - Display as TV image with equal aspect ratio
	LIGHT_SHADE_SURF - Display image as light shade surface plot
	CONTOUR          - Call contour plot
	SHOW3            - Call show3 plot 
	PLOT2D...        - Call plot2d widget program  
	SHADE_SURF       - Call shade surface plot

Pixel (Droplist Menu)

	By User       - TV image scaled by user plot range (default)
	By Image      - TV image plotted as actual pixels  

Plot vs (Droplist Menu)

	Values        - TV Axis as real values (default)
	Step #        - TV Axis as index # 

Detector Control Options

	ASCII...        - Display the 2D ASCII data in a CW_TERM window
                          with option of saving output ascii file
	ReNew           - Refresh TV plot in drawing area 
	Detector List   - Select desired detector among 85 detectors
	Images Sublist  - Select among the first 15 detectors 

Data Display Areas

This area consists of TV drawing area and image cursor info area.

Drawing Area

The drawing area is 460x400 pixels. The TV image area is centered at the drawing area with 300x300 pixels, with 80 pixels of left and right margin, 50 pixels top and bottom margin respectively. The max, min values of the image are displayed at the top left corner of the drawing area. A color bar is drawn on the right margin to show the color scheme with scaled values displayed.

Three mouse buttons system is assumed (Left, Middle, Right Mouse Buttons). Click the mouse button in the drawing area results:

	LMB - Query the cursor values, 
	MMB - Pop up XZ,YZ line plots window at the cursor,
	RMB - Zoom in TV image area at the cursor.

Image Cursor Info Area

	MIN  Z:      - Show MIN value @ I,J index location
	MAX  Z:      - Show MAX value @ I,J index location
	Cursor @ X   - Show cursor's X value 
	Cursor @ Y   - Show cursor's Y value
	Z:	     - Show cursor's Z value 
	PROBE: XZ    - Probe XZ curve values at cursor X,Y
	PROBE: YZ    - Probe YZ curve values at cursor X,Y

Image Range Controls

The displayed TV image region can be controlled by the range of start and end indices. Therefore investigate a smaller sub-region of a 2D image is possible by adjusting the Xmin, Xmax, Ymin, and Ymax index fields.
	Xmin    - Set start X index #
	Xmax    - Set end X index #
	Ymin    - Set start Y index #
	Ymax    - Set end Y index #
	Zmin    - Display the Zmin of 2D image array
	Zmax    - Display the Zmax of 2D image array

PanImage Menu

	PanImages...    - Call panimage_sel widget program
	Calibration...  - Call calibration_factor widget program

2D ROI Menu

Two kind of summary reports can be generated: selected single detector or all detectors defined. The report generated from the button within the scan2d_roi program is applied only to the detector's ROI selected. The report generated by the AppendRpt... or ReplaceRpt... is for all detectors assumed with the same ROI picked.
	Help...       - Show help on scan2d_roi program
	ROI...        - Pops up scan2d_roi program for the selected detector
	Type Menu     - Set the type of ROI used in summary calculation
	     ->RectROI 
	     ->FilterROI 
	     ->PolyROI 
	AppendRpt...  - Append all detectors ROI summary to report
	ReplaceRpt... - Overwrite file with new ROI summary report 
	ViewRpt...    - Open and display any existing ROI report
	RenameRpt...  - Rename the ROI report file to a new filename

Fitting Menu

	Ez_fit     - Call ez_fit widget program
	2D Binary  - Save 2D XDR binary data in file 'fitting.bin'

Scroll Info Text

This area displays the file currently opened by the vw2d. The summary info about the 2D scan is displayed here, it includes filename, scanno, image number, 2D image size, detector number, etc.

FILES GENERATED

Various files can be generated by this program. Temporary files are created in the current startup working directory. The permanent files are stored in sub-directories. The sub-directory used includes : CALIB, ASCII, ROI, XDR, TIFF and PICT.
The calibration program generated files are stored under the CALIB 
sub-directory. 
The ROI programs generated files are stored under the ROI sub-directory. 
The ASCII data files are stored under the ASCII sub-directory.
The saved image TIFF file are stored under the TIFF sub-directory.
The saved image PICT file are stored under the PICT sub-directory.
The saved image XDR file are stored under the XDR sub-directory.

If the sub-directory is not found, it will be automatically created for user on UNIX system, on W95 a user has to create it manually.

On UNIX system the program tries to create the sub-directory under the source data directory first, if the user has no write permission then it will try to create the sub-directory where the program was invoked.