;+ ; NAME mouse_poly ; ; FUNCTION Define polygon vertices using the mouse. ; ; HISTORY Andrew L. Stanger 5 February 1999 ; 18 Feb 1999: Write pvfile name to log file. ;- PRO mouse_poly5, xdim_cme, ydim_cme, $ aoinum, logfile, pvfile, xv, yv, nver, polypix print, 'Create a polygon for mass integration by clicking with the mouse.' ; print, "Click with left mouse button to define polygon vertices." ; print, "Click with right mouse button to terminate the polygon." ;--- Define Region-of-interest (ROI). ; Return an array of pixel coordinates. polypix = DEFROIC (xdim_cme, ydim_cme, xv, yv, /NOFILL) size_xv = size (xv) nver = size_xv [1] ;--- Write Region information into log file. OPENW, lulog, logfile, /GET_LUN PRINTF, lulog, 'Mouse-Defined Polygon Region: ', $ STRING (aoinum, FORMAT='(I3)') PRINTF, lulog, 'polygon vertex file: ', pvfile CLOSE, lulog FREE_LUN, lulog ;--- Write polygon vertices into a disk file. store_poly, pvfile, xv, yv, nver RETURN END