EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
EMAN::RotateFlipAligner Class Reference

rotational and flip alignment More...

#include <aligner.h>

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

List of all members.

Public Member Functions

virtual EMDataalign (EMData *this_img, EMData *to_img, const string &cmp_name="dot", const Dict &cmp_params=Dict()) const
 To align 'this_img' with another image passed in through its parameters.
virtual EMDataalign (EMData *this_img, EMData *to_img) const
virtual string get_name () const
 Get the Aligner's name.
virtual string get_desc () const
virtual TypeDict get_param_types () const

Static Public Member Functions

static AlignerNEW ()
static TypeDict static_get_param_types ()

Static Public Attributes

static const string NAME = "rotate_flip"

Detailed Description

rotational and flip alignment

Parameters:
imask
rfp_modeEither 0,1 or 2. A temporary flag for testing the rotational foot print

Definition at line 720 of file aligner.h.


Member Function Documentation

EMData * RotateFlipAligner::align ( EMData this_img,
EMData to_img,
const string &  cmp_name = "dot",
const Dict cmp_params = Dict() 
) 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 1016 of file aligner.cpp.

References EMAN::EMData::align(), EMAN::EMData::cmp(), cmp1(), cmp2(), EMAN::EMData::get_attr(), EMAN::Aligner::params, EMAN::EMData::process(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), EMAN::Transform::set_mirror(), and t.

Referenced by align().

{
        Dict rot_params("rfp_mode",params.set_default("rfp_mode",2));
        EMData *r1 = this_img->align("rotational", to, rot_params,cmp_name, cmp_params);


        EMData* flipped =to->process("xform.flip", Dict("axis", "x"));
        EMData *r2 = this_img->align("rotational", flipped,rot_params, cmp_name, cmp_params);
        Transform* t = r2->get_attr("xform.align2d");
        t->set_mirror(true);
        r2->set_attr("xform.align2d",t);
        delete t;

        float cmp1 = r1->cmp(cmp_name, to, cmp_params);
        float cmp2 = r2->cmp(cmp_name, flipped, cmp_params);

        delete flipped; flipped = 0;

        EMData *result = 0;

        if (cmp1 < cmp2) {
                if( r2 )
                {
                        delete r2;
                        r2 = 0;
                }
                result = r1;
        }
        else {
                if( r1 )
                {
                        delete r1;
                        r1 = 0;
                }
                result = r2;
                result->process_inplace("xform.flip",Dict("axis","x"));
        }

        return result;
}
virtual EMData* EMAN::RotateFlipAligner::align ( EMData this_img,
EMData to_img 
) const [inline, virtual]

Implements EMAN::Aligner.

Definition at line 725 of file aligner.h.

References align().

                {
                        return align(this_img, to_img, "dot", Dict());
                }
virtual string EMAN::RotateFlipAligner::get_desc ( ) const [inline, virtual]

Implements EMAN::Aligner.

Definition at line 734 of file aligner.h.

                {
                        return "Performs two rotational alignments, one using the original image and one using the hand-flipped image. Decides which alignment is better using a comparitor and returns it";
                }
virtual string EMAN::RotateFlipAligner::get_name ( ) const [inline, virtual]

Get the Aligner's name.

Each Aligner is identified by a unique name.

Returns:
The Aligner's name.

Implements EMAN::Aligner.

Definition at line 729 of file aligner.h.

References NAME.

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

Implements EMAN::Aligner.

Definition at line 744 of file aligner.h.

References static_get_param_types().

                {
                        return static_get_param_types();
                }
static Aligner* EMAN::RotateFlipAligner::NEW ( ) [inline, static]

Definition at line 739 of file aligner.h.

                {
                        return new RotateFlipAligner();
                }
static TypeDict EMAN::RotateFlipAligner::static_get_param_types ( ) [inline, static]

Definition at line 749 of file aligner.h.

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

Referenced by get_param_types().

                                                         {
                        TypeDict d;

                        d.put("imask", EMObject::INT);
                        d.put("rfp_mode", EMObject::INT,"Either 0,1 or 2. A temporary flag for testing the rotational foot print");
                        return d;
                }

Member Data Documentation

const string RotateFlipAligner::NAME = "rotate_flip" [static]

Definition at line 757 of file aligner.h.

Referenced by get_name().


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