pro triplets,log print,'' print,'This program prints triplets of the images in the current Log.' ;The program prints two rows of 6 image sets (36 total) per page. ; (hopefully one image cycle per page) cd,'',current=cdir & cd,cdir if n_params() eq 0 then log = cdir ;current log is the default cd,'DB/Image' print,'' print,'The Test Log is: ',log ;____________________________________________________________________________ ;List Files... spawn,'lsf',files,/noshell s=size(files) nfiles=fix(s(1)) numfiles=sstr(nfiles) ;numfiles=short string (nfiles) if files(0) eq '' then begin & print,'No files found' & goto,exit & endif print,'The number of Images in this log is: ',sstr(nfiles),' (1 thru ',sstr(nfiles),')' ;;print,'This will create about: ',sstr(nfiles/36+1),' pages of thumbnails. ',string(10b) imageno=0 print,'Which triplet do you want to print? ',imageno array_sort,files ;sorts files in assending order ;;ans='' ;;read,'Do you want to limit the images printed? (y or n): ',ans ;;a=1 ;a = first image printed ;;b=nfiles ;b = last image printed ;;again: ;;if ans eq 'y' then read,'Which images do you want to print? (first,last): ',a,b ;;if a lt 1 or b gt nfiles then begin ;; print,'Sorry thats out of range, please try again...' ;; goto,again ;;endif ;____________________________________________________________________________ ;Initalize... auto=1 ;for auto=1 tvscl min=0 ;the tvscl min setting max=4095 ;the tvscl max setting ilast=0 ;ilast is the previous value of i space=1.5 ;x spacing in inches sf=.75 ;scale factor (scales the size of the images on the page) ;____________________________________________________________________________ ;Loop that prints triplets ... set_plot,'ps' device,filename = '~/thumbnails.ps',/times,/landscape,/inches,bits_per_pixel=8 n=1 ;image-on-this-page counter j=1 ;page counter next_page: print,'Page ',sstr(j) for i=a-1,a+34 do begin ;i counts the images printed on this page file_no=i+36*(j-1) ;file_no=file being displayed ;print,'File No. = ',file_no+1 if file_no ge b then goto,exit ;done if n le 18 then ypos=0.15 else ypos=4.0 ;sets the y position for each row d_read,files(file_no),h,p ;set the image size, y offset, and x offset based on image type, ;to position SLI on top, MRI in the middle, and HRI on the bottom... type=d_value(h,96) if type eq 21 then size=1.0*sf ;typ='MRI ' if type eq 21 then yoff=256/176.*sf ;typ='MRI ' if type eq 21 then xoff=0. ;typ='MRI ' if type eq 22 then size=128./160.*sf ;typ='SLI ' if type eq 22 then yoff=2*256/176.*sf ;typ='SLI ' if type eq 22 then xoff=(176-128)/(176.*2)*sf ;typ='SLI ' if type eq 23 then size=160/176.*sf ;typ='HRI ' if type eq 23 then yoff=0. ;typ='HRI ' if type eq 23 then xoff=(176-160)/(176.*2)*sf ;typ='HRI ' p=rotate(p,2) ;just like DISR sees it if n gt 18 then set=6*space else set=0 ;resets to left margin for 2nd row tvscl,bytscl(p,min=min(p),max=2*mean(p),top=255),((n-1)/3*space)-set+xoff,ypos+yoff,xsize=size,/inches xyouts,(((n-1)/3*space)-set+xoff+.55*space)/9.5,(ypos+yoff+size/2)/7.,'#'+sstr(file_no+1),/norm n=n+1 endfor xyouts,0,0,'Images from '+log+': '+sstr(1+36*(j-1))+' thru '+sstr(36*j),/norm erase n=1 ;reset the image counter j=j+1 ;increment page counter goto,next_page ;____________________________________________________________________________ ;Done... exit: xyouts,0,0,'Images from '+log+': '+sstr(1+36*(j-1))+' thru '+sstr(b),/norm ;last page device,/close_file spawn,'lp ~/thumbnails.ps' set_plot,'x' ;returns to X windows environment print,'Done' cd,cdir end