; Adapted from PFILT.BAT ; apply low pass filter to and shrinks a set of particle images ; ----------------- Parameters ----------------- x11 = 7 ; filter type (7==Butterworth, 5==Fermi, 3==Gaussian, 1==tophat) x15 = 2.82 ; pixel size, Angstroms x21 = 37.6 ; filter parameter 1, Angstroms (pass-band if Butterworth, else filter radius) x22 = 28.2 ; filter parameter 2, Angstroms ; stop band for Butterworth, temperature for Fermi, else not required x26 = 2 ; reduction/decimation factor (integer) x56 = 10000 ; progress interval -- message written to screen every (x56)th particle ; ------------------- Inputs ------------------- fr l [group_particles]listparticles ; slice-to-particle lookup-table, for each group fr l [unfiltered]../Alignment/dala01_{***x77}@***** ; unfiltered-image template (unstacked or stacked) ; ------------------- Output ------------------- fr g [filtered_dir]flt ; filtered directory fr l [filtered][filtered_dir]/flt****** ; filtered-image prefix (unstacked) ; -------------- END BATCH HEADER -------------- vm echo "Filtering images"; date ; change filter radii to reciprocal pixels x21 = x15/x21 ; pass-band x22 = x15/x22 ; stop-band ; x15==pixel-size md set mp (0) vm echo "if(! -d [filtered_dir]) mkdir -p [filtered_dir]"|csh ; get #particles (x50) ud n,x50 [group_particles] ; loop through particles do lb1 x44=1,x50 ; get particle# (x55) ud ic,x44,x55 [group_particles] if (int(x44/x56).eq.x44/x56) then vm echo "Working on {******x44}th particle out of {******x50}" endif cp [unfiltered]x44 _5 ; if Butterworth filter IF (x11.eq.7) THEN FQ np _5 ; input file _4 ; output file x11 ; filter type x21,x22 ; passband, stopband endif ; if Fermi filter IF (x11.eq.5) THEN FQ np _5 ; input file _4 ; output file x11 ; filter type = Fermi x21 ; filter radius x22 ; temperature cutoff endif ; if Gaussian or top-hat filter IF (x11.le.3) THEN FQ np _5 ; input file _4 ; output file x11 ; filter type = top hat, Gaussian x21 ; filter radius ENDIF dc s _4 [filtered]x55 x26,x26 ; reduction factor in x,y lb1 ; end particle-loop ; close doc ud ice [group_particles] vm echo "Done"; date EN D ; Modified 2008-04-13 ; 2008-04-06 (trs) -- adapted from filtershrink.spi