;center.ori ; center untilted particles with an external reference ; which consists of a rotationally averaged 2D average. ; authors:m.radermacher, D.bubeck 7/2/97 and Montserrat Samso 8/98 fr ?image names? <1> rr x10 ?first image number? <2> rr x11 ?last image number? <3> rr x50 ?mask radius? <4> fr ?output files? <5> fr ?external reference? <6> fr ?interm shift docfile? <7> fr ?final shift docfile? <8> ;look for first existing file in order to find out dimensions fi <1>x10 x30=x1 x31=x2 x32=x30/2+1 x33=x31/2+1 cp <6> _9 do lb3 x27=x10,x11 ma <1>x27 _3 x50 g a x32,x33 (3.5) cc _3 _9 _4 x51=(x30/2-x50)+2 ;(distance for edge exclusion) ; find peak of the cross-correlation pk c x40,x41 _4 (3,0) (10.,10.) y (2.) x51 ; shift the image sh f <1>x27 _5 -x40,-x41 ; save the shift parameter sd x0,x40,x41 <7> ma _5 _3 x50 g a x32,x33 (3.5) cc _3 _9 _6 x51=(x30/2-x50)+2 ;(distance for edge exclusion) ; find peak of the cross-correlation pk c x60,x61 _6 (3,0) (10.,10.) y (2.) x51 ; shift the image x72=x40+x60 x73=x41+x61 x70=int(x72) x71=int(x73) sh f <1>x27 <5>x27 -x70,-x71 ; save the shift parameter sd x0,x70,x71,x40,x41 <8> lb3 re