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

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

rotational, translational and flip alignment More...

#include <aligner.h>

Inheritance diagram for EMAN::RotateTranslateFlipAligner:

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

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

Detailed Description

rotational, translational and flip alignment

Parameters:
flip 
usedot 
maxshift Maximum translation in pixels
rfp_mode Either 0,1 or 2. A temporary flag for testing the rotational foot print

Definition at line 568 of file aligner.h.


Member Function Documentation

virtual EMData* EMAN::RotateTranslateFlipAligner::align EMData this_img,
EMData to_img
const [inline, virtual]
 

Implements EMAN::Aligner.

Definition at line 573 of file aligner.h.

References align().

00574                 {
00575                         return align(this_img, to_img, "sqeuclidean", Dict());
00576                 }

EMData * RotateTranslateFlipAligner::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 505 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.

00507 {
00508         // Get the non flipped rotational, tranlsationally aligned image
00509         Dict rt_params("maxshift", params["maxshift"], "rfp_mode", params.set_default("rfp_mode",0),"useflcf",params.set_default("useflcf",0));
00510         EMData *rot_trans_align = this_img->align("rotate_translate",to,rt_params,cmp_name, cmp_params);
00511 
00512         // Do the same alignment, but using the flipped version of the image
00513         EMData *flipped = params.set_default("flip", (EMData *) 0);
00514         bool delete_flag = false;
00515         if (flipped == 0) {
00516                 flipped = to->process("xform.flip", Dict("axis", "x"));
00517                 delete_flag = true;
00518         }
00519 
00520         EMData * rot_trans_align_flip = this_img->align("rotate_translate", flipped, rt_params, cmp_name, cmp_params);
00521         Transform* t = rot_trans_align_flip->get_attr("xform.align2d");
00522         t->set_mirror(true);
00523         rot_trans_align_flip->set_attr("xform.align2d",t);
00524         delete t;
00525 
00526         // Now finally decide on what is the best answer
00527         float cmp1 = rot_trans_align->cmp(cmp_name, to, cmp_params);
00528         float cmp2 = rot_trans_align_flip->cmp(cmp_name, flipped, cmp_params);
00529 
00530         if (delete_flag){
00531                 if(flipped) {
00532                         delete flipped;
00533                         flipped = 0;
00534                 }
00535         }
00536 
00537         EMData *result = 0;
00538         if (cmp1 < cmp2 )  {
00539 
00540                 if( rot_trans_align_flip ) {
00541                         delete rot_trans_align_flip;
00542                         rot_trans_align_flip = 0;
00543                 }
00544                 result = rot_trans_align;
00545         }
00546         else {
00547                 if( rot_trans_align ) {
00548                         delete rot_trans_align;
00549                         rot_trans_align = 0;
00550                 }
00551                 result = rot_trans_align_flip;
00552                 result->process_inplace("xform.flip",Dict("axis","x"));
00553         }
00554 
00555         return result;
00556 }

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

Implements EMAN::Aligner.

Definition at line 583 of file aligner.h.

00584                 {
00585                         return " Does two 'rotate_translate' alignments, one to accommodate for possible handedness change. Decided which alignment is better using a comparitor and returns the aligned image as the solution";
00586                 }

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

00579                 {
00580                         return NAME;
00581                 }

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

Implements EMAN::Aligner.

Definition at line 593 of file aligner.h.

00594                 {
00595                         return static_get_param_types();
00596                 }

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

Definition at line 588 of file aligner.h.

00589                 {
00590                         return new RotateTranslateFlipAligner();
00591                 }

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

Definition at line 598 of file aligner.h.

References EMAN::TypeDict::put().

00598                                                          {
00599                         TypeDict d;
00600 
00601                         d.put("flip", EMObject::EMDATA);
00602                         d.put("usedot", EMObject::INT);
00603                         d.put("maxshift", EMObject::INT, "Maximum translation in pixels");
00604                         d.put("rfp_mode", EMObject::INT,"Either 0,1 or 2. A temporary flag for testing the rotational foot print");
00605                         d.put("useflcf", EMObject::INT,"Use Fast Local Correlation Function rather than CCF for translational alignment");
00606                         return d;
00607                 }


Member Data Documentation

const string RotateTranslateFlipAligner::NAME = "rotate_translate_flip" [static]
 

Definition at line 62 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