EMAN::HSym Class Reference

An encapsulation of helical 3D symmetry. More...

#include <symmetry.h>

Inheritance diagram for EMAN::HSym:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HSym ()
virtual ~HSym ()
virtual string get_name () const
 Return HSym::NAME.
virtual string get_desc () const
 Get a description.
virtual TypeDict get_param_types () const
 Get a dictionary containing the permissable parameters of this class Of all the symmetries, helical has the most options.
virtual Dict get_delimiters (const bool inc_mirror=false) const
 Get the altitude and phi angle of the d symmetry, which depends on nysm.
virtual Transform get_sym (const int n) const
 Provides access to the complete set of rotational and translational symmetry operations associated with helical symmetry.
virtual int get_nsym () const
 For symmetries in general this function is supposed to return the number of unique symmetric operations that can be applied for the given Symmetry3D object.
virtual int get_max_csym () const
 Gets the maximum cylcic symmetry exhibited by this object.
virtual bool is_h_sym () const
 Determines whether or not this Symmetry3D is the helical type - returns true.
virtual bool is_in_asym_unit (const float &altitude, const float &azimuth, const bool inc_mirror) const
 A function to be used when generating orientations over portion of the unit sphere defined by parameters returned by get_delimiters.
virtual vector< Vec3fget_asym_unit_points (bool inc_mirror=false) const
virtual vector< vector< Vec3f > > get_asym_unit_triangles (bool inc_mirror) const
 Get triangles that precisely occlude the projection area of the default asymmetric unit.

Static Public Member Functions

static Symmetry3DNEW ()
 Factory support function NEW.

Static Public Attributes

static const string NAME = "h"
 The name of this class - used to access it from factories etc. Should be "h".

Private Member Functions

 HSym (const HSym &)
 Disallow copy construction.
HSymoperator= (const HSym &)
 Disallow assignment.

Detailed Description

An encapsulation of helical 3D symmetry.

Author:
David Woolford (based on previous work by Phil Baldwin and Steve Ludtke)
Date:
Feb 2008

Definition at line 446 of file symmetry.h.


Constructor & Destructor Documentation

EMAN::HSym::HSym (  )  [inline]

Definition at line 449 of file symmetry.h.

Referenced by NEW().

00449 {};

virtual EMAN::HSym::~HSym (  )  [inline, virtual]

Definition at line 450 of file symmetry.h.

00450 {};

EMAN::HSym::HSym ( const HSym  )  [private]

Disallow copy construction.


Member Function Documentation

vector< Vec3f > HSym::get_asym_unit_points ( bool  inc_mirror = false  )  const [virtual]

Parameters:
inc_mirror whether or not to include the mirror portion of the asymmetric unit
Returns:
a cyclic set of points which can be connected using great arcs on the unit sphere to demarcate the asymmetric unit. The last should may be connected to the first.

Implements EMAN::Symmetry3D.

Definition at line 1528 of file symmetry.cpp.

References b, get_delimiters(), EMAN::FactoryBase::params, and EMAN::Dict::set_default().

01529 {
01530         vector<Vec3f> ret;
01531 
01532         Dict delim = get_delimiters(inc_mirror);
01533         int nsym = params.set_default("nsym",0);
01534         float az = -(float)delim["az_max"];
01535 
01536 
01537         bool tracing_arcs = false;
01538 
01539 
01540         if ( !tracing_arcs) {
01541                 Vec3f a(0,-1,0);
01542                 ret.push_back(a);
01543 
01544                 if ( nsym > 2 ) {
01545                         Dict d("type","eman");
01546                         d["phi"] = 0.0f;
01547                         d["alt"] = 0.0f;
01548                         d["az"] = az;
01549                         Vec3f b = Transform(d)*a;
01550                         ret.push_back(b);
01551                 }
01552                 else
01553                 {
01554                         ret.push_back(Vec3f(1,0,0));
01555 
01556                         ret.push_back(Vec3f(0,1,0));
01557 
01558                         if ( nsym == 1 ) {
01559                                 ret.push_back(Vec3f(-1,0,0));
01560                                 ret.push_back(a);
01561                         }
01562                 }
01563         }
01564         return ret;
01565 
01566 }

vector< vector< Vec3f > > HSym::get_asym_unit_triangles ( bool  inc_mirror  )  const [virtual]

Get triangles that precisely occlude the projection area of the default asymmetric unit.

This is used for collision detection in Symmetry3D::reduce

Parameters:
inc_mirror whether to include the mirror portion of the asymmetric unit

Implements EMAN::Symmetry3D.

Definition at line 1522 of file symmetry.cpp.

01522                                                                          {
01523 
01524         vector<vector<Vec3f> > ret;
01525         return ret;
01526 }

Dict HSym::get_delimiters ( const bool  inc_mirror = false  )  const [virtual]

Get the altitude and phi angle of the d symmetry, which depends on nysm.

The "alt_max" is always 90 + the "equator_range" variable in the internally stored params The "alt_min" veriable is always 90. The "az_max" is always 360/nsym degrees Helical symmetry argument is the only symmetry not to act on the inc_mirror argument. The current policy is the orientation generator using this symmetry should make its own accomodation for the inclusion of mirror orientations if the symmetry is helical (hence the presence of the is_h_sym function in the Symmetry3D class).

Parameters:
inc_mirror this parameter is not specifically acted upon in this class
Returns:
a dictionary containing the keys "alt_max" and "az_max" and "alt_min"
Exceptions:
InvalidValueException if nsym is less than or equal to zero

Implements EMAN::Symmetry3D.

Definition at line 1487 of file symmetry.cpp.

References InvalidValueException, EMAN::FactoryBase::params, and EMAN::Dict::set_default().

Referenced by get_asym_unit_points(), and is_in_asym_unit().

01487                                           {
01488         Dict returnDict;
01489 
01490         // Get the parameters of interest
01491         int nsym = params.set_default("nsym",0);
01492         if ( nsym <= 0 ) throw InvalidValueException(nsym,"Error, you must specify a positive non zero nsym");
01493 
01494         float equator_range = params.set_default("equator_range",5.0f);
01495 
01496         returnDict["alt_max"] = 90.0f + equator_range;
01497 
01498         returnDict["alt_min"] = 90.0f;
01499 
01500         returnDict["az_max"] = 360.0f/(float)nsym;
01501 
01502         return returnDict;
01503 }

virtual string EMAN::HSym::get_desc (  )  const [inline, virtual]

Get a description.

Returns:
a clear desciption of this class

Implements EMAN::FactoryBase.

Definition at line 468 of file symmetry.h.

00468 { return "H symmetry support"; }

virtual int EMAN::HSym::get_max_csym (  )  const [inline, virtual]

Gets the maximum cylcic symmetry exhibited by this object.

This is used by OrientationGenerators, and is probably not something a general user would utilize.

Returns:
nsym - this is the symmetry of the helix

Implements EMAN::Symmetry3D.

Definition at line 533 of file symmetry.h.

References EMAN::FactoryBase::params.

00533 { return params["nsym"]; }

virtual string EMAN::HSym::get_name (  )  const [inline, virtual]

Return HSym::NAME.

Returns:
the unique name of this class

Implements EMAN::FactoryBase.

Definition at line 463 of file symmetry.h.

References NAME.

00463 { return NAME; }

virtual int EMAN::HSym::get_nsym (  )  const [inline, virtual]

For symmetries in general this function is supposed to return the number of unique symmetric operations that can be applied for the given Symmetry3D object.

However, for helical symmetry it is possible that the there are infinitely many symmetric operations. So there is no general answer to return here. So, as a hack, the answer returned is the number of rotional steps (as specified by the "d_az" paramater) that can be applied before surpassing 360 degrees.

Returns:
the number of symmetric rotations that can be applied without going beyond 360 degrees
Exceptions:
InvalidValueException if d_az (as stored internally in parms) is less than or equal to zero

Implements EMAN::Symmetry3D.

Definition at line 522 of file symmetry.h.

References EMAN::FactoryBase::params.

00522 { return (int)params["nsym"]; }; // ming, this is the number of helix turns

virtual TypeDict EMAN::HSym::get_param_types (  )  const [inline, virtual]

Get a dictionary containing the permissable parameters of this class Of all the symmetries, helical has the most options.

This is because different approaches have to taken in regard to defining an asymmetric unit and to returning the set of rotational and translational symmetry operations

Returns:
a dictionary containing the permissable parameters of this class

Implements EMAN::FactoryBase.

Definition at line 476 of file symmetry.h.

References EMAN::EMObject::FLOAT, EMAN::EMObject::INT, and EMAN::TypeDict::put().

00477                 {
00478                         TypeDict d;
00479                         d.put("nsym", EMObject::INT, "The symmetry number of the helix, around the equator.");
00480                         d.put("nstart", EMObject::INT, "The symmetry number of the implicit C symmetry.");//ming add
00481                         d.put("equator_range", EMObject::FLOAT, "The amount altitude angles are allowed to vary above and below the equator. Default is 5");
00482                         d.put("tz", EMObject::FLOAT, "The translational distance (along z) between successive identical subunits in angstrom (default a/pix is 1)");
00483                         d.put("daz", EMObject::FLOAT, "The rotational angle (about z) between successive identical subunits in degrees");
00484                         d.put("apix", EMObject::FLOAT, "Angstrom per pixel, default is one.");
00485                         return d;
00486                 }

Transform HSym::get_sym ( const int  n  )  const [virtual]

Provides access to the complete set of rotational and translational symmetry operations associated with helical symmetry.

This symmetry operations are generated in a straightforward way from the parameters of this class, specifically the return Transform object has an azimuth of n times the "d_az" (as specified in the parameters of this class), and has a post translation of "tz" in the z direction.

Parameters:
n the helical symmetry operation number.
Returns:
a transform3d containing the correct rotational and translational symmetry operation.

Implements EMAN::Symmetry3D.

Definition at line 1568 of file symmetry.cpp.

References EMAN::FactoryBase::params, EMAN::Dict::set_default(), and EMAN::Transform::set_trans().

01569 {
01570         int nstart=params["nstart"];
01571         int nsym=params["nsym"];
01572         int hsym=nsym/nstart;
01573         float apix = params.set_default("apix",1.0f);
01574         float daz= params["daz"];
01575         float tz=params["tz"];
01576         float dz=tz/apix;
01577         Dict d("type","eman");
01578 
01579         // courtesy of Phil Baldwin
01580         //d["az"] = (n%nsym) * 360.0f / nsym;
01581         d["az"]=(((int) n/hsym)%nstart)*360.f/nstart+(n%hsym)*daz;
01582         //d["az"] = n * daz;
01583         d["alt"] = 0.0f;
01584         d["phi"] = 0.0f;
01585         Transform ret(d);
01586         ret.set_trans(0,0,(n%hsym)*dz);
01587         return ret;
01588 }

virtual bool EMAN::HSym::is_h_sym (  )  const [inline, virtual]

Determines whether or not this Symmetry3D is the helical type - returns true.

Returns:
true - indicating that this is a helical symmetry object

Reimplemented from EMAN::Symmetry3D.

Definition at line 541 of file symmetry.h.

00541 { return true; }

bool HSym::is_in_asym_unit ( const float &  altitude,
const float &  azimuth,
const bool  inc_mirror 
) const [virtual]

A function to be used when generating orientations over portion of the unit sphere defined by parameters returned by get_delimiters.

In platonic symmetry altitude and azimuth alone are not enough to correctly demarcate the asymmetric unit. See the get_delimiters comments.

Parameters:
altitude the EMAN style altitude of the 3D orientation in degrees
azimuth the EMAN style azimuth of the 3D orientation in degrees
inc_mirror whether or not to include orientations if they are in the mirror portion of the asymmetric unit
Returns:
true or false, depending on whether or not the orientation is within the asymmetric unit

Implements EMAN::Symmetry3D.

Definition at line 1505 of file symmetry.cpp.

References get_delimiters(), EMAN::FactoryBase::params, and EMAN::Dict::set_default().

01506 {
01507         Dict d = get_delimiters(inc_mirror);
01508         float alt_max = d["alt_max"];
01509         float alt_min = d["alt_min"];
01510 
01511         if (inc_mirror) {
01512                 float e = params.set_default("equator_range",5.0f);
01513                 alt_min -= e;
01514         }
01515 
01516         float az_max = d["az_max"];
01517 
01518         if ( altitude >=alt_min && altitude <= alt_max && azimuth <= az_max && azimuth >= 0 ) return true;
01519         return false;
01520 }

static Symmetry3D* EMAN::HSym::NEW (  )  [inline, static]

Factory support function NEW.

Returns:
a newly instantiated class of this type

Definition at line 455 of file symmetry.h.

References HSym().

00456                 {
00457                         return new HSym();
00458                 }

HSym& EMAN::HSym::operator= ( const HSym  )  [private]

Disallow assignment.


Member Data Documentation

const string HSym::NAME = "h" [static]

The name of this class - used to access it from factories etc. Should be "h".

Definition at line 536 of file symmetry.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Mon Jul 19 12:44:49 2010 for EMAN2 by  doxygen 1.4.7