Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::RotateFlipAlignerIterative Class Reference
[a function or class that is CUDA enabled]

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

AlignerNEW ()
TypeDict static_get_param_types ()

Static Public Attributes

const string NAME = "rotate_flip.iterative"

Detailed Description

rotational and flip alignment, iterative style

Parameters:
r1 inner ring
r2 outer ring

Definition at line 522 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 527 of file aligner.h.

References align().

00528                 {
00529                         return align(this_img, to_img, "dot", Dict());
00530                 }

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 654 of file aligner.cpp.

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

00656 {
00657         Dict rot_params("r1",params.set_default("r1",-1),"r2",params.set_default("r2",-1));
00658         EMData *r1 = this_img->align("rotational.iterative", to, rot_params,cmp_name, cmp_params);
00659 
00660         EMData* flipped =to->process("xform.flip", Dict("axis", "x"));
00661         EMData *r2 = this_img->align("rotational.iterative", flipped,rot_params, cmp_name, cmp_params);
00662         Transform* t = r2->get_attr("xform.align2d");
00663         t->set_mirror(true);
00664         r2->set_attr("xform.align2d",t);
00665         delete t;
00666 
00667         float cmp1 = r1->cmp(cmp_name, to, cmp_params);
00668         float cmp2 = r2->cmp(cmp_name, flipped, cmp_params);
00669 
00670         delete flipped; flipped = 0;
00671 
00672         EMData *result = 0;
00673 
00674         if (cmp1 < cmp2) {
00675                 if( r2 )
00676                 {
00677                         delete r2;
00678                         r2 = 0;
00679                 }
00680                 result = r1;
00681         }
00682         else {
00683                 if( r1 )
00684                 {
00685                         delete r1;
00686                         r1 = 0;
00687                 }
00688                 result = r2;
00689                 result->process_inplace("xform.flip",Dict("axis","x"));
00690         }
00691 
00692         return result;
00693 }

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

Implements EMAN::Aligner.

Definition at line 536 of file aligner.h.

00537                 {
00538                         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";
00539                 }

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 531 of file aligner.h.

00532                 {
00533                         return NAME;
00534                 }

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

Implements EMAN::Aligner.

Definition at line 546 of file aligner.h.

00547                 {
00548                         return static_get_param_types();
00549                 }

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

Definition at line 541 of file aligner.h.

00542                 {
00543                         return new RotateFlipAlignerIterative();
00544                 }

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

Definition at line 551 of file aligner.h.

References EMAN::TypeDict::put().

00551                                                          {
00552                         TypeDict d;
00553                         d.put("r1", EMObject::INT, "Inner ring, pixels");
00554                         d.put("r2", EMObject::INT, "Outer ring, pixels");
00555                         return d;
00556                 }


Member Data Documentation

const string RotateFlipAlignerIterative::NAME = "rotate_flip.iterative" [static]
 

Definition at line 61 of file aligner.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 13:47:09 2010 for EMAN2 by  doxygen 1.3.9.1