; a batch program that does SACF 2D alignment. ; Pawel Penczek Oct 2000 ; md set mem 800 md vb off ; ; number of images UD N,X19 select194 x20=100 ; image size x21=40 ; radius for alignment x25=8 ; number of iterations of the multireference alignment MO ; MASK for RF SN _9 x20,x20 C x21 ; create subdirectory for classification results & averages X81=1 VM echo "if(-d stepi{***x81}) rm -r stepi{***x81}"|csh VM mkdir stepi{***x81} ; copy all the images DO LB19 x92=1,x19 CP files/spi{***x92} acng/data002@{***x92} LB19 ; AS R acng/data002@**** 1-x19 A stepi{***x81}/AVG001 stepi{***x81}/VAR001 CP acng/data002@130 stepi{***x81}/AVG001 ; ; Calculate ACs MS _7@ 175,175 x19 ; _6 - original images MS _6@ x20,x20 x19 DO LB71 x92=1,x19 MA files/spi{***x92} _6@{***x92} (45) G C (51,51) (3.5) PD _6@{***x92} _1 (175,175) N (0.0) (38,38) AC NS _1 _7@{***x92} LB71 ; ; Iterate alignment DO LB8 x81=1,x25 x82=x81+1 ; ; Calculate AC of the current average FD stepi{***x81}/AVG001 _1 tanh MA _1 _3 (45) G C (51,51) (3.5) PD _3 _4 (175,175) B (38,38) AC NS _4 _1 FT _3 _4 VM echo "if(-d stepi{***x82}) rm -r stepi{***x82}"|csh VM mkdir stepi{***x82} ; Find all the angles DO LB73 x92=1,x19 OR 2,X51 _7@{***x92} _1 (5,75) (1) H ; Calculate CC with using the angle and angle+180 RT SQ _6@{***x92} _2 X51 (0,0) CC _2 _4 _3 PK X11,X12,X13,X14,X15,X16,X17 _3 (1,0) X52=X51+180 RT SQ _6@{***x92} _8 X52 (0,0) CC _8 _4 _3 PK X11,X12,X13,X14,X65,X66,X67 _3 (1,0) IF(X17.GT.X67) THEN RT SQ _6@{***x92} acng/data002@{***x92} X51 -X15,-X16 ELSE RT SQ _6@{***x92} acng/data002@{***x92} X52 -X65,-X66 ENDIF LB73 ; ; AS R acng/data002@**** 1-x19 A stepi{***x82}/AVG001 stepi{***x82}/VAR001 RT SQ stepi{***x82}/AVG001 _1 (180) (0,0 CC N stepi{***x82}/AVG001 _1 _3 PK X11,X12,X13,X14,X15,X16,X17 _3 (1,0) x15=-x15/2 x16=-x16/2 SH stepi{***x82}/AVG001 _1 X15,X16 CP _1 stepi{***x82}/AVG001 RF SN acng/data002@**** 1-x19 _9 (0.5) stepi{***x82}/rfsn001 LB8 RE