; b22.apc ; Rotate particles, prepare selection files for each group ; calculate group averages MD VB OFF VM rm -rf apca VM mkdir apca ; Set number of particles X92=789 ; Set number of groups X91=5 AP CA topa@**** 1-x92 1,25 0 F Y X91,100 apca/apca001 DO LB1 I=1,X92 UD IC,X0,X21,X22,X23,X24 apca/apca001 ; Rotate particles ; UKN - input image series, UKR - rotated images RT SQ topa@{****X21} apca/UKR@{****X21} X22 (0,0) LB1 ; Prepare selection files select*** ; select - particles in k'th group DO LB2 X71=1,X91 X81=0 DO LB3 X72=1,X92 UD IC,X72,X21,X22,X23,X24 apca/apca001 IF(X71.EQ.X24) THEN X81=X81+1 SD X81,X21 apca/select{***X71} ENDIF LB3 IF(X81.GT.0) THEN SD E apca/select{***X71} ENDIF LB2 UD ICE apca/apca001 ; Calculate the average for each goup (only if there are more than 2 ; particles) DO LB4 X71=1,X91 ; Check whether the file exists IQ FI,X72 apca/select{***X71} IF(X72.EQ.0.0) GOTO LB4 ; Get number of images in this group UD N,X72 apca/select{***X71} IF(X72.LE.2) GOTO LB4 AS DC apca/UKR@**** apca/select{***X71} A apca/avg{***X71} apca/var{***X71} LB4 EN