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

XYZAverager is an averager template for defining new averagers. More...

#include <averager_template.h>

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

List of all members.

Public Member Functions

 XYZAverager ()
void add_image (EMData *image)
 To add an image to the Averager.
EMDatafinish ()
 Finish up the averaging and return the result.
string get_name () const
 Get the Averager's name.
string get_desc () const
TypeDict get_param_types () const
 Add your averager parameter names and types in get_param_types().

Static Public Member Functions

static AveragerNEW ()

Static Public Attributes

static const string NAME = "xyz"

Private Attributes

EMDataresult

Detailed Description

XYZAverager is an averager template for defining new averagers.

Please add your own code at the proper place.

1) Replace all 'XYZ' with your new averager name. 2) Define the averager parameter names and types in get_param_types(). 3) Implement the averager in XYZAverager::align().

Definition at line 47 of file averager_template.h.


Constructor & Destructor Documentation

XYZAverager::XYZAverager ( )

Definition at line 39 of file averager_template.cpp.

Referenced by NEW().

                         : result(0)
{
}

Member Function Documentation

void XYZAverager::add_image ( EMData image) [virtual]

To add an image to the Averager.

This image will be averaged in this function.

Parameters:
imageThe image to be averaged.

Implements EMAN::Averager.

Definition at line 43 of file averager_template.cpp.

References result.

{
        if (!image) {
                return;
        }
        result = new EMData();
}
EMData * XYZAverager::finish ( ) [virtual]

Finish up the averaging and return the result.

Returns:
The averaged image.

Implements EMAN::Averager.

Definition at line 52 of file averager_template.cpp.

References result.

{
        return result;
}
string EMAN::XYZAverager::get_desc ( ) const [inline, virtual]

Implements EMAN::Averager.

Definition at line 59 of file averager_template.h.

                {
                        return "XYZ description";
                }
string EMAN::XYZAverager::get_name ( ) const [inline, virtual]

Get the Averager's name.

Each Averager is identified by a unique name.

Returns:
The Averager's name.

Implements EMAN::Averager.

Definition at line 54 of file averager_template.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::XYZAverager::get_param_types ( ) const [inline, virtual]

Add your averager parameter names and types in get_param_types().

For available parameter types, please refer class EMObject.

As an example, XYZAverager has 3 parameters: EMData *param1; int param2; float param3;

Reimplemented from EMAN::Averager.

Definition at line 78 of file averager_template.h.

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

                {
                        TypeDict d;
                        d.put("param1", EMObject::EMDATA);
                        d.put("param2", EMObject::INT);
                        d.put("param3", EMObject::FLOAT);
                        return d;
                }
static Averager* EMAN::XYZAverager::NEW ( ) [inline, static]

Definition at line 64 of file averager_template.h.

References XYZAverager().

                {
                        return new XYZAverager();
                }

Member Data Documentation

const string XYZAverager::NAME = "xyz" [static]

Definition at line 87 of file averager_template.h.

Referenced by get_name().

Reimplemented from EMAN::Averager.

Definition at line 89 of file averager_template.h.

Referenced by add_image(), and finish().


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