about applying low pass filter

824 views
Skip to first unread message

Shiwei Victor Zhu

unread,
Aug 8, 2018, 9:40:37 AM8/8/18
to EMAN2
Hi Steve,

A simple question:
e2proc3d.py -h 
shows an example of adding 10A low-pass filter:

e2proc3d.py threed.hdf threed.filt.hdf --process=filter.lowpass.gauss:cutoff_freq=0.1

I do not know is it related to pixel size or not.

If I have a 5A/pixel 3D map and would like to low pass to 10 A, cutoff_freq is 0.1 or 0.5.

Thanks

Victor

Steve Ludtke

unread,
Aug 8, 2018, 5:59:56 PM8/8/18
to em...@googlegroups.com
Hi Victor,
for highpass and lowpass filters, the filter radius in Fourier space can be specified in 3 (pick one) ways:

cutoff_abs - 0.5 = Nyquist
cutoff_freq - 1/spatial frequency in 1/Å, requires that A/pix is set correctly in image header
cutoff_pixels - radius in Fourier pixels

For Gauss lowpass there is also
cutoff_resolv - specify 1/resolvability in 1/Å rather than filter radius

If your map doesn't have the correct A/pix in the header (e2iminfo.py -H to check), just insert a --apix= option to e2proc3d to set it 


--------------------------------------------------------------------------------------
Steven Ludtke, Ph.D. <slu...@bcm.edu>                      Baylor College of Medicine 
Charles C. Bell Jr., Professor of Structural Biology
Dept. of Biochemistry and Molecular Biology                      (www.bcm.edu/biochem)
Academic Director, CryoEM Core                                        (cryoem.bcm.edu)
Co-Director CIBR Center                                    (www.bcm.edu/research/cibr)
Co-Director National Center For Macromolecular Imaging                  (ncmi.bcm.edu)



--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2

---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shiwei Victor Zhu

unread,
Aug 9, 2018, 8:20:20 AM8/9/18
to EMAN2
Hi Steve,

Thanks a lot. Yes, I did insertion of option of --apix in the case of cutoff_freq.
By the way, should I also have to insert --apix option when I use  cutoff_abs and cutoff_pixels.
Thanks again.

Victor

Steven Ludtke

unread,
Aug 9, 2018, 8:26:24 AM8/9/18
to em...@googlegroups.com
Not necessary.  The other two specifications don’t need apix for anything. Doing so will get the correct apix into the output image header, however, which isn’t a bad thing if it wasn’t already set.

Sent from my iPhone

Shiwei Victor Zhu

unread,
Aug 9, 2018, 11:37:36 AM8/9/18
to EMAN2
Thanks, Steve,

Very clear.
Best regards.


Victor

Shiwei Victor Zhu

unread,
Aug 9, 2018, 1:23:55 PM8/9/18
to EMAN2
Hi Steve,

Sorry for disturbing again,
I did lowpass filter as the below:
e2proc3d.py  In-5.49.mrc  Out-30eman2.mrc --apix=5.49 --process=filter.lowpass.gauss:cutoff_freq=0.18 --process=filter.lowpass.gauss:sigma=0.05
###this is for low pass to 30 A (3D map with 180 180 180 boxsize and 5.49A/voxel ). When I checked the map, it seems to be over-filtered.  Could you give me suggestion whehter i used this function right?
I attached the results from Imod's mtffilter function to low pass to 30A (mtffilter -3 -l "0.12 0.03" input putput).
I compare both filtered map. It seems e2proc3d.py over-filtered. Could you give me some hints? In other words, how can I testify the map I filtered using EMAN2 is really 30A lowpass filtered maps?
Thanks.

Victor

On Thursday, August 9, 2018 at 8:26:24 AM UTC-4, Steve Ludtke wrote:
mtffilter-0.12-0.03.tif
EMAN2-lp30.tif

Steve Ludtke

unread,
Aug 9, 2018, 2:10:43 PM8/9/18
to em...@googlegroups.com
Hi Victor,
this is a very strange command, you are doing 2 sequential Gaussian filters. The first, performs a low-pass filter to 5.5 Å, which with 5.5 Å/pix is at 2x Nyquist, and will have basically no impact at all. In general, however, the results of 2 sequential Gaussian filters will  be a Gaussian filter combining the two Gaussians as the sqrt of the sum of the reciprocals squared. ie - if you do a 10 Å lowpass Gaussian followed by another 10 Å lowpass Gaussian you will wind up with a 14 Å filter. Note that this would not be true, for example, of a tophat (also called sharp) where multiple filters are equivalent to the single lowest resolution filter.

That isn't what's happening here, though. You are specifying sigma=0.05, yet another way of specifying the filter radius. To see all of the options:

e2help.py processor filter.lowpass -v 2

If you are after a 30 Å low pass filter (that is, a filter with a Fourier half-width of 1/30 1/Å, which is what people commonly mean by this), you should just use a single

--process filter.lowpass.gauss:cutoff_freq=0.0333

Please also keep in mind that people frequently misunderstand what this means, and assumes that they will not be able to see 2 features separated by 30 Å in a map filtered in this way. Alas it does not mean that at all. There is a factor of ~2 between this this point and the specified Fourier filter radius.  Also note that if the map has already been filtered in some way that this Gaussian filter will be in addition to that other filter.
--------------------------------------------------------------------------------------
Steven Ludtke, Ph.D. <slu...@bcm.edu>                      Baylor College of Medicine 
Charles C. Bell Jr., Professor of Structural Biology
Dept. of Biochemistry and Molecular Biology                      (www.bcm.edu/biochem)
Academic Director, CryoEM Core                                        (cryoem.bcm.edu)
Co-Director CIBR Center                                    (www.bcm.edu/research/cibr)
Co-Director National Center For Macromolecular Imaging                  (ncmi.bcm.edu)


<mtffilter-0.12-0.03.tif><EMAN2-lp30.tif>

Sergii

unread,
Apr 22, 2021, 3:58:59 PM4/22/21
to EMAN2
Hi Steve,

A followup on this thread.
If I understand correctly the definition the LP filter is a gaussian exp(-(r-Radius)**2/(2.*sigma2**2)) where we need to provide the cut off (Radius) and fall off (sigma). By specifying gauss:cutoff_freq=0.0333 we providing Radius, however none of --process filter.lowpass examples features sigma fall off criteria. I presume there is a standard value used by e2proc3d.py. If so, what would it be? It becomes important if one needs to replicate the LP filtering in different program (mtffilter in IMOD), which requires both, cut off frequency and fall off criteria. 

Than you,

Sergii

Ludtke, Steven J.

unread,
Apr 22, 2021, 7:33:26 PM4/22/21
to em...@googlegroups.com
Hi Sergii,

The definitions we normally use are the generic cutoff specifiers:
cutoff_abs - 0.5 = Nyquist
cutoff_freq - 1/spatial frequency in 1/Å, requires that A/pix is set correctly in image header
cutoff_pixels - radius in Fourier pixels

All of these are specifying the spatial frequency at which the Gaussian falls to 1/e, but in different units. These options are available for all of the different lowpass/highpass filters, using the "natural" definition of the cutoff frequency for each one. Each processor often also has another definition of the cutoff specific to that processor. From:

e2help.py processor lowpass.gauss -v 2

"sigma" appears to be equivalent to cutoff_abs, which specifies the 1/e frequency in terms of Nyquist=0.5. 

The functional form of the filter is exactly the same in all of these cases, it is just a matter of how you specify the cutoff. Should be pretty trivial to interconvert to any other cutoff specification.

--------------------------------------------------------------------------------------
Steven Ludtke, Ph.D. <slu...@bcm.edu>                      Baylor College of Medicine 
Charles C. Bell Jr., Professor of Structural Biology
Dept. of Biochemistry and Molecular Biology                      (www.bcm.edu/biochem)
Academic Director, CryoEM Core                                        (cryoem.bcm.edu)
Co-Director CIBR Center                                    (www.bcm.edu/research/cibr)



Reply all
Reply to author
Forward
0 new messages