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

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

3D rotational symmetry aligner. More...

#include <aligner.h>

Inheritance diagram for EMAN::RT3DSymmetryAligner:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual EMDataalign (EMData *this_img, EMData *to_img, const string &cmp_name="ccc.tomo", const Dict &cmp_params=Dict()) const
 See Aligner comments for more details.
virtual EMDataalign (EMData *this_img, EMData *to_img) const
 See Aligner comments for more details.
virtual vector< Dictxform_align_nbest (EMData *this_img, EMData *to_img, const unsigned int nsoln, const string &cmp_name, const Dict &cmp_params) const
 See Aligner comments for more details.
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 = "rotate_symmetry_3d"

Detailed Description

3D rotational symmetry aligner.

This aligner takes a map, which must be first aligned to the symmetry axis, and rotates it to it symmetric positions. This is used to check for pseudo symmetry (such as finding the tail of an icosahedral virus). A list of best matches (moving to a reference is produced. Alternativly, a rotated verison of the moving map is returned.

Parameters:
sym The symmtery to use
verbose Turn this on to have useful information printed to standard out
Author:
John Flanagan
Date:
Mar 2011

Definition at line 1201 of file aligner.h.


Member Function Documentation

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

See Aligner comments for more details.

Implements EMAN::Aligner.

Definition at line 1210 of file aligner.h.

References align().

01211                         {
01212                                 return align(this_img, to_img, "ccc.tomo", Dict());
01213                         }

EMData * RT3DSymmetryAligner::align EMData this_img,
EMData to_img,
const string &  cmp_name = "ccc.tomo",
const Dict cmp_params = Dict()
const [virtual]
 

See Aligner comments for more details.

Implements EMAN::Aligner.

Definition at line 2247 of file aligner.cpp.

References EMAN::EMData::process(), EMAN::EMData::set_attr(), t, and xform_align_nbest().

02248 {
02249 
02250         vector<Dict> alis = xform_align_nbest(this_img,to,1,cmp_name,cmp_params);
02251 
02252         Dict t;
02253         Transform* tr = (Transform*) alis[0]["xform.align3d"];
02254         t["transform"] = tr;
02255         EMData* soln = this_img->process("xform",t);
02256         soln->set_attr("xform.align3d",tr);
02257         delete tr; tr = 0;
02258 
02259         return soln;
02260 
02261 }

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

Implements EMAN::Aligner.

Definition at line 1225 of file aligner.h.

01226                         {
01227                                 return "3D symmetry aligner";
01228                         }

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

01221                         {
01222                                 return NAME;
01223                         }

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

Implements EMAN::Aligner.

Definition at line 1235 of file aligner.h.

References EMAN::TypeDict::put().

01236                         {
01237                                 TypeDict d;
01238                                 d.put("sym", EMObject::FLOAT,"The symmetry. Default is icos");
01239                                 d.put("verbose", EMObject::BOOL,"Turn this on to have useful information printed to standard out.");
01240                                 return d;
01241                         }

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

Definition at line 1230 of file aligner.h.

01231                         {
01232                                 return new RT3DSymmetryAligner();
01233                         }

vector< Dict > RT3DSymmetryAligner::xform_align_nbest EMData this_img,
EMData to_img,
const unsigned int  nsoln,
const string &  cmp_name,
const Dict cmp_params
const [virtual]
 

See Aligner comments for more details.

Reimplemented from EMAN::Aligner.

Definition at line 2263 of file aligner.cpp.

References EMAN::EMData::cmp(), copy(), EMAN::Dict::end(), EMAN::Transform::get_rotation(), EMAN::Symmetry3D::get_symmetries(), EMAN::EMData::process(), and EMAN::Dict::set_default().

Referenced by align().

02264 {
02265         
02266         bool verbose = params.set_default("verbose",false);
02267         //Initialize a soln dict
02268         vector<Dict> solns;
02269         if (nsoln == 0) return solns; // What was the user thinking?
02270         for (unsigned int i = 0; i < nsoln; ++i ) {
02271                 Dict d;
02272                 d["score"] = 1.e24;
02273                 Transform t; // identity by default
02274                 d["xform.align3d"] = &t; // deep copy is going on here
02275                 solns.push_back(d);
02276         }
02277         
02278         //Genrate symmetry related orritenations
02279         vector<Transform> syms = Symmetry3D::get_symmetries((string)params.set_default("sym","icos"));
02280         
02281         float score = 0.0f;
02282         for ( vector<Transform>::const_iterator symit = syms.begin(); symit != syms.end(); ++symit ) {
02283                 Transform sympos = *symit; //stupidly this is necessary!!!
02284                 //Here move to sym position and compute the score
02285                 EMData* transformed = this_img->process("xform",Dict("transform",&sympos));
02286                 score = transformed->cmp(cmp_name,this_img,cmp_params);
02287                 delete transformed; transformed = 0;
02288                 
02289                 if (verbose) {
02290                         Dict rots = sympos.get_rotation("eman");
02291                         cout <<"Score is: " << score << " az " << float(rots["az"]) << " alt " << float(rots["alt"]) << " phi " << float(rots["phi"]) << endl;
02292                 }
02293                 
02294                 unsigned int j = 0;
02295                 for ( vector<Dict>::iterator it = solns.begin(); it != solns.end(); ++it, ++j ) {
02296                         if ( (float)(*it)["score"] > score ) { // Note greater than - EMAN2 preferes minimums as a matter of policy
02297                                 vector<Dict>::reverse_iterator rit = solns.rbegin();
02298                                 copy(rit+1,solns.rend()-j,rit);
02299                                 Dict& d = (*it);
02300                                 d["score"] = score;
02301                                 d["xform.align3d"] = &sympos; // deep copy is going on here
02302                                 break;
02303                         }
02304                 }
02305         }
02306         return solns;
02307 }


Member Data Documentation

const string RT3DSymmetryAligner::NAME = "rotate_symmetry_3d" [static]
 

Definition at line 78 of file aligner.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 12 13:50:23 2011 for EMAN2 by  doxygen 1.3.9.1