#include <aligner.h>
Inheritance diagram for EMAN::RotationalAlignerIterative:
Public Member Functions | |
virtual EMData * | align (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 EMData * | align (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 | |
Aligner * | NEW () |
Static Public Attributes | |
const string | NAME = "rotational_iterative" |
The advantage of this over the 'regular' rotational alinger is that this is done in real space and does not use invariants.
r1 | inner ring | |
r2 | outer ring |
Definition at line 263 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 269 of file aligner.h. References align(). 00270 { 00271 return align(this_img, to_img, "dot", Dict()); 00272 }
|
|
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.
Implements EMAN::Aligner. Definition at line 404 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(). 00406 { 00407 int r1 = params.set_default("r1",-1); 00408 int r2 = params.set_default("r2",-1); 00409 //to start lest try the original size image. If needed, we can pad it.... 00410 EMData * to_polar = to->unwrap(r1,r2,-1,0,0,true); 00411 EMData * this_img_polar = this_img->unwrap(r1,r2,-1,0,0,true); 00412 int this_img_polar_nx = this_img_polar->get_xsize(); 00413 00414 EMData *cf = this_img_polar->calc_ccfx(to_polar, 0, this_img->get_ysize()); 00415 00416 //take out the garbage 00417 delete to_polar; to_polar = 0; 00418 delete this_img_polar; this_img_polar = 0; 00419 00420 float *data = cf->get_data(); 00421 float peak = 0; 00422 int peak_index = 0; 00423 Util::find_max(data, this_img_polar_nx, &peak, &peak_index); 00424 00425 delete cf; cf = 0; 00426 float rot_angle = (float) (peak_index * 360.0f / this_img_polar_nx); 00427 00428 //return the result 00429 //cout << rot_angle << endl; 00430 Transform tmp(Dict("type","2d","alpha",rot_angle)); 00431 EMData * rotimg=this_img->process("xform",Dict("transform",(Transform*)&tmp)); 00432 rotimg->set_attr("xform.align2d",&tmp); 00433 00434 return rotimg; 00435 00436 }
|
|
Implements EMAN::Aligner. Definition at line 279 of file aligner.h. 00280 { 00281 return "Performs rotational alignment using the SPIDER method"; 00282 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 274 of file aligner.h. 00275 {
00276 return NAME;
00277 }
|
|
Implements EMAN::Aligner. Definition at line 289 of file aligner.h. References EMAN::TypeDict::put(). 00290 { 00291 TypeDict d; 00292 d.put("r1", EMObject::INT, "Inner ring, pixels"); 00293 d.put("r2", EMObject::INT, "Outer ring, pixels"); 00294 return d; 00295 }
|
|
Definition at line 284 of file aligner.h. 00285 { 00286 return new RotationalAlignerIterative(); 00287 }
|
|
Definition at line 60 of file aligner.cpp. |