EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
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]

Public Member Functions

 HSym ()
 
virtual ~HSym ()
 
virtual string get_name () const
 Return HSym::NAME. More...
 
virtual string get_desc () const
 Get a description. More...
 
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. More...
 
virtual Dict get_delimiters (const bool inc_mirror=false) const
 Get the altitude and phi angle of the d symmetry, which depends on nysm. More...
 
virtual Transform get_sym (const int n) const
 Provides access to the complete set of rotational and translational symmetry operations associated with helical symmetry. More...
 
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. More...
 
virtual int get_max_csym () const
 Gets the maximum cylcic symmetry exhibited by this object. More...
 
virtual bool is_h_sym () const
 Determines whether or not this Symmetry3D is the helical type - returns true. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from EMAN::Symmetry3D
 Symmetry3D ()
 
virtual ~Symmetry3D ()
 
virtual float get_az_alignment_offset () const
 This functionality is only relevant to platonic symmetries. More...
 
virtual bool is_platonic_sym () const
 A function that is used to determine if this is a platonic symmetry object This function is only virtually overidden by the PlatonicSym symmetry, which returns true, not false. More...
 
virtual bool is_c_sym () const
 A function that is used to determine if this is a c symmetry object This function is only virtually overidden by the CSym object, which returns true. More...
 
virtual bool is_d_sym () const
 A function that is used to determine if this is a d symmetry object This function is only virtually overidden by the DSym object, which returns true. More...
 
virtual bool is_tet_sym () const
 A function that is used to determine if this is the tetrahedral symmetry object This function is only virtually overidden by the TetSym object, which returns true. More...
 
vector< Transformgen_orientations (const string &generatorname="eman", const Dict &parms=Dict())
 Ask the Symmetry3D object to generate a set of orientations in its asymmetric unit using an OrientationGenerator constructed from the given parameters (using a Factory). More...
 
virtual Transform reduce (const Transform &t3d, int n=0) const
 A function that will reduce an orientation, as characterized by Euler anges, into a specific asymmetric unit. More...
 
virtual int in_which_asym_unit (const Transform &t3d) const
 A function that will determine in which asymmetric unit a given orientation resides The asymmetric unit 'number' will depend entirely on the order in which different symmetry operations are return by the Symmetry3D::get_sym function. More...
 
virtual int point_in_which_asym_unit (const Vec3f &v) const
 A function that will determine in which asymmetric unit a given vector resides The asymmetric unit 'number' will depend entirely on the order in which different symmetry operations are return by the Symmetry3D::get_sym function The vector is a point. More...
 
virtual vector< Transformget_touching_au_transforms (bool inc_mirror=true) const
 Gets a vector of Transform objects that define the set of asymmetric units that touch the default asymmetric unit. More...
 
virtual vector< Transformget_syms () const
 
- Public Member Functions inherited from EMAN::FactoryBase
 FactoryBase ()
 
virtual ~FactoryBase ()
 
Dict get_params () const
 get a copy of the parameters of this class More...
 
void set_params (const Dict &new_params)
 Set new parameters. More...
 
void set_param (const string key, const EMObject val)
 
void insert_params (const Dict &new_params)
 Insert parameters. More...
 
Dict copy_relevant_params (const FactoryBase *const that) const
 

Static Public Member Functions

static Symmetry3DNEW ()
 Factory support function NEW. More...
 
- Static Public Member Functions inherited from EMAN::Symmetry3D
static vector< Transformget_symmetries (const string &symmetry)
 

Static Public Attributes

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

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from EMAN::Symmetry3D
typedef vector< vector< Vec3f > >::const_iterator cit
 
typedef vector< vector< Vec3f > >::iterator ncit
 
- Protected Member Functions inherited from EMAN::Symmetry3D
void cache_au_planes () const
 Establish the asymmetric unit planes cache. More...
 
void delete_au_planes ()
 Clear the asymmetric unit planes cache. More...
 
- Protected Attributes inherited from EMAN::Symmetry3D
float ** cached_au_planes
 The asymmetric unit planes are cached to provide a great speed up the point_in_which_asym_unit function, which is called by reduce and by in_which_asym_unit. More...
 
int cache_size
 Have to remember the cache size. More...
 
int num_triangles
 This is stores the number of triangles returned by get_asym_unit_triangles(true) More...
 
vector< vector< Vec3f > > au_sym_triangles
 This cache is of size cache_size. More...
 
- Protected Attributes inherited from EMAN::FactoryBase
Dict params
 This is the dictionary the stores the parameters of the object. More...
 

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

◆ HSym() [1/2]

EMAN::HSym::HSym ( )
inline

Definition at line 449 of file symmetry.h.

449{};

Referenced by NEW().

◆ ~HSym()

virtual EMAN::HSym::~HSym ( )
inlinevirtual

Definition at line 450 of file symmetry.h.

450{};

◆ HSym() [2/2]

EMAN::HSym::HSym ( const HSym )
private

Disallow copy construction.

Member Function Documentation

◆ get_asym_unit_points()

vector< Vec3f > HSym::get_asym_unit_points ( bool  inc_mirror = false) const
virtual
Parameters
inc_mirrorwhether 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 1608 of file symmetry.cpp.

1609{
1610 vector<Vec3f> ret;
1611
1612 Dict delim = get_delimiters(inc_mirror);
1613 int nsym = params.set_default("nsym",1);
1614 float az = -(float)delim["az_max"];
1615
1616
1617 bool tracing_arcs = false;
1618
1619
1620 if ( !tracing_arcs) {
1621 Vec3f a(0,-1,0);
1622 ret.push_back(a);
1623
1624 if ( nsym > 2 ) {
1625 Dict d("type","eman");
1626 d["phi"] = 0.0f;
1627 d["alt"] = 0.0f;
1628 d["az"] = az;
1629 Vec3f b = Transform(d)*a;
1630 ret.push_back(b);
1631 }
1632 else
1633 {
1634 ret.push_back(Vec3f(1,0,0));
1635
1636 ret.push_back(Vec3f(0,1,0));
1637
1638 if ( nsym == 1 ) {
1639 ret.push_back(Vec3f(-1,0,0));
1640 ret.push_back(a);
1641 }
1642 }
1643 }
1644 return ret;
1645
1646}
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
Dict params
This is the dictionary the stores the parameters of the object.
Definition: emobject.h:953
virtual Dict get_delimiters(const bool inc_mirror=false) const
Get the altitude and phi angle of the d symmetry, which depends on nysm.
Definition: symmetry.cpp:1567
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
Vec3< float > Vec3f
Definition: vec3.h:693

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

◆ get_asym_unit_triangles()

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_mirrorwhether to include the mirror portion of the asymmetric unit

Implements EMAN::Symmetry3D.

Definition at line 1602 of file symmetry.cpp.

1602 {
1603
1604 vector<vector<Vec3f> > ret;
1605 return ret;
1606}

◆ get_delimiters()

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

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

Implements EMAN::Symmetry3D.

Definition at line 1567 of file symmetry.cpp.

1567 {
1568 Dict returnDict;
1569
1570 // Get the parameters of interest
1571 int nsym = params.set_default("nsym",0);
1572 if ( nsym <= 0 ) throw InvalidValueException(nsym,"Error, you must specify a positive non zero nsym");
1573
1574 float maxtilt = params.set_default("maxtilt",90.0f);
1575
1576 returnDict["alt_max"] = 90.0f;
1577
1578 returnDict["alt_min"] = 90.0f - maxtilt;
1579
1580 returnDict["az_max"] = 360.0f;
1581
1582 return returnDict;
1583}
#define InvalidValueException(val, desc)
Definition: exception.h:285

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

Referenced by get_asym_unit_points(), and is_in_asym_unit().

◆ get_desc()

virtual string EMAN::HSym::get_desc ( ) const
inlinevirtual

Get a description.

Returns
a clear desciption of this class

Implements EMAN::FactoryBase.

Definition at line 468 of file symmetry.h.

468{ return "Helical symmetry, with support for N-start, pitch and limited tilt range. Specify as H[nsym]:[nstart]:[daz]:[tz in pix](:[maxtilt])"; }

◆ get_max_csym()

virtual int EMAN::HSym::get_max_csym ( ) const
inlinevirtual

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 530 of file symmetry.h.

530{ return (int)params["nstart"]; } // may not be

References EMAN::FactoryBase::params.

◆ get_name()

virtual string EMAN::HSym::get_name ( ) const
inlinevirtual

Return HSym::NAME.

Returns
the unique name of this class

Implements EMAN::FactoryBase.

Definition at line 463 of file symmetry.h.

463{ return NAME; }
static const string NAME
The name of this class - used to access it from factories etc. Should be "h".
Definition: symmetry.h:533

References NAME.

◆ get_nsym()

virtual int EMAN::HSym::get_nsym ( ) const
inlinevirtual

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.

Returns
the number of symmetric rotations that can be applied without going beyond 360 degrees
Exceptions
InvalidValueExceptionif 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.

519{ return (int)params["nsym"]; };

References EMAN::FactoryBase::params.

◆ get_param_types()

virtual TypeDict EMAN::HSym::get_param_types ( ) const
inlinevirtual

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.

477 {
478 TypeDict d;
479 d.put("nsym", EMObject::INT, "The number of asymmetric units to generate. This could be infinite for helical symmetry. Normally a multiple of nstart.");
480 d.put("nstart", EMObject::INT, "The Cn symmetry of a single Z-slice of the helix.");
481 d.put("tz", EMObject::FLOAT, "The translational distance (along z) between successive identical subunits in angstroms (default A/pix is 1)");
482 d.put("daz", EMObject::FLOAT, "The rotational angle (about z) between successive identical subunits in degrees");
483 d.put("apix", EMObject::FLOAT, "Angstroms per pixel, default is 1.0, used only for tz");
484 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.");
485 return d;
486 }

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

◆ get_sym()

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
nthe helical symmetry operation number.
Returns
a transform containing the correct rotational and translational symmetry operation.

Implements EMAN::Symmetry3D.

Definition at line 1648 of file symmetry.cpp.

1649{
1650 int nstart=params["nstart"];
1651 //int nsym=params["nsym"];
1652 float apix = params.set_default("apix",1.0f);
1653 float daz= params["daz"];
1654 float tz=params["tz"];
1655 float dz=tz/apix;
1656 Dict d("type","eman");
1657
1658 // courtesy of Phil Baldwin
1659 //d["az"] = (n%nsym) * 360.0f / nsym;
1660 //d["az"]=(((int) n/hsym)%nstart)*360.f/nstart+(n%hsym)*daz;
1661 //d["az"] = n * daz;
1662 int ii=(n+1)/2;
1663 if (n>1 && n%2==0) ii*=-1; // extend to both directions
1664 d["az"]=(ii%nstart)*(360.0/nstart)+floor(float(ii)/nstart)*daz; // corrected by steve, 7/21/11. No dependency on nsym
1665 d["alt"] = 0.0f;
1666 d["phi"] = 0.0f;
1667 Transform ret(d);
1668 ret.set_trans(0,0,(ii/nstart)*dz);
1669 return ret;
1670}

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

◆ is_h_sym()

virtual bool EMAN::HSym::is_h_sym ( ) const
inlinevirtual

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 538 of file symmetry.h.

538{ return true; }

◆ is_in_asym_unit()

bool HSym::is_in_asym_unit ( const float &  altitude,
const float &  azimuth,
const bool  inc_mirror = false 
) 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
altitudethe EMAN style altitude of the 3D orientation in degrees
azimuththe EMAN style azimuth of the 3D orientation in degrees
inc_mirrorwhether 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 1585 of file symmetry.cpp.

1586{
1587 Dict d = get_delimiters(inc_mirror);
1588 float alt_max = d["alt_max"];
1589 float alt_min = d["alt_min"];
1590
1591 if (inc_mirror) {
1592 float e = params.set_default("maxtilt",90.0f);
1593 alt_min -= e;
1594 }
1595
1596 float az_max = d["az_max"];
1597
1598 if ( altitude >=alt_min && altitude <= alt_max && azimuth <= az_max && azimuth >= 0 ) return true;
1599 return false;
1600}

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

◆ NEW()

static Symmetry3D * EMAN::HSym::NEW ( )
inlinestatic

Factory support function NEW.

Returns
a newly instantiated class of this type

Definition at line 455 of file symmetry.h.

456 {
457 return new HSym();
458 }

References HSym().

◆ operator=()

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

Disallow assignment.

Member Data Documentation

◆ NAME

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


The documentation for this class was generated from the following files: