#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 5623 of file processor.h.
|
Implements EMAN::FourierAnlProcessor. Definition at line 6007 of file processor.cpp. References EMAN::EMData::calc_radial_dist(), EMAN::EMData::do_fft(), EMAN::EMData::get_attr(), EMAN::XYData::get_x(), EMAN::XYData::get_yatx(), EMAN::EMData::get_ysize(), EMAN::EMData::is_complex(), EMAN::Util::save_data(), EMAN::XYData::set_x(), EMAN::XYData::set_y(), sqrt(), and EMAN::XYData::write_file(). 06007 { 06008 // The radial mask comes in with the existing radial image profile 06009 // The radial mask runs from 0 to the 1-D Nyquist (it leaves out the corners in Fourier space) 06010 06011 EMData *to = params["to"]; 06012 XYData *sf = new XYData(); 06013 float apixto = to->get_attr("apix_x"); 06014 06015 06016 if (to->is_complex()) { 06017 vector<float> rd=to->calc_radial_dist(to->get_ysize()/2.0,0,1.0,1); 06018 for (size_t i=0; i<rd.size(); i++) { 06019 sf->set_x(i,i/(apixto*2.0f*rd.size())); 06020 sf->set_y(i,rd[i]); 06021 } 06022 } 06023 else { 06024 EMData *tmp=to->do_fft(); 06025 vector<float> rd=tmp->calc_radial_dist(to->get_ysize()/2,0,1.0,1); 06026 for (size_t i=0; i<rd.size(); i++) { 06027 sf->set_x(i,i/(apixto*2.0f*rd.size())); 06028 sf->set_y(i,rd[i]); 06029 } 06030 delete tmp; 06031 } 06032 06033 float apix=image->get_attr("apix_x"); 06034 06035 sf->write_file("a.txt"); 06036 Util::save_data(0,sf->get_x(1),radial_mask,"b.txt"); 06037 06038 int n = radial_mask.size(); 06039 for (int i=0; i<n; i++) { 06040 if (radial_mask[i]>0) radial_mask[i]= sqrt(sf->get_yatx(i/(apix*2.0f*n))/radial_mask[i]); 06041 else if (i>0) radial_mask[i]=radial_mask[i-1]; 06042 } 06043 06044 Util::save_data(0,sf->get_x(1),radial_mask,"c.txt"); 06045 06046 delete sf; 06047 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 5632 of file processor.h. 05633 { 05634 return "Filters the image so its 1-D power spectrum matches a second image"; 05635 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5627 of file processor.h. 05628 {
05629 return NAME;
05630 }
|
|
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 5642 of file processor.h. References EMAN::TypeDict::put(). 05643 { 05644 TypeDict d; 05645 d.put("to", EMObject::EMDATA, "The image to match with. Make sure apix values are correct."); 05646 return d; 05647 }
|
|
Definition at line 5637 of file processor.h. 05638 { 05639 return new MatchSFProcessor(); 05640 }
|
|
Definition at line 186 of file processor.cpp. |