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

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

rotational alignment using the iterative method More...

#include <aligner.h>

Inheritance diagram for EMAN::RotationalAlignerIterative:

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

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 ()

Static Public Attributes

const string NAME = "rotational.iterative"

Detailed Description

rotational alignment using the iterative method

Parameters:
r1 inner ring
r2 outer ring

Definition at line 260 of file aligner.h.


Member Function Documentation

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

Implements EMAN::Aligner.

Definition at line 266 of file aligner.h.

References align().

00267                 {
00268                         return align(this_img, to_img, "dot", Dict());
00269                 }

EMData * RotationalAlignerIterative::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 359 of file aligner.cpp.

References EMAN::EMData::calc_ccfx(), data, EMAN::Util::find_max(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::process(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), and EMAN::EMData::unwrap().

00361 {
00362         int r1 = params.set_default("r1",-1);
00363         int r2 = params.set_default("r2",-1);
00364         //to start lest try the original size image. If needed, we can pad it....
00365         EMData * to_polar = to->unwrap(r1,r2,-1,0,0,true);
00366         EMData * this_img_polar = this_img->unwrap(r1,r2,-1,0,0,true);
00367         int this_img_polar_nx = this_img_polar->get_xsize();
00368         
00369         EMData *cf = this_img_polar->calc_ccfx(to_polar, 0, this_img->get_ysize());
00370         
00371         //take out the garbage
00372         delete to_polar; to_polar = 0;
00373         delete this_img_polar; this_img_polar = 0;
00374         
00375         float *data = cf->get_data();
00376         float peak = 0;
00377         int peak_index = 0;
00378         Util::find_max(data, this_img_polar_nx, &peak, &peak_index);
00379 
00380         delete cf; cf = 0;
00381         float rot_angle = (float) (peak_index * 360.0f / this_img_polar_nx);
00382         
00383         //return the result
00384         //cout << rot_angle << endl;
00385         Transform tmp(Dict("type","2d","alpha",rot_angle));
00386         EMData * rotimg=this_img->process("xform",Dict("transform",(Transform*)&tmp));
00387         rotimg->set_attr("xform.align2d",&tmp);
00388         
00389         return rotimg;
00390         
00391 }

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

Implements EMAN::Aligner.

Definition at line 276 of file aligner.h.

00277                 {
00278                         return "Performs rotational alignment using the SPIDER method";
00279                 }

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

00272                 {
00273                         return NAME;
00274                 }

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

Implements EMAN::Aligner.

Definition at line 286 of file aligner.h.

References EMAN::TypeDict::put().

00287                 {
00288                         TypeDict d;
00289                         d.put("r1", EMObject::INT, "Inner ring, pixels");
00290                         d.put("r2", EMObject::INT, "Outer ring, pixels");
00291                         return d;
00292                 }

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

Definition at line 281 of file aligner.h.

00282                 {
00283                         return new RotationalAlignerIterative();
00284                 }


Member Data Documentation

const string RotationalAlignerIterative::NAME = "rotational.iterative" [static]
 

Definition at line 55 of file aligner.cpp.


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