#include <processor.h>
Inheritance diagram for EMAN::MatchSFProcessor:


Public Member Functions | |
| virtual string | get_name () const |
| Get the processor's name. | |
| virtual string | get_desc () const |
| Get the descrition of this specific processor. | |
| virtual TypeDict | get_param_types () const |
| Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
| Processor * | NEW () |
Static Public Attributes | |
| const string | NAME = "filter.matchto" |
Protected Member Functions | |
| void | create_radial_func (vector< float > &radial_mask, EMData *image) const |
| to | EMData object to match to. Make sure apix values are set properly |
Definition at line 5592 of file processor.h.
|
||||||||||||
|
Implements EMAN::FourierAnlProcessor. Definition at line 6073 of file processor.cpp. References EMAN::EMData::calc_radial_dist(), EMAN::EMData::do_fft(), EMAN::EMData::get_attr(), EMAN::XYData::get_yatx(), EMAN::EMData::get_ysize(), EMAN::EMData::is_complex(), EMAN::XYData::set_x(), EMAN::XYData::set_y(), and sqrt(). 06073 {
06074 // The radial mask comes in with the existing radial image profile
06075 // The radial mask runs from 0 to the 1-D Nyquist (it leaves out the corners in Fourier space)
06076
06077 EMData *to = params["to"];
06078 XYData *sf = new XYData();
06079 float apixto = to->get_attr("apix_x");
06080
06081
06082 if (to->is_complex()) {
06083 vector<float> rd=to->calc_radial_dist(to->get_ysize()/2.0f,0,1.0f,1);
06084 for (size_t i=0; i<rd.size(); ++i) {
06085 sf->set_x(i,i/(apixto*2.0f*rd.size()));
06086 sf->set_y(i,rd[i]);
06087 }
06088 }
06089 else {
06090 EMData *tmp=to->do_fft();
06091 vector<float> rd=tmp->calc_radial_dist(to->get_ysize()/2,0,1.0,1);
06092 for (size_t i=0; i<rd.size(); ++i) {
06093 sf->set_x(i,i/(apixto*2.0f*rd.size()));
06094 sf->set_y(i,rd[i]);
06095 }
06096 delete tmp;
06097 }
06098
06099 float apix=image->get_attr("apix_x");
06100
06101 // sf->write_file("a.txt");
06102 // Util::save_data(0,sf->get_x(1),radial_mask,"b.txt");
06103
06104 int n = radial_mask.size();
06105 for (int i=0; i<n; i++) {
06106 if (radial_mask[i]>0) radial_mask[i]= sqrt(sf->get_yatx(i/(apix*2.0f*n),false)/radial_mask[i]);
06107 else if (i>0) radial_mask[i]=radial_mask[i-1];
06108 }
06109
06110 // Util::save_data(0,sf->get_x(1),radial_mask,"c.txt");
06111
06112 delete sf;
06113 }
|
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 5601 of file processor.h. 05602 {
05603 return "Filters the image so its 1-D power spectrum matches a second image";
05604 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5596 of file processor.h. 05597 {
05598 return NAME;
05599 }
|
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::FourierAnlProcessor. Definition at line 5611 of file processor.h. References EMAN::TypeDict::put(). 05612 {
05613 TypeDict d;
05614 d.put("to", EMObject::EMDATA, "The image to match with. Make sure apix values are correct.");
05615 return d;
05616 }
|
|
|
Definition at line 5606 of file processor.h. 05607 {
05608 return new MatchSFProcessor();
05609 }
|
|
|
Definition at line 186 of file processor.cpp. |
1.3.9.1