pro jpegtriplets ;This program makes a jpeg file of the image that you select ; (along with its corrispoding triplet mates). ; The output file is: ~/triplet.jpg 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),')' window,0,xsize=250, ysize=850 again: file_no=0 read,'Which triplet do you want to print? (-1 to end): ',file_no if file_no eq -1 then goto,exit if file_no le 0 or file_no gt nfiles then begin & print,'out-of-range' & goto,again & endif array_sort,files ;sorts files in assending order ;____________________________________________________________________________ ;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) ypos=0.5 ;sets the y position for each row ;____________________________________________________________________________ ;find three matching files... filetime=strmid(files(file_no-1),13,13) ;stop triplets=t_getfil('*'+filetime+'*') & siz=size(triplets) & nfiles2=siz(1) if nfiles2 ne 3 then print,'Not a complete triplet' array_sort,triplets ;sorts files in assending order d_read,triplets(0),h,p0 ;MRI 176x256 or 254 d_read,triplets(1),h,p1 ;SLI 128x256 or 254 d_read,triplets(2),h,p2 ;HRI 160x256 or 254 p1=bytscl(p1,min=min(p1),max=2*mean(p1),top=255) p2=bytscl(p2,min=min(p2),max=2*mean(p2),top=255) p0=bytscl(p0,min=min(p0),max=2*mean(p0),top=255) p=intarr(176,768) s=size(p0) hight=s(2) p(24:151,0:hight-1)=p1 ;SLI p(0:175,hight:2*hight-1)=p0 ;MRI p(8:167,2*hight:3*hight-1)=p2 ;HRI p=rotate(p,2) ;rotate tvscl,bytscl(p,min=min(p),max=2*mean(p),top=255) write_jpeg,'~/triplet.jpg',p,quality=100 ;;stop goto,again exit: cd,cdir end