;------------------------------------------------------------- ;+ ; NAME: ; VIMGSEQ ; PURPOSE: ; Display a sequence of byte images. ; CATEGORY: ; CALLING SEQUENCE: ; imgseq ; INPUTS: ; Prompts for all inputs. in ; KEYWORD PARAMETERS: ; Keywords: ; XSIZE=sx Size of display window to use. ; YSIZE=sy The default is full screen. ; OUTPUTS: ; COMMON BLOCKS: ; NOTES: ; Notes: Images should be scaled byte images ; saved using the save2 procedure. A file ; with one image name per line should be setup. ; This file is the sequence file. After imgseq ; has read in the file names the images may be ; sequenced through by using to move RETURN forward, ; and SPACE to move backwards. Random access is ; also allowed. Experiment with the other options. ; MODIFICATION HISTORY: ; R. Sterner 3 Jan, 1990 ; R. Sterner, 7 Jun, 1990 --- converted to vms. ; ; Copyright (C) 1990, Johns Hopkins University/Applied Physics Laboratory ; This software may be used, copied, or redistributed as long as it is not ; sold and this copyright notice is reproduced on each copy made. This ; routine is provided as is without any express or implied warranties ; whatsoever. Other limitations apply as described in the file disclaimer.txt. ;- ;------------------------------------------------------------- pro vimgseq, xsize=sxsize, ysize=sysize, help=hlp if keyword_set(hlp) then begin print,' Display a sequence of byte images.' print,' imgseq' print,' Prompts for all inputs. in' print,' Keywords:' print,' XSIZE=sx Size of display window to use.' print,' YSIZE=sy The default is full screen.' print,' Notes: Images should be scaled byte images' print,' saved using the save2 procedure. A file' print,' with one image name per line should be setup.' print,' This file is the sequence file. After imgseq' print,' has read in the file names the images may be' print,' sequenced through by using to move RETURN forward,' print,' and SPACE to move backwards. Random access is' print,' also allowed. Experiment with the other options.' return endif ;----- setup defaults -------- last = !d.n_colors-1 ; Last color value. fwd = string(13b) ; Display forward (RETURN) bwd = string(32b) ; Display backward (SPACE) if n_elements(sxsize) eq 0 then sxsize = 1020 ; Full screen size. if n_elements(sysize) eq 0 then sysize = 840 ; for DEC WS 3100. oflag = 1 ; Turn outline off. ; ocolor = last-2 ; Outline color. ocolor = last ; Outline color. iflag = 0 ; No sequence file loaded. r = indgen(256) ; Current color table. g = r b = r wshow,0,0 ; Hide window 0. flag1 = 0 ; Window 1 does not exist. lxsize = 0 ; Last window size. lysize = 0 mflag = 0 ; Mouse flag. 0=keys, 1=mouse. dflag = 0 ; No image was displayed. loop: wdelete, 1 ; Hide window. flag1 = 0 ; Window hidden. dflag = 0 print,' ' print,' Image sequence display commands:' print,' s - enter sequence file. '+$ 'q - quit.' print,' RETURN - display next image. '+$ 'SPACE - display last image.' print,' = - redisplay current image. '+$ 'n - enter image number to display. ' print,' g - display an alignment grid. '+$ 'o - toggle window outline on/off.' print,' l - list images. '+$ '# - change window outline color.' print,' c - load color table. '+$ '? - list these commands.' print,' f - list sequence file format. '+$ '@ - debug stop.' print,' m - use mouse buttons to display forward and backward.' print,' ' loop2: k = get_kbrd(1) loop3: k = strlowcase(k) ;-------- load sequence file --------- if k eq 's' then begin wdelete,1 flag1 = 0 print,' ' print,' Load a sequence file' ff = '' read, ' Sequence file name: ',ff if ff eq '' then goto, loop2 get_lun, lun openr, lun, ff list = [''] name = '' while not eof(lun) do begin readf, lun, name name = repchr(name,' ') ; Replace tabs. name = repchr(name,',') ; Replace commas. list = [list, name] endwhile close, lun free_lun, lun list = list(1:*) inum = -1 lstnum = n_elements(list)-1 iflag = 1 print,' Sequence file loaded.' print,' There are '+strtrim(lstnum+1,2)+' images' goto, loop2 endif ;----- quit --------- if k eq 'q' then begin wdelete, 1 return endif ;----- display forward ---------- if k eq fwd then begin frwd: if iflag eq 0 then begin print,' Must first load a sequence file. Use s command.' goto, loop endif if inum ge lstnum then bell ; Image # out of range. di = 1 goto, dsply endif ;----- display backward ---------- if k eq bwd then begin bkwd: if iflag eq 0 then begin print,' Must first load a sequence file. Use s command.' goto, loop endif if inum le 0 then bell ; Image # out of range. di = -1 goto, dsply endif ;----- display number ---------- if k eq 'n' then begin if iflag eq 0 then begin print,' Must first load a sequence file. Use s command.' goto, loop endif wdelete,1 flag1 = 0 tmp = '' read,' Image number to display: ',tmp if tmp eq '' then begin print,' No display.' goto, loop endif inum = tmp + 0 inum = inum>00