PRO qImage_cw_SmeiMask, state, event ;+ ; NAME: ; qImage_cw_SmeiMask ; PURPOSE: ; Write bitmap to file specifying the current SMEI fov ; CATEGORY: ; Compound widget qImage_cw ; CALLING SEQUENCE: ; qImage_cw_SmeiMask, state ; INPUTS: ; state array[1]; type: structure ; qImage_cw state structure ; event array[1]; type: structure ; event structure ; OUTPUTS: ; (binary file containing FOV mask) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; qImage_cw_Box, gridgen, Inside_Wedge, CheckDir, SetFileSpec, GetFileSpec, bin_write ; SEE ALSO: ; SMEI_camera ; PROCEDURE: ; The output file will always have the extension .pph ; ; The file written contains a byte array with the dimensions of the input ; images (the FULL image, even if only a part of the image is being processed). ; The mask value will be zero outside and 1 inside the FOV. ; ; The FOV center and optical axis are taken from the appropriate widgets. ; The FOV size is determined from a call to SMEI_camera. ; MODIFICATION HISTORY: ; JAN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- out = dialog_pickfile( $ dialog_parent=event.handler, $ file=filepath(root=getenv('TUB'),'smei_fov_mask.pph'), $ filter='*.pph', /fix_filter, $ path=getenv('TUB'), /write ) IF out[0] NE '' THEN BEGIN image_size = qImage_cw_Property(state, /image_size) qImage_cw_Box, state, img_center, p_box=fov, /center img_center = img_center+state.img_offset ; Rectangular pixel coordinates relative to img_cntr rr = gridgen(image_size, origin=img_center) rr = cv_coord(from_rect=rr, /to_polar) ; Convert the pixel centers to polar coordinates ; (phi is returned between -!pi and !pi) inside = Inside_Wedge(fov, rr) inside = reform(inside, image_size, /overwrite) out = out[0] IF CheckDir(out) THEN out = filepath(root=out, 'smei_fov_mask.pph') SetFileSpec, out out = GetFileSpec(upto='name')+'.pph' bin_write, out, inside ENDIF RETURN & END