Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
EMAN::SetSFProcessor Class Reference

Sets the structure factor based on a 1D s/intensity curve as an XYData object. More...

#include <processor.h>

Inheritance diagram for EMAN::SetSFProcessor:
Inheritance graph
Collaboration diagram for EMAN::SetSFProcessor:
Collaboration graph

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

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "filter.setstrucfac"

Protected Member Functions

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

Detailed Description

Sets the structure factor based on a 1D s/intensity curve as an XYData object.

strucfacXYData object with the curve to be imposed as intensity as a function of s
apixA/pix value. Overrides and replaces apix_x/y/z in image

Definition at line 6156 of file processor.h.

Member Function Documentation

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

Implements EMAN::FourierAnlProcessor.

Definition at line 6716 of file processor.cpp.

References EMAN::EMData::get_attr(), EMAN::XYData::get_size(), EMAN::XYData::get_x(), EMAN::XYData::get_yatx(), EMAN::Dict::has_key(), InvalidParameterException, EMAN::Processor::params, EMAN::EMData::set_attr(), and sqrt().

        // The radial mask comes in with the existing radial image profile
        // The radial mask runs from 0 to the 1-D Nyquist (it leaves out the corners in Fourier space)

        XYData *sf = params["strucfac"];
        if(params.has_key("apix")) {
                image->set_attr("apix_x", (float)params["apix"]);
                image->set_attr("apix_y", (float)params["apix"]);
                image->set_attr("apix_z", (float)params["apix"]);

        float apix=image->get_attr("apix_x");
        int n = radial_mask.size();
        int nmax=(int)floor(sf->get_x(sf->get_size()-1)*apix*2.0f*n);           // This is the radius at which we have our last valid value from the curve
        if (nmax>n) nmax=n;

        if ((nmax)<3) throw InvalidParameterException("Insufficient structure factor data for SetSFProcessor to be meaningful");

        int i;
        for (i=0; i<nmax; i++) {
//              if (radial_mask[i]>0)
//              {
//                      radial_mask[i]= sqrt(n*sf->get_yatx(i/(apix*2.0f*n),false)/radial_mask[i]);
//              }
                if (radial_mask[i]>0) {
                        radial_mask[i]= sqrt((n*n*n)*sf->get_yatx(i/(apix*2.0f*n))/radial_mask[i]);
                else if (i>0) radial_mask[i]=radial_mask[i-1];  // For points where the existing power spectrum was 0

        // Continue to use a fixed factor after we run out of 'sf' values

        while (i<n) {

virtual string EMAN::SetSFProcessor::get_desc ( ) const [inline, virtual]

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

The description of this processor.

Implements EMAN::Processor.

Definition at line 6165 of file processor.h.

                        return "Filters the image so its 1-D power spectrum matches a supplied S,Y curve. If the S axis does not extend to Nyquist, only a uniform scaling will be applied beyond the end of the supplied curve. ";
virtual string EMAN::SetSFProcessor::get_name ( ) const [inline, virtual]

Get the processor's name.

Each processor is identified by a unique name.

The processor's name.

Implements EMAN::Processor.

Definition at line 6160 of file processor.h.

References NAME.

                        return NAME;
virtual TypeDict EMAN::SetSFProcessor::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.

A dictionary containing the parameter info.

Reimplemented from EMAN::FourierAnlProcessor.

Definition at line 6175 of file processor.h.

References EMAN::EMObject::FLOAT, EMAN::TypeDict::put(), and EMAN::EMObject::XYDATA.

                        TypeDict d;
                        d.put("strucfac", EMObject::XYDATA, "An XYData object contaning the curve to be imposed as a function of S");
                        d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
                        return d;
static Processor* EMAN::SetSFProcessor::NEW ( ) [inline, static]

Definition at line 6170 of file processor.h.

                        return new SetSFProcessor();

Member Data Documentation

const string SetSFProcessor::NAME = "filter.setstrucfac" [static]

Definition at line 6183 of file processor.h.

Referenced by get_name().

The documentation for this class was generated from the following files: