#include <averager.h>
Inheritance diagram for EMAN::Averager:
Public Member Functions | |
Averager () | |
virtual | ~Averager () |
virtual void | add_image (EMData *image)=0 |
To add an image to the Averager. | |
virtual void | add_image_list (const vector< EMData * > &images) |
To add multiple images to the Averager. | |
virtual EMData * | finish ()=0 |
Finish up the averaging and return the result. | |
virtual string | get_name () const =0 |
Get the Averager's name. | |
virtual string | get_desc () const =0 |
virtual void | set_params (const Dict &new_params) |
Set the Averager parameters using a key/value dictionary. | |
virtual void | mult (const float &s) |
Multiply the result image by some floating point constant This is useful when weighting the input images prior to calling add_image - a situation where it is likely you want to divide by the sum of the weights. | |
virtual TypeDict | get_param_types () const |
Get Averager parameter information in a dictionary. | |
Protected Attributes | |
Dict | params |
EMData * | result |
A user may add one or more images to the Averager at one time. The images are averaged at the time of adding to the Averager. After all images are added, Average will return the averaged result.
Averager class is the base class for all averager classes. Each specific averager has a unique ID name. This name is used to call a averager.
All Averager classes in EMAN are managed by a Factory pattern. So each Averager class must define:
Typical usages of Averager:
vector<string> all_averagers = Factory<Averager>::get_list();
Definition at line 96 of file averager.h.
EMAN::Averager::Averager | ( | ) | [inline] |
virtual EMAN::Averager::~Averager | ( | ) | [inline, virtual] |
virtual void EMAN::Averager::add_image | ( | EMData * | image | ) | [pure virtual] |
To add an image to the Averager.
This image will be averaged in this function.
image | The image to be averaged. |
Implemented in EMAN::ImageAverager, EMAN::FourierWeightAverager, EMAN::TomoAverager, EMAN::MinMaxAverager, EMAN::AbsMaxMinAverager, EMAN::IterationAverager, EMAN::CtfCAutoAverager, EMAN::CtfCWautoAverager, and EMAN::XYZAverager.
Referenced by add_image_list(), EMAN::SymAlignProcessor::align(), and EMAN::ApplySymProcessor::process().
void Averager::add_image_list | ( | const vector< EMData * > & | images | ) | [virtual] |
To add multiple images to the Averager.
All the newly-added images are averaged in this function.
images | The images to be averaged. |
Definition at line 77 of file averager.cpp.
References add_image().
00078 { 00079 for (size_t i = 0; i < image_list.size(); i++) { 00080 add_image(image_list[i]); 00081 } 00082 }
virtual EMData* EMAN::Averager::finish | ( | ) | [pure virtual] |
Finish up the averaging and return the result.
Implemented in EMAN::ImageAverager, EMAN::FourierWeightAverager, EMAN::TomoAverager, EMAN::MinMaxAverager, EMAN::AbsMaxMinAverager, EMAN::IterationAverager, EMAN::CtfCAutoAverager, EMAN::CtfCWautoAverager, and EMAN::XYZAverager.
Referenced by EMAN::SymAlignProcessor::align(), and EMAN::ApplySymProcessor::process().
virtual string EMAN::Averager::get_desc | ( | ) | const [pure virtual] |
virtual string EMAN::Averager::get_name | ( | ) | const [pure virtual] |
Get the Averager's name.
Each Averager is identified by a unique name.
Implemented in EMAN::ImageAverager, EMAN::FourierWeightAverager, EMAN::TomoAverager, EMAN::MinMaxAverager, EMAN::AbsMaxMinAverager, EMAN::IterationAverager, EMAN::CtfCAutoAverager, EMAN::CtfCWautoAverager, and EMAN::XYZAverager.
virtual TypeDict EMAN::Averager::get_param_types | ( | ) | const [inline, virtual] |
Get Averager parameter information in a dictionary.
Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented in EMAN::ImageAverager, EMAN::FourierWeightAverager, EMAN::TomoAverager, EMAN::MinMaxAverager, EMAN::AbsMaxMinAverager, and EMAN::XYZAverager.
Definition at line 154 of file averager.h.
void Averager::mult | ( | const float & | s | ) | [virtual] |
Multiply the result image by some floating point constant This is useful when weighting the input images prior to calling add_image - a situation where it is likely you want to divide by the sum of the weights.
Hence call mult after all of the weighted images have been added.
s | the scaling factor. |
NullPointerException | if the EMData pointer (result) is NULL |
Reimplemented in EMAN::ImageAverager, EMAN::TomoAverager, and EMAN::MinMaxAverager.
Definition at line 67 of file averager.cpp.
References EMAN::EMData::mult(), NullPointerException, and result.
00068 { 00069 if ( result != 0 ) 00070 { 00071 result->mult(s); 00072 } 00073 else throw NullPointerException("Error, attempted to multiply the result image, which is NULL"); 00074 }
virtual void EMAN::Averager::set_params | ( | const Dict & | new_params | ) | [inline, virtual] |
Set the Averager parameters using a key/value dictionary.
new_params | A dictionary containing the new parameters. |
Reimplemented in EMAN::CtfCAutoAverager, and EMAN::CtfCWautoAverager.
Definition at line 133 of file averager.h.
References params.
00134 { 00135 params = new_params; 00136 }
Dict EMAN::Averager::params [mutable, protected] |
Definition at line 161 of file averager.h.
Referenced by EMAN::AbsMaxMinAverager::add_image(), EMAN::MinMaxAverager::add_image(), EMAN::FourierWeightAverager::add_image(), EMAN::ImageAverager::add_image(), EMAN::TomoAverager::add_image(), EMAN::TomoAverager::finish(), EMAN::CtfCWautoAverager::set_params(), EMAN::CtfCAutoAverager::set_params(), and set_params().
EMData* EMAN::Averager::result [protected] |
Reimplemented in EMAN::XYZAverager.
Definition at line 162 of file averager.h.
Referenced by EMAN::CtfCAutoAverager::add_image(), EMAN::CtfCWautoAverager::add_image(), EMAN::IterationAverager::add_image(), EMAN::AbsMaxMinAverager::add_image(), EMAN::MinMaxAverager::add_image(), EMAN::FourierWeightAverager::add_image(), EMAN::ImageAverager::add_image(), EMAN::TomoAverager::add_image(), EMAN::CtfCAutoAverager::finish(), EMAN::CtfCWautoAverager::finish(), EMAN::IterationAverager::finish(), EMAN::AbsMaxMinAverager::finish(), EMAN::MinMaxAverager::finish(), EMAN::FourierWeightAverager::finish(), EMAN::ImageAverager::finish(), EMAN::TomoAverager::finish(), and mult().