; SOURCE: mk.tom ; ; PURPOSE: Single or double tilt marker alignment ;------------------- Edit next 1 Input parameters ------------------------------ x21 = 2 ; For single angle series: 1, For double tilt: 2 ; ----------------------- Input files -------------------------------------------- FR G [rot]rotated/rot_*** ; Tilt image file template FR G [marker]rotated/d_rot*** ; Marker doc file template FR G [sel001]sel001 ; First series selection doc file FR G [ang001]ang001 ; First series angles doc file FR G [sel002]sel002 ; Second series selection doc file (if any) FR G [ang002]ang002 ; Second series angles doc file FR G [sel003]sel003 ; Combined series selection doc file (if any) FR G [ang003]ang003 ; Combined series angles doc file ; ---------------------- Output files ----------------------------------------------- FR G [viewerror1]viewerror_first ; Error per view output doc file FR G [viewerror2]viewerror_second ; Error per view output doc file FR G [errors1]errors_first ; Error per marker output doc file FR G [errors2]errors_second ; Error per marker output doc file FR G [cca1]cca002 ; Corrections output doc file FR G [cca2]ccb002 ; Corrections output doc file FR G [cra1]cra002 ; 3-D coords output doc file FR G [cra2]crb002 ; 3-D coords output doc file ; For double tilt ----- FR G [c3c202]c3c202 ; Corrections doc file FR G [angles_second]angles_second ; Corrected angular output doc file FR G [errors_both]errors_both ; Alignment/errors output file FR G [angles_both]angles_both ; Alignment angles output file ; ----------------- END BATCH HEADER ------------------------------------------- UD N, x11 ; Query number of angles in first series [ang001] DO LB1 x22=1,x11 ; Query zero tilt image number in first series UD IC x22, x30,x31,x32 ; Find angle number [ang001] ; Marker doc file (input) IF (x31 .EQ. 0.0) THEN x71=x22 ; Zero degree angle image number ENDIF LB1 VM echo " First series reference image: {***x71}" FI x40 ; Query image size (must be square) [rot]x71 ; aligned image 12 ; NSAM MK ; Marker alignment, for single tilt [marker] ; Marker file template (input) [sel001] ; Selection file (input) x71 ; Reference file number (usually zero-tilt image) x40,x40 ; Size of images YES ; Refine scale (vs reference)? NO ; Refine tilt angle (vs reference) YES ; Refine in-plane rotation YES ; Refine shift (vs reference) NO ; Use previous corrections NO ; Full output [viewerror1] ; Error per view doc file (output) [errors1] ; Error per marker doc file (output) [cca1] ; Corrections doc file (output) [cra1] ; 3-D coords doc file (output) IF (x21.LE.1) GOTO LB6 ; Stop if single tilt only -------------------- UD N, x11 ; Query number of files in second series [sel002] DO LB3 x23=1,x11 ; Loop over all files in second series UD IC x23, x22 ; Get angle number for this file [sel002] UD IC x22, x30,x31,x32 ; Find tilt angle [ang002] ; Angle doc file (input) IF (x31 .EQ. 0) THEN x72=x22 ; Zero degree angle GOTO LB4 ENDIF LB3 LB4 VM echo " Second series reference image: {***x72}" IF (x21.GE.2) THEN MK ; Marker alignment, for single tilt [marker] ; Marker file template (input) [sel002] ; Selection file (input) x72 ; Reference file number (usually zero-tilt image) x40,x40 ; Size of image YES ; Refine scale (vs reference)? NO ; Refine tilt angle (vs reference) YES ; Refine in-plane rotation YES ; Refine shift (vs reference) NO ; Use previous corrections NO ; Full output [viewerror2] ; Error per view doc file (output) [errors2] ; Error per marker doc file (output) [cca2] ; Corrections doc file (output) [cra2] ; 3-D coords doc file (output) ENDIF IF (x21.GE.2) THEN ; For double tilt using two angle series MK 3 ; Align two sets of markers for two-tilt geometry [cra1] ; First series marker doc file (input) [cra2] ; Second series marker doc file (input) [c3c202] ; Corrections doc file (output) [ang002] ; Second series angular doc file (input) [angles_second] ; Corrected angular doc file (output) [errors_both] ; Alignment/errors file (output) DOC MERGE ; Merge and renumber [ang001] [angles_second] [angles_both] ; Alignment angles output file (output) -1 ; Merge and renumber ENDIF LB6 ;---print out errors files to terminal vm head -20 [errors1].$DATEXT IF(x21.GE.2) THEN vm head -n20 [errors2].$DATEXT [errors_both].$DATEXT ENDIF EN