EMAN2
Public Member Functions | Static Public Member Functions | Protected Member Functions
EMAN::NewFourierProcessor Class Reference

Base class for Fourier processors. More...

#include <processor_sparx.h>

Inheritance diagram for EMAN::NewFourierProcessor:
Inheritance graph
[legend]
Collaboration diagram for EMAN::NewFourierProcessor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Static Public Member Functions

static string get_group_desc ()
 Get the description of this group of processors.

Protected Member Functions

virtual void preprocess (EMData *image)
virtual void preprocessandconvertpars (EMData *image)
virtual void setbutterworthdefaults (EMData *image)

Detailed Description

Base class for Fourier processors.

Parameters:
sigmaGaussian sigma (0-.5)
cutoff_absProcessor radius in terms of Nyquist (0-.5)
cutoff_pixelsWidth in Fourier pixels (0 - size()/2
cutoff_freqResolution in 1/A (0 - 1 / size*apix)
apixOverride A/pix in the image header (changes x,y and z)

Definition at line 87 of file processor_sparx.h.


Member Function Documentation

static string EMAN::NewFourierProcessor::get_group_desc ( ) [inline, static]

Get the description of this group of processors.

This function is defined in a parent class. It gives a introduction to a group of processors.

Returns:
The description of this group of processors.

Reimplemented from EMAN::Processor.

Definition at line 92 of file processor_sparx.h.

                {
                        return "Fourier Filter Processors are frequency domain processors. The input image can be either real or Fourier, and the output processed image format corresponds to that of the input file. FourierFilter class is the base class of fourier space processors. The processors can be either low-pass, high-pass, band-pass, or homomorphic. The processor parameters are in absolute frequency units, valid range is ]0,0.5], where 0.5 is Nyquist freqeuncy. ";
                }
TypeDict EMAN::NewFourierProcessor::get_param_types ( ) const [inline, virtual]

Get processor parameter information in a dictionary.

Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Reimplemented in EMAN::NewBandpassTopHatProcessor, EMAN::NewHomomorphicTopHatProcessor, EMAN::NewLowpassGaussProcessor, EMAN::NewBandpassGaussProcessor, EMAN::NewHomomorphicGaussProcessor, EMAN::SHIFTProcessor, EMAN::InverseKaiserI0Processor, EMAN::InverseKaiserSinhProcessor, EMAN::NewRadialTableProcessor, EMAN::NewLowpassButterworthProcessor, EMAN::NewHighpassButterworthProcessor, EMAN::NewHomomorphicButterworthProcessor, EMAN::NewLowpassTanhProcessor, EMAN::NewHighpassTanhProcessor, EMAN::NewHomomorphicTanhProcessor, EMAN::NewBandpassTanhProcessor, and EMAN::CTF_Processor.

Definition at line 97 of file processor_sparx.h.

References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().

                {
                        TypeDict d;
//                      d.put("cutoff_frequency", EMObject::FLOAT, "Absolute [0,0.5] cut-off frequency.");      //use cutoff_abs
                        d.put("sigma", EMObject::FLOAT, "Gaussian sigma (0-.5)");                                                       //use cutoff_abs
                        d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
                        d.put("cutoff_pixels", EMObject::FLOAT, "Width in Fourier pixels (0 - size()/2");
                        d.put("cutoff_freq", EMObject::FLOAT, "Resolution in 1/A (0 - 1 / size*apix)");
                        d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
                        return d;
                }
virtual void EMAN::NewFourierProcessor::preprocess ( EMData image) [inline, protected, virtual]

Definition at line 110 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), EMAN::Dict::has_key(), EMAN::Processor::params, and EMAN::EMData::set_attr().

Referenced by EMAN::NewHomomorphicTanhProcessor::process_inplace(), EMAN::NewHighpassTanhProcessor::process_inplace(), EMAN::NewLowpassTanhProcessor::process_inplace(), EMAN::NewInverseGaussProcessor::process_inplace(), EMAN::NewHomomorphicGaussProcessor::process_inplace(), EMAN::NewBandpassGaussProcessor::process_inplace(), EMAN::NewHighpassTopHatProcessor::process_inplace(), and EMAN::NewLowpassTopHatProcessor::process_inplace().

                                                        {
                        if(params.has_key("apix")) {
                                image->set_attr("apix_x", (float)params["apix"]);
                                image->set_attr("apix_y", (float)params["apix"]);
                                image->set_attr("apix_z", (float)params["apix"]);
                        }

                        const Dict dict = image->get_attr_dict();
                        if( params.has_key("sigma")) {
                                params["cutoff_abs"] = (float)params["sigma"];
                        }
                        else if( params.has_key("cutoff_abs") ) {
                                params["sigma"] = (float)params["cutoff_abs"];
                        }
                        else if( params.has_key("cutoff_freq") ) {
                                float val =  (float)params["cutoff_freq"] * (float)dict["apix_x"]; 
                                params["cutoff_abs"] = val;
                                params["sigma"] = val;
                        }
                        else if( params.has_key("cutoff_pixels") ) {
                                float val = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]);
                                params["cutoff_abs"] = val;
                                params["sigma"] = val;
                        }
                }
virtual void EMAN::NewFourierProcessor::preprocessandconvertpars ( EMData image) [inline, protected, virtual]

Definition at line 135 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), EMAN::Dict::has_key(), EMAN::Processor::params, EMAN::EMData::set_attr(), and sqrt().

Referenced by EMAN::NewHighpassGaussProcessor::process_inplace(), and EMAN::NewLowpassGaussProcessor::process_inplace().

                {
                        if(params.has_key("apix")) {
                                image->set_attr("apix_x", (float)params["apix"]);
                                image->set_attr("apix_y", (float)params["apix"]);
                                image->set_attr("apix_z", (float)params["apix"]);
                        }

                        const Dict dict = image->get_attr_dict();
                        if( params.has_key("sigma")) {
                                params["cutoff_abs"] = (float)params["sigma"];
                        }
                        else if( params.has_key("cutoff_abs") ) {
                                // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
                                float val = (float)params["cutoff_abs"] / sqrt(2.0f);
                                params["cutoff_abs"] = val;
                                params["sigma"] = val;
                                
                        }
                        else if( params.has_key("cutoff_freq") ) {
                                // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
                                float val =  (float)params["cutoff_freq"] * (float)dict["apix_x"] / sqrt(2.0f); 
                                params["cutoff_abs"] = val;
                                params["sigma"] = val;
                        }
                        else if( params.has_key("cutoff_pixels") ) {
                                // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
                                float val = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]) / sqrt(2.0f);
                                params["cutoff_abs"] = val;
                                params["sigma"] = val;
                        }
                }
virtual void EMAN::NewFourierProcessor::setbutterworthdefaults ( EMData image) [inline, protected, virtual]

Definition at line 167 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), EMAN::Dict::has_key(), log10(), and EMAN::Processor::params.

Referenced by EMAN::NewHighpassButterworthProcessor::process_inplace(), and EMAN::NewLowpassButterworthProcessor::process_inplace().

                {
                        float highlowratio = 0.15f;
                        const Dict dict = image->get_attr_dict();
                        
                        if(params.has_key("cutoff_abs") && !params.has_key("low_cutoff_frequency"))
                        {
                                params["low_cutoff_frequency"] = (float)params["cutoff_abs"];
                                
                                float val = (float)params["low_cutoff_frequency"];
                                params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;
                        }
                        
                        else if(params.has_key("cutoff_freq") && !params.has_key("low_cutoff_frequency"))
                        {
                                params["low_cutoff_frequency"] = (float)params["cutoff_freq"] * (float)dict["apix_x"];
                                
                                float val = (float)params["low_cutoff_frequency"];
                                params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;  
                        }
                        
                        else if(params.has_key("cutoff_pixels") && !params.has_key("low_cutoff_frequency"))
                        {
                                params["low_cutoff_frequency"] = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]);
                                
                                float val = (float)params["low_cutoff_frequency"];
                                params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;  
                        }
                        
                }

The documentation for this class was generated from the following file: