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

EMAN::MatchSFProcessor Class Reference

Sets the structure factor To match a second provided image/volume. More...

#include <processor.h>

Inheritance diagram for EMAN::MatchSFProcessor:

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

Collaboration graph
[legend]
List of all members.

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

ProcessorNEW ()

Static Public Attributes

const string NAME = "filter.matchto"

Protected Member Functions

void create_radial_func (vector< float > &radial_mask, EMData *image) const

Detailed Description

Sets the structure factor To match a second provided image/volume.

Parameters:
to EMData object to match to. Make sure apix values are set properly

Definition at line 5747 of file processor.h.


Member Function Documentation

void MatchSFProcessor::create_radial_func vector< float > &  radial_mask,
EMData image
const [protected, virtual]
 

Implements EMAN::FourierAnlProcessor.

Definition at line 6328 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().

06328                                                                                           {
06329         // The radial mask comes in with the existing radial image profile
06330         // The radial mask runs from 0 to the 1-D Nyquist (it leaves out the corners in Fourier space)
06331 
06332         EMData *to = params["to"];
06333         XYData *sf = new XYData();
06334         float apixto = to->get_attr("apix_x");
06335 
06336 
06337         if (to->is_complex()) {
06338                 vector<float> rd=to->calc_radial_dist(to->get_ysize()/2.0f,0,1.0f,1);
06339                 for (size_t i=0; i<rd.size(); ++i) {
06340                         sf->set_x(i,i/(apixto*2.0f*rd.size()));
06341                         sf->set_y(i,rd[i]);
06342                 }
06343         }
06344         else {
06345                 EMData *tmp=to->do_fft();
06346                 vector<float> rd=tmp->calc_radial_dist(to->get_ysize()/2,0,1.0,1);
06347                 for (size_t i=0; i<rd.size(); ++i) {
06348                         sf->set_x(i,i/(apixto*2.0f*rd.size()));
06349                         sf->set_y(i,rd[i]);
06350                 }
06351                 delete tmp;
06352         }
06353 
06354         float apix=image->get_attr("apix_x");
06355 
06356 //      sf->write_file("a.txt");
06357 //      Util::save_data(0,sf->get_x(1),radial_mask,"b.txt");
06358 
06359         int n = radial_mask.size();
06360         for (int i=0; i<n; i++) {
06361                 if (radial_mask[i]>0) radial_mask[i]= sqrt(sf->get_yatx(i/(apix*2.0f*n),false)/radial_mask[i]);
06362                 else if (i>0) radial_mask[i]=radial_mask[i-1];
06363         }
06364 
06365 //      Util::save_data(0,sf->get_x(1),radial_mask,"c.txt");
06366 
06367         delete sf;
06368 }

virtual string EMAN::MatchSFProcessor::get_desc  )  const [inline, virtual]
 

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

Returns:
The description of this processor.

Implements EMAN::Processor.

Definition at line 5756 of file processor.h.

05757                 {
05758                         return "Filters the image so its 1-D power spectrum matches a second image";
05759                 }

virtual string EMAN::MatchSFProcessor::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 5751 of file processor.h.

05752                 {
05753                         return NAME;
05754                 }

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.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::FourierAnlProcessor.

Definition at line 5766 of file processor.h.

References EMAN::TypeDict::put().

05767                 {
05768                         TypeDict d;
05769                         d.put("to", EMObject::EMDATA, "The image to match with. Make sure apix values are correct.");
05770                         return d;
05771                 }

Processor* EMAN::MatchSFProcessor::NEW  )  [inline, static]
 

Definition at line 5761 of file processor.h.

05762                 {
05763                         return new MatchSFProcessor();
05764                 }


Member Data Documentation

const string MatchSFProcessor::NAME = "filter.matchto" [static]
 

Definition at line 187 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 13:42:42 2013 for EMAN2 by  doxygen 1.3.9.1