;centerb.ori ; center untilted particles with a blob ; which consists of a rotationally averaged 2D average. ; authors:m.radermacher and Montserrat Samso 8/2000 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> rr x66 ?blob size (radius)? fr ?interm shift docfile? <7> fr ?final shift docfile? <8> rr x70 ?reference dark (-1), light (1)? <9> ;register=0 for ar: x71=0 ;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 ;create blob mo _1 x30,x31 c x66 ;scale blob ar _1 _9 ((p1*x70)+x71) ; filter blob fq _9 _1 (3) (0.031) fq _1 _9 (4) (0.031) cp _9 blob001 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 x80=int(x72) x81=int(x73) sh f <1>x27 <5>x27 -x80,-x81 ; save the shift parameter sd x0,x80,x81,x40,x41 <8> lb3 re