#include <symmetry.h>
Inheritance diagram for EMAN::HSym:
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< Vec3f > | get_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 Symmetry3D * | NEW () |
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. | |
HSym & | operator= (const HSym &) |
Disallow assignment. |
Definition at line 446 of file symmetry.h.
EMAN::HSym::HSym | ( | ) | [inline] |
virtual EMAN::HSym::~HSym | ( | ) | [inline, virtual] |
EMAN::HSym::HSym | ( | const HSym & | ) | [private] |
Disallow copy construction.
vector< Vec3f > HSym::get_asym_unit_points | ( | bool | inc_mirror = false |
) | const [virtual] |
inc_mirror | whether or not to include the mirror portion of the asymmetric unit |
Implements EMAN::Symmetry3D.
Definition at line 1568 of file symmetry.cpp.
References b, get_delimiters(), EMAN::FactoryBase::params, and EMAN::Dict::set_default().
01569 { 01570 vector<Vec3f> ret; 01571 01572 Dict delim = get_delimiters(inc_mirror); 01573 int nsym = params.set_default("nsym",1); 01574 float az = -(float)delim["az_max"]; 01575 01576 01577 bool tracing_arcs = false; 01578 01579 01580 if ( !tracing_arcs) { 01581 Vec3f a(0,-1,0); 01582 ret.push_back(a); 01583 01584 if ( nsym > 2 ) { 01585 Dict d("type","eman"); 01586 d["phi"] = 0.0f; 01587 d["alt"] = 0.0f; 01588 d["az"] = az; 01589 Vec3f b = Transform(d)*a; 01590 ret.push_back(b); 01591 } 01592 else 01593 { 01594 ret.push_back(Vec3f(1,0,0)); 01595 01596 ret.push_back(Vec3f(0,1,0)); 01597 01598 if ( nsym == 1 ) { 01599 ret.push_back(Vec3f(-1,0,0)); 01600 ret.push_back(a); 01601 } 01602 } 01603 } 01604 return ret; 01605 01606 }
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
inc_mirror | whether to include the mirror portion of the asymmetric unit |
Implements EMAN::Symmetry3D.
Definition at line 1562 of file symmetry.cpp.
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 "alt_min" 90-maxtilt 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).
inc_mirror | this parameter is not specifically acted upon in this class |
InvalidValueException | if nsym is less than or equal to zero |
Implements EMAN::Symmetry3D.
Definition at line 1527 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().
01527 { 01528 Dict returnDict; 01529 01530 // Get the parameters of interest 01531 int nsym = params.set_default("nsym",0); 01532 if ( nsym <= 0 ) throw InvalidValueException(nsym,"Error, you must specify a positive non zero nsym"); 01533 01534 float maxtilt = params.set_default("maxtilt",5.0f); 01535 01536 returnDict["alt_max"] = 90.0f; 01537 01538 returnDict["alt_min"] = 90.0f - maxtilt; 01539 01540 returnDict["az_max"] = 360.0f; 01541 01542 return returnDict; 01543 }
virtual string EMAN::HSym::get_desc | ( | ) | const [inline, virtual] |
Get a description.
Implements EMAN::FactoryBase.
Definition at line 468 of file symmetry.h.
00468 { return "Helical symmetry, with support for N-start, pitch and limited tilt range. Specify as H<nsym>,<nstart>,<daz>,<tz in pix>[,<maxtilt>]"; }
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.
Implements EMAN::Symmetry3D.
Definition at line 530 of file symmetry.h.
References EMAN::FactoryBase::params.
00530 { return (int)params["nstart"]; } // may not be
virtual string EMAN::HSym::get_name | ( | ) | const [inline, virtual] |
Return HSym::NAME.
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.
For helical symmetries this is provided by the user as a parameter when setting up the helical symmetry. Generally a multiple of nstart.
InvalidValueException | if d_az (as stored internally in parms) is less than or equal to zero |
Implements EMAN::Symmetry3D.
Definition at line 519 of file symmetry.h.
References EMAN::FactoryBase::params.
00519 { return (int)params["nsym"]; };
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
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 number of asymmetric units to generate. This could be infinite for helical symmetry. Normally a multiple of nstart."); 00480 d.put("nstart", EMObject::INT, "The Cn symmetry of a single Z-slice of the helix."); 00481 d.put("tz", EMObject::FLOAT, "The translational distance (along z) between successive identical subunits in angstroms (default A/pix is 1)"); 00482 d.put("daz", EMObject::FLOAT, "The rotational angle (about z) between successive identical subunits in degrees"); 00483 d.put("apix", EMObject::FLOAT, "Angstroms per pixel, default is 1.0, used only for tz"); 00484 d.put("maxtilt", EMObject::FLOAT, "When generating projections, normally only 'side views' are created (3-D Z along Y in 2-D). This is the maximum out of plane tilt in degrees."); 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.
n | the helical symmetry operation number. |
Implements EMAN::Symmetry3D.
Definition at line 1608 of file symmetry.cpp.
References EMAN::FactoryBase::params, EMAN::Dict::set_default(), and EMAN::Transform::set_trans().
01609 { 01610 int nstart=params["nstart"]; 01611 //int nsym=params["nsym"]; 01612 float apix = params.set_default("apix",1.0f); 01613 float daz= params["daz"]; 01614 float tz=params["tz"]; 01615 float dz=tz/apix; 01616 Dict d("type","eman"); 01617 01618 // courtesy of Phil Baldwin 01619 //d["az"] = (n%nsym) * 360.0f / nsym; 01620 //d["az"]=(((int) n/hsym)%nstart)*360.f/nstart+(n%hsym)*daz; 01621 //d["az"] = n * daz; 01622 d["az"]=(n%nstart)*(360.0/nstart)+floor(float(n)/nstart)*daz; // corrected by steve, 7/21/11. No dependency on nsym 01623 d["alt"] = 0.0f; 01624 d["phi"] = 0.0f; 01625 Transform ret(d); 01626 ret.set_trans(0,0,(n/nstart)*dz); 01627 return ret; 01628 }
virtual bool EMAN::HSym::is_h_sym | ( | ) | const [inline, virtual] |
Determines whether or not this Symmetry3D is the helical type - returns true.
Reimplemented from EMAN::Symmetry3D.
Definition at line 538 of file symmetry.h.
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.
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 |
Implements EMAN::Symmetry3D.
Definition at line 1545 of file symmetry.cpp.
References get_delimiters(), EMAN::FactoryBase::params, and EMAN::Dict::set_default().
01546 { 01547 Dict d = get_delimiters(inc_mirror); 01548 float alt_max = d["alt_max"]; 01549 float alt_min = d["alt_min"]; 01550 01551 if (inc_mirror) { 01552 float e = params.set_default("maxtilt",5.0f); 01553 alt_min -= e; 01554 } 01555 01556 float az_max = d["az_max"]; 01557 01558 if ( altitude >=alt_min && altitude <= alt_max && azimuth <= az_max && azimuth >= 0 ) return true; 01559 return false; 01560 }
static Symmetry3D* EMAN::HSym::NEW | ( | ) | [inline, static] |
Factory support function NEW.
Definition at line 455 of file symmetry.h.
References HSym().
00456 { 00457 return new HSym(); 00458 }
const string HSym::NAME = "h" [static] |
The name of this class - used to access it from factories etc. Should be "h".
Definition at line 533 of file symmetry.h.
Referenced by get_name().