It supports three types of ROI: rectangle, polygon, and pixel value range filter. Based on user selected type of ROI, it allows the user dynamically define and save the new ROI. It provides flexible ROI statistics calculation and report generations.
source /usr/local/rsi/idl_5.2/bin/idl_setupIn 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.
IDL>SCAN2D_ROI, IM ,X ,Y [,HEADER=header] [,COMMENT=comment]This commnad will automatically load the scan2d_roi.pro program into the IDL session . The variables IM specifies the 2D image array, and X, and Y specifies the corresponding X and Y vectors. The string variable header specifeds the description info about the IM. The string variable comment specifies any additional info about the IM. Before calling the SCAN2D_ROI, referal variables must be defined first.
ROI Mode: - Selects the desired type of ROI model and
updating the message infomation area.
MultiROIs...- Runs the MULTIROI_PICK program.
HELP... - Pops up the simple on-line help window.
Color... - Runs the XLOADCT to select/load the desired color table.
Done - Closes the 2D statistic ROI program.
The ROI saved by the 'Filter ROI' mode can directly be loaded into Multiroi_pick program. The filename used by filter mode is ended with '_roi.pickfltr' suffix.
Rectangle ROI: (Please refer message info area)
SaveRectROI - Save new rectangle ROI in ROIFile
(file name with '_roi.xdr' suffix)
Re-calculate the ROI statistics
Refresh - Refresh the drawing area and re-calculate the
ROI statistics based on the whole image area
ReadRectROI - Read rectanglar ROI from the defenition file
Re-calculate the ROI statistics
Filter ROI: (Please refer message info area)
SaveFltr - Save ROI defined by the range of low and high filters
(file name with '_roi.pickfltr' suffix)
ReadFltr - Read ROI defined by the range of low and high filters
from the saved file
Low: - Field indicates the low filter value
Re-calculate the ROI statistics
Slider - Sets the low filter value
Re-calculate the ROI statistics
High: - Field indicates the high filter value
Re-calculate the ROI statistics
Slider - Sets the high filter value
Re-calculate the ROI statistics
Polygon ROI: (Please refer message info area)
DefPolyROI&Save - Define polygon vertices by clicking the LMB and
close the ROI by clicking the RMB
Save polygon ROI in file end with the
'_roi.xdr.poly' suffix
Re-calculate the ROI statistics
ReadPolyROI - Read polygon ROI from saved file
Re-calculate the ROI statistics
Data:IM [n x m], Total= ... - default image dim and total
ROI:IM[n1:n2,m1:m2], Nelem=..., total=...
- ROI ranges, Nelem and total
ROI Ave: - ROI average value
ROI Dev: - ROI standard deviation value
ROI Min: - ROI minimum value
@x - X for ROI minimum
@y - Y for ROI minimum
vs Index#/Values - @ X / Y as Index#/Values
ROI Max: - ROI maximum value
@x - X for ROI maximum
@y - Y for ROI maximum
Comment: - Optional comment field for ROI
ROI Report Fields and Buttons Area contains the buttons and fields used to specify the filename of ROIFile and ROIRpt used.
ROIFile - Select/Enter ROI definition File ROIRpt - Select/Enter ROI report File RenameRpt... - Rename current ROI report file AppendRpt... - Append ROI statistic report to current ROIRpt file ViewRpt... - View ROI report file by using file selection dialog
The root file name 'tmp' mentioned in following sections can be replaced by any scanSee filename created by the IOC.
Tmp_roi.xdr contains a single vector. Rectangular bounding box region is defined by a vector of 6 numbers. It is defined as below for a rectangle ROI: x[0] - left bound pixel value x[1] - right bound pixel value x[2] - bottom bound pixel value x[3] - top bound pixel value x[4] - 300/width x[5] - 300/height where width - X dim of image data height - Y dim of image data tmp_roi.pickfltr contains three objects. The first array is dimensioned the same as the image array. The second number is the lower bound of the filter value. The third number is the upper bound of the filter value. bine[N,M] - a binary image element array 0 value falls outside the filter range 1 value falls inside the filter range lower_b - lower bound of filter range upper_b - upper bound of filter range Tmp_roi.xdr.poly contains two vectors. Polygonal region is defined by two vectors: xverts, and yverts. The number of elements of the vector depends on the sides of polygon. xverts - X pixel values of polygon vertices yverts - Y pixel values of polygon vertices
Vector in ROIFile is stored in XDR format and is created by calling the rountines defined in xdr_open program. TV image is drawn in a 300x300 pixel area.
Many ROI reports can be aggregated in one single file. Each 2D statistic report contains the time stamp, optional header and comment specifications, the variables describing the ROI defenition, and the statistic summary. The time stamp indicates the time and day the report was generated. The header echoes the header keyword specified on the command line about the image. The comment field entered in ROI program overrides the comment keyword specified on the command line.
The default ROI report file used will be tmp_roi.rpt. A user can override the default ROI report file through using the file selection dialog. A typical detailed ROI report content is given below, for the selected detector ROI, it includes the summary statistic report plus the list of elements included in the ROI.
====================================================
Generated at: Mon Apr 30 12:44:48 2001
Header: /home/beams/CHA/data/xxx/cha:_0002.scan
Image Seq # 5, 2D Scan # 2, Detector # 5 (D5)
Comment:
ROI: Rectangle region defined in
/home/beams/CHA/data/xxx/ROI/cha:_0002.scan_roi.xdr
ROI in index: [3:6, 3:6]
ROI in values: [-1.00000:1.00000, -1.00000:1.00000]
ave = 0.508727
dev = 0.268809
min = 0.155944
max = 0.890931
total = 8.13964
nelem = 16
N I J IM(I,J) IM(I,J)-ave ROI
---------------------------------------------------
0 3 3 0.155944 -0.352784 RECT
1 4 3 0.494017 -0.0147103 RECT
2 5 3 0.494017 -0.0147103 RECT
3 6 3 0.155944 -0.352784 RECT
4 3 4 0.494017 -0.0147103 RECT
5 4 4 0.890931 0.382204 RECT
6 5 4 0.890931 0.382204 RECT
7 6 4 0.494017 -0.0147103 RECT
8 3 5 0.494017 -0.0147103 RECT
9 4 5 0.890931 0.382204 RECT
10 5 5 0.890931 0.382204 RECT
11 6 5 0.494017 -0.0147103 RECT
12 3 6 0.155944 -0.352784 RECT
13 4 6 0.494017 -0.0147103 RECT
14 5 6 0.494017 -0.0147103 RECT
15 6 6 0.155944 -0.352784 RECT
====================================================
Generated at: Mon Apr 30 12:54:35 2001
Header: /home/beams/CHA/data/xxx/cha:_0002.scan
Image Seq # 5, 2D Scan # 2, Detector # 5 (D5)
Comment:
ROI: Polygon region defined in
/home/beams/CHA/data/xxx/ROI/cha:_0002.scan_roi.xdr.poly
Xverts index: 5 3 5 7
Yverts index: 7 5 3 5
ave = 0.626322
dev = 0.195427
min = 0.494017
max = 0.890931
total = 7.51586
nelem = 12
N I J IM(I,J) IM(I,J)-ave ROI
------------------------------------------------------------
0 4 3 0.494017 -0.132305 POLY
1 5 3 0.494017 -0.132305 POLY
2 3 4 0.494017 -0.132305 POLY
3 4 4 0.890931 0.264610 POLY
4 5 4 0.890931 0.264610 POLY
5 6 4 0.494017 -0.132305 POLY
6 3 5 0.494017 -0.132305 POLY
7 4 5 0.890931 0.264610 POLY
8 5 5 0.890931 0.264610 POLY
9 6 5 0.494017 -0.132305 POLY
10 4 6 0.494017 -0.132305 POLY
11 5 6 0.494017 -0.132305 POLY