;+ ; NAME: ; qView_Image ; PURPOSE: ; Display an image using qImage widget ; CATEGORY: ; ucsd/sat/idl/widget/qview ; CALLING SEQUENCE: PRO qView_Image, state, if_display=if_display ; INPUTS: ; state array[1]; structure ; qView state structure ; OPTIONAL INPUT PARAMETERS: ; /if_display if set then the image is only displayed if a qImage widget already exists ; OUTPUTS: ; (none) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, qImage, qView_GetInfo, qView_ImageInfo ; SIDE EFFECTS: ; The widget ID of the base widget of qImage is stored in the ; user value of state.wid_view. This ID is passed to qImage, ; which uses it to decide whether to create a new instance ; of qImage. ; PROCEDURE: ; STATE INFO USED: ; widget_control, state.wid_view, get_uvalue=wid_base, /no_copy ; widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy ; widget_control, state.wid_data, get_uvalue=data, /no_copy ; STATE INFO MODIFIED: ; widget_control, state.wid_active, set_uvalue=new, /no_copy ; widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy ; widget_control, state.wid_data, set_uvalue=data, /no_copy ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, if_display, /key widget_control, state.wid_view, get_uvalue=wid_base, /no_copy IF NOT if_display OR widget_info(wid_base, /valid) THEN BEGIN new = qView_ImageInfo(state, /active) ; Returns a valid active file index widget_control, state.wid_active, set_uvalue=new widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy file = allfiles[new,*] widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy IF NOT qView_GetInfo(state, offset=offset) THEN message, 'oops' widget_control, state.wid_diff, get_uvalue=dtype widget_control, state.wid_data, get_uvalue=data, /no_copy i = qView_ImageInfo(state, file=new, /first, /last, /incr) file = [file[0],'',file[1]] CASE dtype.value OF 0: j = i[0] ; Sngle image 1: j = i[1] ; Difference with first image 2: j = i[2] ; Difference with last image 3: j = (i[0]-i[3]) > i[1] ; Difference with previous image 4: j = (i[0]+i[3]) < i[2] ; Difference with next image ENDCASE i = i[0] CASE j EQ i OF 0: qImage, file, image=data[*,*,i]-data[*,*,j], group=state.wid_view, img_offset=offset, wid_base=wid_base 1: qImage, file, image=data[*,*,i] , group=state.wid_view, img_offset=offset, wid_base=wid_base ENDCASE widget_control, state.wid_data, set_uvalue=data, /no_copy ENDIF widget_control, state.wid_view, set_uvalue=wid_base, /no_copy RETURN & END