pro contour_image, NO_CM=nocm ; show current image from stack, ; update colormap, and display image information @common_blocks.inc widget_control, get_value = win_index, draw_area ; make it the current graphics window wset, win_index image = image_stack[0] ;; set correct size of drawing area ;if (image.xy_size ne xy_sl_size) then BEGIN ; widget_control, draw_area, $ ; draw_xsize=image.xy_size, draw_ysize=image.xy_size ; xy_sl_size = image.xy_size ;ENDIF min_data = image.min_data max_data = image.max_data ; check on the min and max values: IF N_ELEMENTS(mi_ma_base_id) GT 0 THEN $ IF widget_info(mi_ma_base_id,/VALID_ID) THEN BEGIN alive = widget_info(mi_ma_base_id, /REALIZED) IF alive THEN BEGIN widget_control, mi_ma_base_id, get_uvalue=state min_data = state.mi_ma(0) max_data = state.mi_ma(1) ENDIF ENDIF image_temp = BYTSCL(*image.image_d, $ MIN=min_data, MAX=max_data, TOP=!d.table_size-2) ;; Create contours ncontours = 10 x = findgen(xy_sl_size) y = x clevels = findgen(ncontours)*max(image_temp)/(ncontours-1.0) levels = findgen(ncontours)*(max_data-min_data)/(ncontours-1.0) + min_data labels = string(levels, format='(F8.2)') colors = round(levels / max_data * 255) PX = (!X.WINDOW * !D.X_VSIZE )[0] PY = (!Y.WINDOW * !D.Y_VSIZE )[0] pos = [px, py, px+xy_sl_size-1, py+xy_sl_size-1] contour, image_temp, x, y, c_colors=colors, levels=clevels, /device, $ position = pos, xstyle=1, ystyle=1 END ;.compile show_image