EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
EMAN::LinearRampProcessor Class Reference

processor radial function: f(x) = slope * x + intercept More...

#include <processor.h>

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

List of all members.

Public Member Functions

 LinearRampProcessor ()
string get_name () const
 Get the processor's name.
string get_desc () const
 Get the descrition of this specific processor.
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
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 = "eman1.filter.ramp"

Protected Member Functions

void create_radial_func (vector< float > &radial_mask) const

Private Attributes

float intercept
float slope

Detailed Description

processor radial function: f(x) = slope * x + intercept

Parameters:
interceptintercept in 'f(x) = slope * x + intercept
slopeslope in 'f(x) = slope * x + intercept

Definition at line 1074 of file processor.h.


Constructor & Destructor Documentation

EMAN::LinearRampProcessor::LinearRampProcessor ( ) [inline]

Definition at line 1077 of file processor.h.

Referenced by NEW().

                                     :intercept(0), slope(0)
                {
                }

Member Function Documentation

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

Implements EMAN::FourierProcessor.

Definition at line 1419 of file processor.cpp.

References Assert, intercept, slope, and x.

{
        Assert(radial_mask.size() > 0);
        float x = 0.0f , step = 0.5f/radial_mask.size();
        size_t size=radial_mask.size();
        for (size_t i = 0; i < size; i++) {
                radial_mask[i] = intercept + ((slope - intercept) * i) / (size - 1.0f);
                x += step;
        }
}
string EMAN::LinearRampProcessor::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 1090 of file processor.h.

                {
                        return "processor radial function: f(x) = slope * x + intercept;";
                }
string EMAN::LinearRampProcessor::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 1081 of file processor.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::LinearRampProcessor::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::FourierProcessor.

Definition at line 1102 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("intercept", EMObject::FLOAT, "intercept in 'f(x) = slope * x + intercept'");
                        d.put("slope", EMObject::FLOAT, "slope in 'f(x) = slope * x + intercept'");
                        return d;
                }
static Processor* EMAN::LinearRampProcessor::NEW ( ) [inline, static]

Definition at line 1085 of file processor.h.

References LinearRampProcessor().

                {
                        return new LinearRampProcessor();
                }
void EMAN::LinearRampProcessor::set_params ( const Dict new_params) [inline, virtual]

Set the processor parameters using a key/value dictionary.

Parameters:
new_paramsA dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Definition at line 1095 of file processor.h.

References intercept, EMAN::Processor::params, and slope.

                {
                        params = new_params;
                        intercept = params["intercept"];
                        slope = params["slope"];
                }

Member Data Documentation

Definition at line 1116 of file processor.h.

Referenced by create_radial_func(), and set_params().

const string LinearRampProcessor::NAME = "eman1.filter.ramp" [static]

Definition at line 1110 of file processor.h.

Referenced by get_name().

Definition at line 1117 of file processor.h.

Referenced by create_radial_func(), and set_params().


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