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

#include <cmp.h>

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

Public Member Functions

float cmp (EMData *image, EMData *with) const
 To compare 'image' with another image passed in through its parameters. More...
 
string get_name () const
 Get the Cmp's name. More...
 
string get_desc () const
 
TypeDict get_param_types () const
 Get Cmp parameter information in a dictionary. More...
 
- Public Member Functions inherited from EMAN::Cmp
virtual ~Cmp ()
 
virtual Dict get_params () const
 Get the Cmp parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the Cmp parameters using a key/value dictionary. More...
 

Static Public Member Functions

static CmpNEW ()
 

Static Public Attributes

static const string NAME = "vertical"
 

Additional Inherited Members

- Protected Member Functions inherited from EMAN::Cmp
void validate_input_args (const EMData *image, const EMData *with) const
 
- Protected Attributes inherited from EMAN::Cmp
Dict params
 

Detailed Description

Definition at line 723 of file cmp.h.

Member Function Documentation

◆ cmp()

float VerticalCmp::cmp ( EMData image,
EMData with 
) const
virtual

To compare 'image' with another image passed in through its parameters.

An optional transformation may be used to transform the 2 images.

Parameters
imageThe first image to be compared.
withThe second image to be comppared.
Returns
The comparison result. Smaller better by default

Implements EMAN::Cmp.

Definition at line 1642 of file cmp.cpp.

1643{
1644 ENTERFUNC;
1645 int nx=image->get_xsize();
1646 int ny=image->get_ysize();
1647// vector<float> proj(nx,0);
1648 float max=0;
1649 for (int x=0; x<nx; x++){
1650 float s=0;
1651 for (int y=0; y<ny; y++){
1652 s+=image->get_value_at(x,y);
1653 }
1654// proj[x]=s;
1655 if (s>max)
1656 max=s;
1657 }
1658
1659// Dict params=Util::get_stats(proj);
1660// float ret=params["std_dev"];
1661 return -max;
1662}
#define ENTERFUNC
Definition: log.h:48
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References ENTERFUNC, x, and y.

◆ get_desc()

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

Implements EMAN::Cmp.

Definition at line 733 of file cmp.h.

734 {
735 return "Align the 2d image vertically. Reference image is ignored";
736 }

◆ get_name()

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

Get the Cmp's name.

Each Cmp is identified by a unique name.

Returns
The Cmp's name.

Implements EMAN::Cmp.

Definition at line 728 of file cmp.h.

729 {
730 return NAME;
731 }
static const string NAME
Definition: cmp.h:749

References NAME.

◆ get_param_types()

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

Get Cmp 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.

Implements EMAN::Cmp.

Definition at line 743 of file cmp.h.

744 {
745 TypeDict d;
746 return d;
747 }

◆ NEW()

static Cmp * EMAN::VerticalCmp::NEW ( )
inlinestatic

Definition at line 738 of file cmp.h.

739 {
740 return new VerticalCmp();
741 }

Member Data Documentation

◆ NAME

const string VerticalCmp::NAME = "vertical"
static

Definition at line 749 of file cmp.h.

Referenced by get_name().


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