; ; This function will add two disk images by means of interlacing every other ; row. Image1 will show all of the even rows and image2 will show all of the ; odd one. the final image is an interlacing of the two. ; FUNCTION it_interlace, img1, img2 sz1=SIZE(img1) sz2=SIZE(img2) temp=INTARR(sz1(1)>sz2(1),sz1(2)>sz2(2)) temp_sz=SIZE(temp) temp_xcen=temp_sz(1)/2 temp_ycen=temp_sz(2)/2 img1_xcen=sz1(1)/2 img1_ycen=sz1(2)/2 img2_xcen=sz2(1)/2 img2_ycen=sz2(2)/2 x_offset=temp_xcen-(img1_xcen < img2_xcen) y_offset=temp_xcen-(img1_ycen < img2_ycen) ;print,'x_offset=',x_offset ;print,'y_offset=',y_offset ;print,'Size img1=',sz1(1),sz1(2) ;print,'Size img2=',sz2(1),sz2(2) ;print,'Size temp=',temp_sz(1),temp_sz(2) IF (sz1(1) LT sz2(1)) THEN $ temp(x_offset:sz1(1)+(x_offset-1),y_offset:sz1(2)+(y_offset-1))=img1 ELSE $ temp(x_offset:sz2(1)+(x_offset-1),y_offset:sz2(2)+(y_offset-1))=img2 IF (sz1(1) LT sz2(1)) THEN $ img1=temp ELSE img2=temp tmp=img1 odd_arr=INDGEN(sz1(2) > sz2(2)) even_arr=odd_arr ;odd_arr(where(odd_arr MOD 2 EQ 0))=0 ;even_arr(where(even_arr MOD 2 NE 0))=0 ;img1(*,odd_arr)=img2(*,odd_arr) img1(*,where(odd_arr MOD 2 EQ 0))=img2(*,where(odd_arr MOD 2 EQ 0)) CATCH,error IF (error NE 0) THEN BEGIN print,'Found error in it_interlace' RETURN,img1 ENDIF IF (sz1(1) LT sz2(1)) THEN BEGIN img1(where(img1 EQ 0))=img2(where(img1 EQ 0)) img1(where(img1 EQ 128))=temp(where(img1 EQ 128)) ENDIF ELSE BEGIN img1(where(img1 EQ 0))=tmp(where(img1 EQ 0)) img1(where(img1 EQ 0))=temp(where(img1 EQ 0)) ENDELSE image=img1 RETURN,image END