EMAN2
|
Symmetry3D - A base class for 3D Symmetry objects. More...
#include <symmetry.h>
Public Types | |
typedef vector< vector< Vec3f > >::const_iterator | cit |
typedef vector< vector< Vec3f > >::iterator | ncit |
Public Member Functions | |
Symmetry3D () | |
virtual | ~Symmetry3D () |
virtual Dict | get_delimiters (const bool inc_mirror=false) const =0 |
Every Symmetry3D object must return a dictionary containing the delimiters that define its asymmetric unit (this is not strictly true in the case of the PlatonicSym class) More... | |
virtual Transform | get_sym (const int n) const =0 |
Every Symmetry3D object must provide access to the full set of its symmetry operators via this function. More... | |
virtual int | get_nsym () const =0 |
The total number of unique symmetry operations that will be return by this object when a calling program access Symmetry3D::get_sym. More... | |
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_h_sym () const |
A function that is used to determine if this is a Helical symmetry object This function is only virtually overidden by the HSym 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... | |
virtual int | get_max_csym () const =0 |
The Symmetry3D object must return the maximum degree of symmetry it exhibits about any one axis. More... | |
virtual vector< Vec3f > | get_asym_unit_points (bool inc_mirror) const =0 |
The Symmetry3D object must be capable of returning an ordered list of points on the unit sphere that define its asymmetric unit (with mirror considerations). More... | |
vector< Transform > | gen_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 bool | is_in_asym_unit (const float &altitude, const float &azimuth, const bool inc_mirror) const =0 |
A function to be used when generating orientations over portion of the unit sphere defined by parameters returned by get_delimiters. 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< vector< Vec3f > > | get_asym_unit_triangles (bool inc_mirror) const =0 |
Get triangles that precisely occlude the projection area of the default asymmetric unit. More... | |
virtual vector< Transform > | get_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< Transform > | get_syms () const |
Public Member Functions inherited from EMAN::FactoryBase | |
FactoryBase () | |
virtual | ~FactoryBase () |
virtual string | get_name () const =0 |
Get the unique name of this class (especially for factory based instantiation access) More... | |
virtual string | get_desc () const =0 |
Get a clear, concise description of this class. More... | |
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) |
virtual TypeDict | get_param_types () const =0 |
void | insert_params (const Dict &new_params) |
Insert parameters. More... | |
Dict | copy_relevant_params (const FactoryBase *const that) const |
Static Public Member Functions | |
static vector< Transform > | get_symmetries (const string &symmetry) |
Protected Member Functions | |
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 | |
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... | |
Private Member Functions | |
Symmetry3D (const Symmetry3D &) | |
Disallow copy construction. More... | |
Symmetry3D & | operator= (const Symmetry3D &) |
Disallow assignment. More... | |
Symmetry3D - A base class for 3D Symmetry objects.
Objects of this type must provide delimiters for the asymmetric unit (get_delimiters), and must also provide all of the rotational symmetric operations (get_sym(const int n)). They must also provide the total number of unique symmetric operations with get_nsym (except in helical symmetry). get_delimiter returns a dictionary with "alt_max" and "az_max" keys, which correspond to the encompassing azimuth and altitude angles of the asymmetric unit. These can be interpreted in a relatively straight forward fashion when dealing with C and D symmetries to demarcate the asymmetric unit, however when dealing with Platonic symmetries the asymmetric unit is not so trivial. see http://blake.bcm.edu/emanwiki/EMAN2/Symmetry for figures and description of what we're doing here, for all the symmetries, and look in the comments of the PlatonicSym classes themselves. It inherits from a factory base, making it amenable to incorporation in EMAN2 style factories
Definition at line 56 of file symmetry.h.
typedef vector<vector<Vec3f>>::const_iterator EMAN::Symmetry3D::cit |
Definition at line 59 of file symmetry.h.
typedef vector<vector<Vec3f>>::iterator EMAN::Symmetry3D::ncit |
Definition at line 60 of file symmetry.h.
Symmetry3D::Symmetry3D | ( | ) |
Definition at line 962 of file symmetry.cpp.
|
virtual |
Definition at line 963 of file symmetry.cpp.
References cached_au_planes, and delete_au_planes().
|
private |
Disallow copy construction.
|
protected |
Establish the asymmetric unit planes cache.
Definition at line 1020 of file symmetry.cpp.
References au_sym_triangles, cache_size, cached_au_planes, EMAN::Util::equation_of_plane(), get_asym_unit_triangles(), get_nsym(), get_sym(), num_triangles, and UnexpectedBehaviorException.
Referenced by point_in_which_asym_unit().
|
protected |
Clear the asymmetric unit planes cache.
Definition at line 1059 of file symmetry.cpp.
References cache_size, cached_au_planes, and UnexpectedBehaviorException.
Referenced by ~Symmetry3D().
vector< Transform > Symmetry3D::gen_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).
This is reminiscent of the strategy design pattern
generatorname | the string name of the OrientationGenerator, as accessed for the OrientationGenerator factory |
parms | the parameters handed to OrientationGenerator::set_params after initial construction |
Definition at line 167 of file symmetry.cpp.
References ENTERFUNC, EXITFUNC, EMAN::OrientationGenerator::gen_orientations(), and EMAN::Util::str_to_lower().
Referenced by EMAN::RT3DSphereAligner::xform_align_nbest(), EMAN::RT2Dto3DTreeAligner::xform_align_nbest(), EMAN::RT3DTreeAligner::xform_align_nbest(), and EMAN::RT3DLocalTreeAligner::xform_align_nbest().
|
pure virtual |
The Symmetry3D object must be capable of returning an ordered list of points on the unit sphere that define its asymmetric unit (with mirror considerations).
The list can be any length, and must be constructed carefully. If the list consists of points A B and C, then arcs on the unit sphere connecting A to B, then B to C, then C to A must define the asymmetric unit (with or without its mirror portion). i.e. it is a cyclic list, on any length
inc_mirror | whether or not to include the mirror portion of the asymmetric unit |
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::PlatonicSym, and EMAN::TetrahedralSym.
Referenced by get_touching_au_transforms().
|
pure virtual |
Get triangles that precisely occlude the projection area of the default asymmetric unit.
This will be used for collision detection in Symmetry3D::reduce
inc_mirror | whether to include the mirror portion of the asymmetric unit |
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, and EMAN::PlatonicSym.
Referenced by cache_au_planes().
|
inlinevirtual |
This functionality is only relevant to platonic symmetries.
But it could grow into functionality for the other symmetries.
Reimplemented in EMAN::TetrahedralSym, EMAN::IcosahedralSym, and EMAN::Icosahedral2Sym.
Definition at line 86 of file symmetry.h.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), and EMAN::PlatonicSym::get_asym_unit_points().
|
pure virtual |
Every Symmetry3D object must return a dictionary containing the delimiters that define its asymmetric unit (this is not strictly true in the case of the PlatonicSym class)
inc_mirror | whether or not the mirror part of the asymmetric unit should be included in the consideration |
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, and EMAN::PlatonicSym.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), EMAN::SaffOrientationGenerator::get_orientations_tally(), and get_touching_au_transforms().
|
pure virtual |
The Symmetry3D object must return the maximum degree of symmetry it exhibits about any one axis.
This function is only called in the AsymmUnitOrientationGenerator.
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::TetrahedralSym, EMAN::OctahedralSym, EMAN::IcosahedralSym, and EMAN::Icosahedral2Sym.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EmanOrientationGenerator::get_orientations_tally(), and EMAN::PlatonicSym::init().
|
pure virtual |
The total number of unique symmetry operations that will be return by this object when a calling program access Symmetry3D::get_sym.
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::TetrahedralSym, EMAN::OctahedralSym, EMAN::IcosahedralSym, and EMAN::Icosahedral2Sym.
Referenced by cache_au_planes(), EMAN::BackProjectionReconstructor::finish(), EMAN::RealMedianReconstructor::finish(), EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::RandomOrientationGenerator::gen_orientations(), EMAN::OrientationGenerator::get_az_max(), EMAN::Transform::get_nsym(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::Transform::get_sym_proj(), get_syms(), get_touching_au_transforms(), and point_in_which_asym_unit().
|
pure virtual |
Every Symmetry3D object must provide access to the full set of its symmetry operators via this function.
n | the symmetry operator number |
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::TetrahedralSym, EMAN::OctahedralSym, EMAN::IcosahedralSym, and EMAN::Icosahedral2Sym.
Referenced by cache_au_planes(), EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::Transform::get_sym(), EMAN::Transform::get_sym_proj(), get_syms(), get_touching_au_transforms(), and reduce().
|
static |
Definition at line 1240 of file symmetry.cpp.
References EMAN::Factory< T >::get(), get_syms(), and EMAN::Util::str_to_lower().
Referenced by EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::do_insert_slice_work(), EMAN::FourierIterReconstructor::insert_slice(), EMAN::SymSearchProcessor::process_inplace(), and EMAN::RT3DSymmetryAligner::xform_align_nbest().
|
virtual |
Definition at line 1224 of file symmetry.cpp.
References get_nsym(), and get_sym().
Referenced by EMAN::BackProjectionReconstructor::finish(), EMAN::RealMedianReconstructor::finish(), get_symmetries(), EMAN::ApplySymProcessor::process(), and EMAN::SegmentSubunitProcessor::process_inplace().
|
virtual |
Gets a vector of Transform objects that define the set of asymmetric units that touch the default asymmetric unit.
The 'default asymmetric unit' is defined by the results of Symmetry3d::get_asym_unit_points and is sensitive to whether or not you want to include the mirror part of the asymmetric unit. This function is useful when used in conjunction with Symmetry3D::reduce, and particularly when finding the angular deviation of particles through different stages of iterative Single Particle Reconstruction This function could be expanded to work for an asymmetric unit number supplied by the user.
inc_mirror | whether or not to include the mirror portion of the asymmetric unit |
Definition at line 1155 of file symmetry.cpp.
References EMAN::EMConsts::deg2rad, get_asym_unit_points(), get_delimiters(), get_nsym(), get_sym(), is_d_sym(), is_platonic_sym(), EMAN::Vec3< Type >::squared_length(), x, and y.
|
virtual |
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.
t3d | a Transform characterizing an orientation |
Definition at line 1001 of file symmetry.cpp.
References EMAN::Transform::invert(), and point_in_which_asym_unit().
Referenced by reduce().
|
inlinevirtual |
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.
Reimplemented in EMAN::CSym.
Definition at line 106 of file symmetry.h.
Referenced by EMAN::RandomOrientationGenerator::gen_orientations(), and EMAN::OrientationGenerator::get_az_max().
|
inlinevirtual |
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.
Reimplemented in EMAN::DSym.
Definition at line 112 of file symmetry.h.
Referenced by EMAN::OrientationGenerator::get_az_max(), and get_touching_au_transforms().
|
inlinevirtual |
A function that is used to determine if this is a Helical symmetry object This function is only virtually overidden by the HSym symmetry, which returns true, not false.
Reimplemented in EMAN::HSym.
Definition at line 100 of file symmetry.h.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), and EMAN::SaffOrientationGenerator::get_orientations_tally().
|
pure 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 |
Implemented in EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::PlatonicSym, and EMAN::TetrahedralSym.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::RandomOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::OptimumOrientationGenerator::gen_orientations(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), and EMAN::SaffOrientationGenerator::get_orientations_tally().
|
inlinevirtual |
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.
Reimplemented in EMAN::PlatonicSym.
Definition at line 94 of file symmetry.h.
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::OrientationGenerator::get_az_max(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), EMAN::SaffOrientationGenerator::get_orientations_tally(), and get_touching_au_transforms().
|
inlinevirtual |
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.
Reimplemented in EMAN::TetrahedralSym.
Definition at line 118 of file symmetry.h.
Referenced by EMAN::OrientationGenerator::get_az_max().
|
private |
Disallow assignment.
|
virtual |
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.
v | a Vec3f characterizing a point |
Definition at line 1072 of file symmetry.cpp.
References au_sym_triangles, cache_au_planes(), cached_au_planes, EMAN::Vec3< Type >::dot(), EMAN::Transform::ERR_LIMIT, get_nsym(), and num_triangles.
Referenced by in_which_asym_unit(), and EMAN::AutoMaskAsymUnit::process_inplace().
|
mutableprotected |
This cache is of size cache_size.
Definition at line 214 of file symmetry.h.
Referenced by cache_au_planes(), and point_in_which_asym_unit().
|
mutableprotected |
Have to remember the cache size.
Definition at line 210 of file symmetry.h.
Referenced by cache_au_planes(), and delete_au_planes().
|
mutableprotected |
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.
Definition at line 207 of file symmetry.h.
Referenced by cache_au_planes(), delete_au_planes(), point_in_which_asym_unit(), and ~Symmetry3D().
|
mutableprotected |
This is stores the number of triangles returned by get_asym_unit_triangles(true)
Definition at line 212 of file symmetry.h.
Referenced by cache_au_planes(), and point_in_which_asym_unit().