EMAN::RotateFlipAlignerIterative Class Reference

rotational and flip alignment, iterative style More...

#include <aligner.h>

Inheritance diagram for EMAN::RotateFlipAlignerIterative:

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

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_iterative"

Detailed Description

rotational and flip alignment, iterative style

Parameters:
r1 inner ring
r2 outer ring
Author:
John Flanagan
Date:
Oct 2010

Definition at line 766 of file aligner.h.


Member Function Documentation

virtual EMData* EMAN::RotateFlipAlignerIterative::align ( EMData this_img,
EMData to_img 
) const [inline, virtual]

Implements EMAN::Aligner.

Definition at line 771 of file aligner.h.

References align().

00772                 {
00773                         return align(this_img, to_img, "dot", Dict());
00774                 }

EMData * RotateFlipAlignerIterative::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_img The image to be compared.
to_img 'this_img" is aligned with 'to_img'.
cmp_name The comparison method to compare the two images.
cmp_params The parameter dictionary for comparison method.
Returns:
The aligned image.

Implements EMAN::Aligner.

Definition at line 1058 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(), and t.

Referenced by align().

01060 {
01061         Dict rot_params("r1",params.set_default("r1",-1),"r2",params.set_default("r2",-1));
01062         EMData * r1 = this_img->align("rotational_iterative", to, rot_params,cmp_name, cmp_params);
01063 
01064         EMData * flipped =to->process("xform.flip", Dict("axis", "x"));
01065         EMData * r2 = this_img->align("rotational_iterative", flipped,rot_params, cmp_name, cmp_params);
01066         Transform* t = r2->get_attr("xform.align2d");
01067         t->set_mirror(true);
01068         r2->set_attr("xform.align2d",t);
01069         delete t;
01070 
01071         float cmp1 = r1->cmp(cmp_name, to, cmp_params);
01072         float cmp2 = r2->cmp(cmp_name, flipped, cmp_params);
01073 
01074         delete flipped; flipped = 0;
01075 
01076         EMData *result = 0;
01077 
01078         if (cmp1 < cmp2) {
01079                 if( r2 )
01080                 {
01081                         delete r2;
01082                         r2 = 0;
01083                 }
01084                 result = r1;
01085         }
01086         else {
01087                 if( r1 )
01088                 {
01089                         delete r1;
01090                         r1 = 0;
01091                 }
01092                 result = r2;
01093                 result->process_inplace("xform.flip",Dict("axis","x"));
01094         }
01095 
01096         return result;
01097 }

virtual string EMAN::RotateFlipAlignerIterative::get_desc (  )  const [inline, virtual]

Implements EMAN::Aligner.

Definition at line 780 of file aligner.h.

00781                 {
00782                         return "Performs two rotational alignments, iterative style, one using the original image and one using the hand-flipped image. Decides which alignment is better using a comparitor and returns it";
00783                 }

virtual string EMAN::RotateFlipAlignerIterative::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 775 of file aligner.h.

References NAME.

00776                 {
00777                         return NAME;
00778                 }

virtual TypeDict EMAN::RotateFlipAlignerIterative::get_param_types (  )  const [inline, virtual]

Implements EMAN::Aligner.

Definition at line 790 of file aligner.h.

References static_get_param_types().

00791                 {
00792                         return static_get_param_types();
00793                 }

static Aligner* EMAN::RotateFlipAlignerIterative::NEW (  )  [inline, static]

Definition at line 785 of file aligner.h.

00786                 {
00787                         return new RotateFlipAlignerIterative();
00788                 }

static TypeDict EMAN::RotateFlipAlignerIterative::static_get_param_types (  )  [inline, static]

Definition at line 795 of file aligner.h.

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

Referenced by get_param_types().

00795                                                          {
00796                         TypeDict d;
00797                         d.put("r1", EMObject::INT, "Inner ring, pixels");
00798                         d.put("r2", EMObject::INT, "Outer ring, pixels");
00799                         return d;
00800                 }


Member Data Documentation

const string RotateFlipAlignerIterative::NAME = "rotate_flip_iterative" [static]

Definition at line 802 of file aligner.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 12:42:40 2013 for EMAN2 by  doxygen 1.4.7