; GENERATE MATCHED FILTER ; ; FSC-masking adapted from JSL's makegauss.bat ; -------------------- Parameter -------------------- [radius] = -1 ; object radius for masking before FSC, pixels (use <0 to determine from PARAMS) ; --------------------- Inputs --------------------- fr l [parameter_doc]../params ; parameter file fr l [recon_dir]../Reconstruction ; output reconstruction directory fr l [odd_half_volume][recon_dir]/vol001_odd ; first half-set volume fr l [even_half_volume][recon_dir]/vol001_even ; second half-set volume ; --------------------- Output --------------------- fr l [matched_filter_doc][recon_dir]/docmatched_vol001 ; output matched-filter doc ; ---------------- END BATCH HEADER ---------------- vm echo "Generating matched-filter doc" ; date fr l [fsc_doc]tmpfscdoc ; get volume dimension ud 17,[idim] [parameter_doc] ; calculate center [center] = [idim]/2 + 1 ; calculate radius, if necessary if([radius].le.0) then ; get diameter from PARAMS ud 18,[part-diam] [parameter_doc] [radius] = [part-diam]/2 endif ud e ; close doc ; create Gaussian mo 3 _11 [idim],[idim],[idim] ; dimensions G ; _G_aussian [center],[center],[center] ; center coordinates [radius],[radius],[radius] ; Gaussian falloff ; get statistics fs [max] _11 ; lift maximum to 1 ar _11 _12 p1/[max] ; multiply volumes by mask mu [odd_half_volume] _12 ; INPUT: mask _21 ; OUTPUT * mu [even_half_volume] _12 ; INPUT: mask _22 ; OUTPUT * rf 3 [res-pix],[res-freq] _21 ; INPUT: odd_half_volume _22 ; INPUT: even_half_volume (1) ; ring width (NEEDS TO BE 1 unless volume padded) (0.8,1.2) ; scale-factor range C ; missing _C_one (90) ; maximum tilt angle (3) ; factor for noise comparison [fsc_doc] [res-pix] [res-freq] vm echo "Nominal resolution at 0.5FSC: {%f6.4%[res-freq]} pixels^-1" ; get #lines from resolution doc ud n, [num-fsc-lines] [fsc_doc] de ; clean up pre-existing file [matched_filter_doc] ; loop through Radii do lb1 [fsc-line]=3,[num-fsc-lines] ; get FSC (third column) ud ic [fsc-line], [spat-freq], [dummy], [fsc-value] [fsc_doc] ; write FSC to new document sd [fsc-line], [fsc-value], [spat-freq] [matched_filter_doc] lb1 ; end Radius-loop ; clean up ud ice [fsc_doc] de [fsc_doc] sd e [matched_filter_doc] en ; saving results file to refer back to nominal resolution ; Modified 2009-05-29 ; 2008-01-15 (trs) -- now stand-alone batch file