Previous IDL Reference Guide: Procedures and Functions Next

DRAW_ROI

Syntax | Arguments | Keywords | Examples | Version History

The DRAW_ROI procedure draws a region or group of regions to the current Direct Graphics device. The primitives used to draw each ROI are based on the TYPE property of the given IDLanROI object. The TYPE property selects between points, polylines, and filled polygons.

Syntax

DRAW_ROI, oROI [, /LINE_FILL] [, SPACING=value]

Graphics Keywords: [, CLIP=[X0, Y0, X1, Y1]] [, COLOR=value] [, /DATA | , /DEVICE | , /NORMAL] [, LINESTYLE={0 | 1 | 2 | 3 | 4 | 5}] [, /NOCLIP] [, ORIENTATION=ccw_degrees_from_horiz] [, PSYM=integer{0 to 10}] [, SYMSIZE=value] [, /T3D] [, THICK=value]

Arguments

oROI

A reference to an IDLanROI object to be drawn.

Keywords

LINE_FILL

Set this keyword to indicate that polygonal regions are to be filled with parallel lines, rather than using the default solid fill. When using a line fill, the thickness, linestyle, orientation, and spacing of the lines may be specified by keywords.

SPACING

The spacing, in centimeters, between the parallel lines used to fill polygons.

Graphics Keywords Accepted

See Graphics Keywords for the description of the following graphics and plotting keywords:

CLIP, COLOR, DATA, DEVICE, LINESTYLE, NOCLIP, NORMAL, ORIENTATION, PSYM, SYMSIZE, T3D, THICK

Examples

The following example displays an image and collects data for a region of interest. The resulting ROI is displayed as a filled polygon.

PRO roi_ex  
; Load and display an image.  
img=READ_DICOM(FILEPATH('mr_knee.dcm',SUBDIR=['examples','data']))   
TV, img  
  
; Create a polygon region object.  
oROI = OBJ_NEW('IDLanROI', TYPE=2)  
  
; Print instructions.  
PRINT,'To create a region:'  
PRINT,' Left mouse: select points for the region.'  
PRINT,' Right mouse: finish the region.'  
  
; Collect first vertex for the region.  
CURSOR, xOrig, yOrig, /UP, /DEVICE  
oROI->AppendData, xOrig, yOrig  
PLOTS, xOrig, yOrig, PSYM=1, /DEVICE  
  
;Continue to collect vertices for region until right mouse button.  
x1 = xOrig  
y1 = yOrig  
while !MOUSE.BUTTON ne 4 do begin  
   x0 = x1  
   y0 = y1  
   CURSOR, x1, y1, /UP, /DEVICE  
   PLOTS, [x0,x1], [y0,y1], /DEVICE  
   oROI->AppendData, x1, y1  
endwhile  
PLOTS, [x1,xOrig], [y1,yOrig], /DEVICE  
  
; Draw the the region with a line fill.  
DRAW_ROI, oROI, /LINE_FILL, SPACING=0.2, ORIENTATION=45, /DEVICE  
END  

 


Note
Also see Displaying ROI Objects in a Direct Graphics Window.

Version History

5.3
Introduced

  IDL Online Help (March 06, 2007)