#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.
|
Definition at line 99 of file averager.h. 00099 : result(0) {}
|
|
Definition at line 101 of file averager.h. 00102 { 00103 }
|
|
To add an image to the Averager. This image will be averaged in this function.
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(). |
|
To add multiple images to the Averager. All the newly-added images are averaged in this function.
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 }
|
|
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(). |
|
|
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. |
|
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. 00155 {
00156 TypeDict d;
00157 return d;
00158 }
|
|
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.
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 }
|
|
Set the Averager parameters using a key/value dictionary.
Reimplemented in EMAN::CtfCAutoAverager, and EMAN::CtfCWautoAverager. Definition at line 133 of file averager.h. 00134 { 00135 params = new_params; 00136 }
|
|
Definition at line 161 of file averager.h. |
|
Reimplemented in EMAN::XYZAverager. Definition at line 162 of file averager.h. Referenced by mult(). |