Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::NewFourierProcessor Class Reference

#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

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)

Member Function Documentation

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 86 of file processor_sparx.h.

00087                 {
00088                         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. ";
00089                 }

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 91 of file processor_sparx.h.

References EMAN::TypeDict::put().

00092                 {
00093                         TypeDict d;
00094 //                      d.put("cutoff_frequency", EMObject::FLOAT, "Absolute [0,0.5] cut-off frequency.");      //use cutoff_abs
00095                         d.put("sigma", EMObject::FLOAT, "Gaussian sigma (0-.5)");                                                       //use cutoff_abs
00096                         d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
00097                         d.put("cutoff_pixels", EMObject::FLOAT, "Width in Fourier pixels (0 - size()/2");
00098                         d.put("cutoff_freq", EMObject::FLOAT, "Resolution in 1/A (0 - 1 / size*apix)");
00099                         d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
00100                         return d;
00101                 }

virtual void EMAN::NewFourierProcessor::preprocess EMData image  )  [inline, protected, virtual]
 

Definition at line 104 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), and EMAN::EMData::set_attr().

00104                                                         {
00105                         if(params.has_key("apix")) {
00106                                 image->set_attr("apix_x", (float)params["apix"]);
00107                                 image->set_attr("apix_y", (float)params["apix"]);
00108                                 image->set_attr("apix_z", (float)params["apix"]);
00109                         }
00110 
00111                         const Dict dict = image->get_attr_dict();
00112                         if( params.has_key("sigma")) {
00113                                 params["cutoff_abs"] = (float)params["sigma"];
00114                         }
00115                         else if( params.has_key("cutoff_abs") ) {
00116                                 params["sigma"] = (float)params["cutoff_abs"];
00117                         }
00118                         else if( params.has_key("cutoff_freq") ) {
00119                                 float val =  (float)params["cutoff_freq"] * (float)dict["apix_x"]; 
00120                                 params["cutoff_abs"] = val;
00121                                 params["sigma"] = val;
00122                         }
00123                         else if( params.has_key("cutoff_pixels") ) {
00124                                 float val = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]);
00125                                 params["cutoff_abs"] = val;
00126                                 params["sigma"] = val;
00127                         }
00128                 }

virtual void EMAN::NewFourierProcessor::preprocessandconvertpars EMData image  )  [inline, protected, virtual]
 

Definition at line 129 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), EMAN::EMData::set_attr(), and sqrt().

00130                 {
00131                         if(params.has_key("apix")) {
00132                                 image->set_attr("apix_x", (float)params["apix"]);
00133                                 image->set_attr("apix_y", (float)params["apix"]);
00134                                 image->set_attr("apix_z", (float)params["apix"]);
00135                         }
00136 
00137                         const Dict dict = image->get_attr_dict();
00138                         if( params.has_key("sigma")) {
00139                                 params["cutoff_abs"] = (float)params["sigma"];
00140                         }
00141                         else if( params.has_key("cutoff_abs") ) {
00142                                 // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
00143                                 float val = (float)params["cutoff_abs"] / sqrt(2.0f);
00144                                 params["cutoff_abs"] = val;
00145                                 params["sigma"] = val;
00146                                 
00147                         }
00148                         else if( params.has_key("cutoff_freq") ) {
00149                                 // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
00150                                 float val =  (float)params["cutoff_freq"] * (float)dict["apix_x"] / sqrt(2.0f); 
00151                                 params["cutoff_abs"] = val;
00152                                 params["sigma"] = val;
00153                         }
00154                         else if( params.has_key("cutoff_pixels") ) {
00155                                 // Here I have added a patch 1/sqrt(2) to compensate for the different Gaussian used in EMAN1 vs EMAN2 (John Flanagan)
00156                                 float val = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]) / sqrt(2.0f);
00157                                 params["cutoff_abs"] = val;
00158                                 params["sigma"] = val;
00159                         }
00160                 }

virtual void EMAN::NewFourierProcessor::setbutterworthdefaults EMData image  )  [inline, protected, virtual]
 

Definition at line 161 of file processor_sparx.h.

References EMAN::EMData::get_attr_dict(), and log10().

00162                 {
00163                         float highlowratio = 0.15f;
00164                         const Dict dict = image->get_attr_dict();
00165                         
00166                         if(params.has_key("cutoff_abs") && !params.has_key("low_cutoff_frequency"))
00167                         {
00168                                 params["low_cutoff_frequency"] = (float)params["cutoff_abs"];
00169                                 
00170                                 float val = (float)params["low_cutoff_frequency"];
00171                                 params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;
00172                         }
00173                         
00174                         else if(params.has_key("cutoff_freq") && !params.has_key("low_cutoff_frequency"))
00175                         {
00176                                 params["low_cutoff_frequency"] = (float)params["cutoff_freq"] * (float)dict["apix_x"];
00177                                 
00178                                 float val = (float)params["low_cutoff_frequency"];
00179                                 params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;  
00180                         }
00181                         
00182                         else if(params.has_key("cutoff_pixels") && !params.has_key("low_cutoff_frequency"))
00183                         {
00184                                 params["low_cutoff_frequency"] = (0.5f*(float)params["cutoff_pixels"] / (float)dict["nx"]);
00185                                 
00186                                 float val = (float)params["low_cutoff_frequency"];
00187                                 params["high_cutoff_frequency"] = highlowratio*log10(1.0f/val) + val;  
00188                         }
00189                         
00190                 }


The documentation for this class was generated from the following file:
Generated on Tue Jul 12 13:53:07 2011 for EMAN2 by  doxygen 1.3.9.1