EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
EMAN::XYZAligner Class Reference

XYZAligner is an aligner template for defining new aligners. More...

#include <aligner_template.h>

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

Public Member Functions

EMDataalign (EMData *this_img, EMData *to_img, const string &cmp_name, const Dict &cmp_params) const
 To align 'this_img' with another image passed in through its parameters. More...
 
EMDataalign (EMData *this_img, EMData *to_img) const
 
string get_name () const
 Get the Aligner's name. More...
 
string get_desc () const
 
TypeDict get_param_types () const
 Add your aligner parameter names and types in get_param_types(). More...
 
- Public Member Functions inherited from EMAN::Aligner
virtual ~Aligner ()
 
virtual Dict get_params () const
 Get the Aligner parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the Aligner parameters using a key/value dictionary. More...
 
virtual vector< Dictxform_align_nbest (EMData *this_img, EMData *to_img, const unsigned int nsoln, const string &cmp_name, const Dict &cmp_params) const
 This function first added in the context of the 3D aligners used by e2tomohunter: which wants the n best solutions, as opposed to just the best. More...
 

Static Public Member Functions

static AlignerNEW ()
 

Static Public Attributes

static const string NAME = "xyz"
 

Additional Inherited Members

- Protected Attributes inherited from EMAN::Aligner
Dict params
 

Detailed Description

XYZAligner is an aligner template for defining new aligners.

Please add your own code at the proper place.

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

Definition at line 47 of file aligner_template.h.

Member Function Documentation

◆ align() [1/2]

EMData * EMAN::XYZAligner::align ( EMData this_img,
EMData to_img 
) const
inlinevirtual

Implements EMAN::Aligner.

Definition at line 53 of file aligner_template.h.

54 {
55 return align(this_img, to_img);
56 }
EMData * align(EMData *this_img, EMData *to_img, const string &cmp_name, const Dict &cmp_params) const
To align 'this_img' with another image passed in through its parameters.

References align().

◆ align() [2/2]

EMData * XYZAligner::align ( EMData this_img,
EMData to_img,
const string &  cmp_name,
const Dict cmp_params 
) const
virtual

To align 'this_img' with another image passed in through its parameters.

The alignment uses a user-given comparison method to compare the two images. If none is given, a default one is used.

Parameters
this_imgThe image to be compared.
to_img'this_img" is aligned with 'to_img'.
cmp_nameThe comparison method to compare the two images.
cmp_paramsThe parameter dictionary for comparison method.
Returns
The aligned image.

Implements EMAN::Aligner.

Definition at line 38 of file aligner_template.cpp.

40{
41 if (!this_img) {
42 return 0;
43 }
44#if 0
45
46 int param1 = params["param1"];
47 float param2 = params["param2"];
48#endif
49
50 return 0;
51}
Dict params
Definition: aligner.h:147

References EMAN::Aligner::params.

Referenced by align().

◆ get_desc()

string EMAN::XYZAligner::get_desc ( ) const
inlinevirtual

Implements EMAN::Aligner.

Definition at line 63 of file aligner_template.h.

64 {
65 return "XYZ description";
66 }

◆ get_name()

string EMAN::XYZAligner::get_name ( ) const
inlinevirtual

Get the Aligner's name.

Each Aligner is identified by a unique name.

Returns
The Aligner's name.

Implements EMAN::Aligner.

Definition at line 58 of file aligner_template.h.

59 {
60 return NAME;
61 }
static const string NAME

References NAME.

◆ get_param_types()

TypeDict EMAN::XYZAligner::get_param_types ( ) const
inlinevirtual

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

For available parameter types, please refer class EMObject.

As an example, XYZAligner has 3 parameters: EMData *with; int param1; float param2;

Implements EMAN::Aligner.

Definition at line 82 of file aligner_template.h.

83 {
84 TypeDict d;
85
86 d.put("param1", EMObject::INT);
87 d.put("param2", EMObject::FLOAT);
88 return d;
89 }

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

◆ NEW()

static Aligner * EMAN::XYZAligner::NEW ( )
inlinestatic

Definition at line 68 of file aligner_template.h.

69 {
70 return new XYZAligner();
71 }

Member Data Documentation

◆ NAME

const string XYZAligner::NAME = "xyz"
static

Definition at line 91 of file aligner_template.h.

Referenced by get_name().


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