PRO t_slice,mov,pilot,slice ; ;Visualization of a time-evolution of an interactively defined ;cut in a 3-D movie. ;Inputs: mov = 3-D movie ; pilot = seq.no. of the "pilot frame" in the movie ;Outputs: slice = an array with spatial axis X and time axis Y ;Called: function PROFIL to define graphically the cut, NINT. ; ;1 August 1995, Michal. siz=size(mov) ;get size of movie if (siz(0) ne 3) then begin print,'Input must be a 3-D movie. Stopped, type RETALL' stop endif sx=siz(1) ;size of movie in x sy=siz(2) ; and in y n =siz(3) ;number of frames erase tvscl,mov(*,*,pilot) ;show pilot frame ;------------------------------------------------------------------ ; zooming zoom: read,'ZOOM ? enter magnification (1-6):',zm zm=fix(zm) if zm le 1 then goto,nozoom if (sx lt 240/zm) or (sy lt 240/zm) then begin print,'image too small - select higher magnification or 1' goto,zoom endif print,'click cursor on the center of zoomed area' cursor,xc,yc,/dev,/down ll=[(xc-120/zm)>0,(yc-120/zm)>0] ;lower-left corner of zoomed area ur=ll+240/zm-1 ;upper-right " (in original coords.) if ur(0) gt sx-1 then begin ;(not to get outside the frame) ur(0)=sx-1 ll(0)=(ur(0)-240/zm+1)>0 endif if ur(1) gt sy-1 then begin ur(1)=sy-1 ll(1)=(ur(1)-240/zm+1)>0 endif zima=rebin(mov(ll(0):ur(0),ll(1):ur(1),pilot),240,240,/sample) window,2,xsize=240,ysize=240 tvscl,zima a=PROFIL(zima,x,y) ;get arrays of x,y along the cut x=long(x/zm)+ll(0) ;transformation to original coords. y=long(y/zm)+ll(1) wset,0 goto,output ;------------------------------------------------------------------- nozoom: a=PROFIL(mov(*,*,pilot),x,y) ;get arrays of x,y coords ; of points along the cut output: lc=n_elements(x) ;length of the cut print,'From:',x(0),y(0) print,'To: ',x(lc-1),y(lc-1) slice=fltarr(lc,n) ;create output array for i=0,n-1 do begin ;fill output array by values ima=mov(*,*,i) ; extracted according to slice(0,i)=ima(long(y)*sx+x) ; coords x,y endfor ;correction for the length of the inclined slice clc=nint(sqrt((x(lc-1)-x(0))^2 + (y(lc-1)-y(0))^2)) slice=congrid(slice,clc,n,cubic=(-0.5)) tvscl,slice,0 ;show slice end