#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static 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 5661 of file processor.h.
void MatchSFProcessor::create_radial_func | ( | vector< float > & | radial_mask, | |
EMData * | image | |||
) | const [protected, virtual] |
Implements EMAN::FourierAnlProcessor.
Definition at line 6187 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::Processor::params, EMAN::XYData::set_x(), EMAN::XYData::set_y(), and sqrt().
06187 { 06188 // The radial mask comes in with the existing radial image profile 06189 // The radial mask runs from 0 to the 1-D Nyquist (it leaves out the corners in Fourier space) 06190 06191 EMData *to = params["to"]; 06192 XYData *sf = new XYData(); 06193 float apixto = to->get_attr("apix_x"); 06194 06195 06196 if (to->is_complex()) { 06197 vector<float> rd=to->calc_radial_dist(to->get_ysize()/2.0f,0,1.0f,1); 06198 for (size_t i=0; i<rd.size(); ++i) { 06199 sf->set_x(i,i/(apixto*2.0f*rd.size())); 06200 sf->set_y(i,rd[i]); 06201 } 06202 } 06203 else { 06204 EMData *tmp=to->do_fft(); 06205 vector<float> rd=tmp->calc_radial_dist(to->get_ysize()/2,0,1.0,1); 06206 for (size_t i=0; i<rd.size(); ++i) { 06207 sf->set_x(i,i/(apixto*2.0f*rd.size())); 06208 sf->set_y(i,rd[i]); 06209 } 06210 delete tmp; 06211 } 06212 06213 float apix=image->get_attr("apix_x"); 06214 06215 // sf->write_file("a.txt"); 06216 // Util::save_data(0,sf->get_x(1),radial_mask,"b.txt"); 06217 06218 int n = radial_mask.size(); 06219 for (int i=0; i<n; i++) { 06220 if (radial_mask[i]>0) radial_mask[i]= sqrt(sf->get_yatx(i/(apix*2.0f*n),false)/radial_mask[i]); 06221 else if (i>0) radial_mask[i]=radial_mask[i-1]; 06222 } 06223 06224 // Util::save_data(0,sf->get_x(1),radial_mask,"c.txt"); 06225 06226 delete sf; 06227 }
virtual string EMAN::MatchSFProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 5670 of file processor.h.
virtual string EMAN::MatchSFProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 5665 of file processor.h.
References NAME.
05666 { 05667 return NAME; 05668 }
virtual TypeDict EMAN::MatchSFProcessor::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.
Reimplemented from EMAN::FourierAnlProcessor.
Definition at line 5680 of file processor.h.
References EMAN::EMObject::EMDATA, and EMAN::TypeDict::put().
05681 { 05682 TypeDict d; 05683 d.put("to", EMObject::EMDATA, "The image to match with. Make sure apix values are correct."); 05684 return d; 05685 }
static Processor* EMAN::MatchSFProcessor::NEW | ( | ) | [inline, static] |
const string MatchSFProcessor::NAME = "filter.matchto" [static] |