EMAN2
symmetry.h
Go to the documentation of this file.
1
2/*
3 * Author: David Woolford, 09/23/2008 (woolford@bcm.edu)
4 * Copyright (c) 2000-2006 Baylor College of Medicine
5 *
6 * This software is issued under a joint BSD/GNU license. You may use the
7 * source code in this file under either license. However, note that the
8 * complete EMAN2 and SPARX software packages have some GPL dependencies,
9 * so you are responsible for compliance with the licenses of these packages
10 * if you opt to use BSD licensing. The warranty disclaimer below holds
11 * in either instance.
12 *
13 * This complete copyright notice must be included in any revised version of the
14 * source code. Additional authorship citations may be added, but existing
15 * author citations must be preserved.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 *
31 * */
32#ifndef eman__symmetry_h__
33#define eman__symmetry_h__ 1
34
35
36#include "emobject.h"
37#include "vec3.h"
38#include "transform.h"
39
40namespace EMAN {
41
56 class Symmetry3D : public FactoryBase
57 {
58 public:
59 typedef vector<vector<Vec3f> >::const_iterator cit;
60 typedef vector<vector<Vec3f> >::iterator ncit;
61 Symmetry3D();
62 virtual ~Symmetry3D();
63
69 virtual Dict get_delimiters(const bool inc_mirror=false) const = 0;
70
76 virtual Transform get_sym(const int n) const = 0;
77
81 virtual int get_nsym() const = 0;
82
86 virtual float get_az_alignment_offset() const { return 0.0; }
87
88
89
94 virtual bool is_platonic_sym() const { return false; }
95
100 virtual bool is_h_sym() const { return false; }
101
106 virtual bool is_c_sym() const { return false; }
107
112 virtual bool is_d_sym() const { return false; }
113
118 virtual bool is_tet_sym() const { return false; }
119
120
121
125 virtual int get_max_csym() const = 0;
126
136 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror) const = 0;
144 vector<Transform> gen_orientations(const string& generatorname="eman", const Dict& parms=Dict());
145
154 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const = 0;
155
165 virtual Transform reduce(const Transform& t3d, int n=0) const;
166
167
174 virtual int in_which_asym_unit(const Transform& t3d) const;
175
183 virtual int point_in_which_asym_unit(const Vec3f& v) const;
184
189 virtual vector<vector<Vec3f> > get_asym_unit_triangles(bool inc_mirror) const = 0;
190
200 virtual vector<Transform> get_touching_au_transforms(bool inc_mirror = true) const;
201
202 virtual vector<Transform> get_syms() const;
203 static vector<Transform> get_symmetries(const string& symmetry);
204 protected:
207 mutable float** cached_au_planes;
208
210 mutable int cache_size;
212 mutable int num_triangles;
214 mutable vector< vector<Vec3f> > au_sym_triangles;
217 void cache_au_planes() const;
218
221 void delete_au_planes();
222 private:
227};
228
233 class CSym : public Symmetry3D
234{
235 public:
236 CSym() {};
237 virtual ~CSym() {};
238
242 static Symmetry3D *NEW()
243 {
244 return new CSym();
245 }
246
250 virtual string get_name() const { return NAME; }
251
255 virtual string get_desc() const { return "C symmetry support"; }
256
260 virtual TypeDict get_param_types() const
261 {
262 TypeDict d;
263 d.put("nsym", EMObject::INT, "The symmetry number");
264 return d;
265 }
266
274 virtual Dict get_delimiters(const bool inc_mirror=false) const;
275
283 virtual Transform get_sym(const int n) const;
284
289 virtual int get_nsym() const { return params["nsym"]; };
290
291
296 virtual int get_max_csym() const { return params["nsym"]; }
297
299 static const string NAME;
300
305 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror = false) const;
306
315 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const;
316
320 virtual bool is_c_sym() const { return true; }
321
322
327 virtual vector<vector<Vec3f> > get_asym_unit_triangles(bool inc_mirror) const;
328 private:
330 CSym(const CSym&);
333
334};
335
340 class DSym : public Symmetry3D
341{
342 public:
343 DSym() {};
344 virtual ~DSym() {};
345
349 static Symmetry3D *NEW()
350 {
351 return new DSym();
352 }
353
357 virtual string get_name() const { return NAME; }
358
362 virtual string get_desc() const { return "D symmetry support"; }
363
367 virtual TypeDict get_param_types() const
368 {
369 TypeDict d;
370 d.put("nsym", EMObject::INT, "The symmetry number");
371 return d;
372 }
373
381 virtual Dict get_delimiters(const bool inc_mirror=false) const;
382
391 virtual Transform get_sym(const int n) const;
392
397 virtual int get_nsym() const { return 2*(int)params["nsym"]; };
398
399
404 virtual int get_max_csym() const { return params["nsym"]; }
405
410 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror = false) const;
411
420 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const;
421
423 static const string NAME;
424
428 virtual bool is_d_sym() const { return true; }
429
434 virtual vector<vector<Vec3f> > get_asym_unit_triangles(bool inc_mirror) const;
435 private:
437 DSym(const DSym&);
440};
441
446 class HSym : public Symmetry3D
447{
448 public:
449 HSym() {};
450 virtual ~HSym() {};
451
455 static Symmetry3D *NEW()
456 {
457 return new HSym();
458 }
459
463 virtual string get_name() const { return NAME; }
464
468 virtual string get_desc() const { return "Helical symmetry, with support for N-start, pitch and limited tilt range. Specify as H[nsym]:[nstart]:[daz]:[tz in pix](:[maxtilt])"; }
469
476 virtual TypeDict get_param_types() const
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 }
487
500 virtual Dict get_delimiters(const bool inc_mirror=false) const;
501
502
511 virtual Transform get_sym(const int n) const;
512
519 virtual int get_nsym() const { return (int)params["nsym"]; };
520 /*virtual int get_nsym() const {
521 float daz = params.set_default("daz",0.0f);
522 if ( daz <= 0 ) throw InvalidValueException(daz,"Error, you must specify a positive non zero d_az");
523 return static_cast<int>(360.0/daz);
524 };*/
525
530 virtual int get_max_csym() const { return (int)params["nstart"]; } // may not be
531
533 static const string NAME;
534
538 virtual bool is_h_sym() const { return true; }
539
548 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const;
549
554 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror = false) const;
555
560 virtual vector<vector<Vec3f> > get_asym_unit_triangles(bool inc_mirror) const;
561 private:
563 HSym(const HSym&);
566};
567
581 class PlatonicSym : public Symmetry3D
582{
583 public:
585 virtual ~PlatonicSym() {};
586
591 virtual TypeDict get_param_types() const
592 {
593 TypeDict d;
594 return d;
595 }
596
612 virtual Dict get_delimiters(const bool inc_mirror=false) const;
613
622 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const;
623
627 virtual bool is_platonic_sym() const { return true; }
628
629 protected:
632
638 void init();
639
647 float platonic_alt_lower_bound(const float& azimuth, const float& alpha) const;
648
653 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror = false) const;
654
659 virtual vector<vector<Vec3f> > get_asym_unit_triangles(bool inc_mirror) const;
660 private:
665};
666
676{
677 public:
681 virtual ~TetrahedralSym() {}
682
686 static Symmetry3D *NEW()
687 {
688 return new TetrahedralSym();
689 }
690
694 virtual string get_name() const { return NAME; }
695
696
700 virtual string get_desc() const { return "Tetrahedral symmetry support"; }
701
706 virtual int get_max_csym() const { return 3; }
707
720 virtual Transform get_sym(const int n) const;
721
730 virtual bool is_in_asym_unit(const float& altitude, const float& azimuth, const bool inc_mirror) const;
731
736 virtual int get_nsym() const { return 12; };
737
744 virtual float get_az_alignment_offset() const;
745
747 static const string NAME;
748
753 virtual vector<Vec3f> get_asym_unit_points(bool inc_mirror = false) const;
754
758 virtual bool is_tet_sym() const { return true; }
759
760 private:
765
766
767};
768
780{
781 public:
785 virtual ~OctahedralSym() {}
786
790 static Symmetry3D *NEW()
791 {
792 return new OctahedralSym();
793 }
794
798 virtual string get_name() const { return NAME; };
799
803 virtual string get_desc() const { return "Octahedral symmetry support"; }
804
809 virtual int get_max_csym() const { return 4; }
810
828 virtual Transform get_sym(const int n) const;
829
834 virtual int get_nsym() const { return 24; };
835
837 static const string NAME;
838 private:
843};
844
856{
857 public:
861 virtual ~IcosahedralSym() { }
862
866 static Symmetry3D *NEW()
867 {
868 return new IcosahedralSym();
869 }
870
874 virtual string get_name() const { return NAME; };
875
879 virtual string get_desc() const { return "Icosahedral symmetry support"; }
880
885 virtual int get_max_csym() const { return 5; }// 5 is the greatest symmetry
886
893 virtual Transform get_sym(const int n) const;
894
899 virtual int get_nsym() const { return 60; };
900
907 virtual float get_az_alignment_offset() const;
908
910 static const string NAME;
911 private:
916};
917
920{
921 public:
925 virtual ~Icosahedral2Sym() { init(); }
926
930 static Symmetry3D *NEW()
931 {
932 return new Icosahedral2Sym();
933 }
934
938 virtual string get_name() const { return NAME; };
939
943 virtual string get_desc() const { return "Icosahedral 2 symmetry support"; }
944
949 virtual int get_max_csym() const { return 2; }
950
957 virtual Transform get_sym(const int n) const;
958
963 virtual int get_nsym() const { return 60; };
964
971 virtual float get_az_alignment_offset() const;
972
974 static const string NAME;
975 private:
980};
981
985 template <> Symmetry3D* Factory < Symmetry3D >::get(const string & instancename);
987 void dump_symmetries();
989 map<string, vector<string> > dump_symmetries_list();
990
1000{
1001 public:
1004
1009 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const = 0;
1010
1012 {
1013 TypeDict d;
1014 d.put("phitoo", EMObject::FLOAT, "Specifying a non zero value for this argument will cause phi rotations to be included. The value specified is the angular spacing of the phi rotations in degrees. The default for this value is 0, causing no extra phi rotations to be included.");
1015 d.put("random_phi", EMObject::BOOL, "Causes the orientations to have a random phi. This occurs before the phitoo parameter is considered.");
1016 return d;
1017 }
1018
1035 bool add_orientation(vector<Transform>& v, const float& az, const float& alt) const;
1036
1037
1038
1052 float get_optimal_delta(const Symmetry3D* const sym, const int& n) const;
1053
1060 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const = 0;
1061
1062 protected:
1063 void get_az_max(const Symmetry3D* const sym, const float& altmax, const bool inc_mirror, const float& alt_iterator,const float& h,bool& d_odd_mirror_flag, float& azmax_adjusted) const;
1064
1065 private:
1070};
1071
1072
1073
1084{
1085 public:
1088
1093 {
1094 return new EmanOrientationGenerator();
1095 }
1096
1100 virtual string get_name() const { return NAME; }
1101
1105 virtual string get_desc() const { return "Generate orientations distributed quasi-uniformaly over the asymmetric unit using an altitude-proportional strategy"; }
1106
1112 {
1114 d.put("delta", EMObject::FLOAT, "The angular separation of orientations in degrees. This option is mutually exclusively of the n argument.");
1115 d.put("perturb", EMObject::BOOL, "Whether or not to perturb the generated orientations in a small local area, default is true.");
1116 d.put("n", EMObject::INT, "The number of orientations to generate. This option is mutually exclusively of the delta argument.Will attempt to get as close to the number specified as possible.");
1117 d.put("inc_mirror", EMObject::BOOL, "Indicates whether or not to include the mirror portion of the asymmetric unit. Default is false.");
1118 d.put("alt_min", EMObject::FLOAT, "Minimum altitude value to include (alt=0 is Z axis). Default=0");
1119 d.put("alt_max", EMObject::FLOAT, "Maximum altitude value to include (alt=90 is X-Y plane). Default=no limit");
1120 d.put("breaksym", EMObject::BOOL, "If specified, still generates orientations filling the unit (hemi)sphere, but does it by filling one asymmetric unit, then generating all symmetric equivalents.");
1121 d.put("breaksym_real", EMObject::BOOL, "Same as breaksym, but do not use inc_mirror.");
1122 return d;
1123 }
1124
1129 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1130
1132 static const string NAME;
1133 private:
1138
1145 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const;
1146
1147
1156 float get_az_delta(const float& delta,const float& altitude, const int maxcsym) const;
1157
1158};
1159
1165{
1166 public:
1169
1174 {
1175 return new SingleOrientationGenerator();
1176 }
1177
1181 virtual string get_name() const { return NAME; }
1182
1186 virtual string get_desc() const { return "Generate a single orientation with the specified EMAN style Euler angles. Symmetry is ignored."; }
1187
1193 {
1195 d.put("az", EMObject::FLOAT, "Azimuthal angle (Z rotation in deg)");
1196 d.put("alt", EMObject::FLOAT, "Altitude (X rotation in deg)");
1197 d.put("phi", EMObject::FLOAT, "Phi angle (Z' rotation in deg");
1198 d.put("phitoo", EMObject::INT, "This option is ignored for the single orientation generator");
1199 d.put("randomphi", EMObject::INT, "This option is ignored for the single orientation generator");
1200 return d;
1201 }
1202
1207 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1208
1210 static const string NAME;
1211 private:
1216
1223 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const;
1224
1225};
1226
1227
1235{
1236 public:
1239
1244 {
1245 return new RandomOrientationGenerator();
1246 }
1247
1251 virtual string get_name() const { return NAME; }
1252
1256 virtual string get_desc() const { return "Generate random orientations within an asymmetric unit"; }
1257
1263 {
1264 TypeDict d;
1265 d.put("n", EMObject::INT, "The number of orientations to generate.");
1266 d.put("inc_mirror", EMObject::BOOL, "Indicates whether or not to include the mirror portion of the asymmetric unit. Default is false.");
1267 d.put("phitoo", EMObject::BOOL, "Makes phi random as well");
1268 return d;
1269 }
1270
1275 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1276
1278 static const string NAME;
1279
1280 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const { (void)sym; (void)delta; return 0; }
1281 private:
1286};
1287
1300{
1301 public:
1304
1309 {
1310 return new EvenOrientationGenerator();
1311 }
1312
1313
1317 virtual string get_name() const { return NAME; }
1318
1322 virtual string get_desc() const { return "Generate quasi-evenly distributed orientations within an asymmetric unit using Penczek's (94) approach"; }
1323
1329 {
1331 d.put("delta", EMObject::FLOAT, "The angular separation of orientations in degrees. This option is mutually exclusively of the n argument.");
1332 d.put("inc_mirror", EMObject::BOOL, "Indicates whether or not to include the mirror portion of the asymmetric unit. Default is false.");
1333 d.put("n", EMObject::INT, "The number of orientations to generate. This option is mutually exclusively of the delta argument.Will attempt to get as close to the number specified as possible.");
1334 return d;
1335 }
1336
1341 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1342
1344 static const string NAME;
1345 private:
1356 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const;
1357
1358};
1359
1366{
1367 public:
1370
1375 {
1376 return new SaffOrientationGenerator();
1377 }
1378
1382 virtual string get_name() const { return NAME; }
1383
1387 virtual string get_desc() const { return "Generate quasi-evenly distributed orientations within an asymmetric unit using a spiraling method attributed to Saff"; }
1388
1394 {
1396 d.put("n", EMObject::INT, "The number of orientations to generate. This option is mutually exclusively of the delta argument.Will attempt to get as close to the number specified as possible.");
1397 d.put("inc_mirror", EMObject::BOOL, "Indicates whether or not to include the mirror portion of the asymmetric unit. Default is false.");
1398 d.put("delta", EMObject::FLOAT, "The angular separation of orientations in degrees. This option is mutually exclusively of the n argument.");
1399 return d;
1400 }
1401
1406 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1407
1409 static const string NAME;
1410 private:
1421 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const;
1422
1423 // This was a function that paid special considerations to the overall algorithm in the
1424 // case of the Platonic symmetries, which have non trivial asymmetric units. But unfortunately
1425 // it was bug-prone, and the approach in place already seemed good enough
1426 //vector<Transform> gen_platonic_orientations(const Symmetry3D* const sym, const float& delta) const;
1427};
1428
1429
1439{
1440 public:
1443
1448 {
1449 return new OptimumOrientationGenerator();
1450 }
1451
1455 virtual string get_name() const { return NAME; }
1456
1460 virtual string get_desc() const { return "Generate optimally distributed orientations within an asymmetric using a basic optimization technique"; }
1461
1467 {
1469 d.put("n", EMObject::INT, "The number of orientations to generate. This option is mutually exclusively of the delta argument.Will attempt to get as close to the number specified as possible.");
1470 d.put("inc_mirror", EMObject::BOOL, "Indicates whether or not to include the mirror portion of the asymmetric unit. Default is false.");
1471 d.put("delta", EMObject::FLOAT, "The angular separation of orientations in degrees. This option is mutually exclusively of the n argument.");
1472 d.put("use", EMObject::STRING, "The orientation generation technique used to generate the initial distribution on the unit sphere.");
1473 return d;
1474 }
1475
1480 virtual vector<Transform> gen_orientations(const Symmetry3D* const sym) const;
1481
1483 static const string NAME;
1484 private:
1495 virtual int get_orientations_tally(const Symmetry3D* const sym, const float& delta) const;
1496
1497
1500 vector<Vec3f> optimize_distances(const vector<Transform>& v) const;
1501};
1502
1506 void dump_orientgens();
1508 map<string, vector<string> > dump_orientgens_list();
1509} // namespace EMAN
1510
1511#endif // eman__symmetry_h__
1512
An encapsulation of cyclic 3D symmetry.
Definition: symmetry.h:234
virtual Dict get_delimiters(const bool inc_mirror=false) const
Get the altitude and phi angle of the c symmetry, which depends on nysm.
Definition: symmetry.cpp:1249
virtual string get_name() const
Return CSym::NAME.
Definition: symmetry.h:250
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 paramet...
Definition: symmetry.cpp:1263
virtual string get_desc() const
Get a description.
Definition: symmetry.h:255
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:242
virtual int get_nsym() const
Gets the total number of unique roational symmetry operations associated with this symmetry For C sym...
Definition: symmetry.h:289
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.
Definition: symmetry.cpp:1275
virtual ~CSym()
Definition: symmetry.h:237
virtual bool is_c_sym() const
Returns true - this is indeed a c symmetry object.
Definition: symmetry.h:320
virtual vector< Vec3f > get_asym_unit_points(bool inc_mirror=false) const
to demarcate the asymmetric unit.
Definition: symmetry.cpp:1370
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:260
CSym(const CSym &)
Disallow copy construction.
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:296
static const string NAME
The name of this class - used to access it from factories etc. Should be "c".
Definition: symmetry.h:299
CSym & operator=(const CSym &)
Disallow assignment.
virtual Transform get_sym(const int n) const
Provides access to the complete set of rotational symmetry operations associated with this symmetry.
Definition: symmetry.cpp:1407
An encapsulation of dihedral 3D symmetry.
Definition: symmetry.h:341
static const string NAME
The name of this class - used to access it from factories etc. Should be "d".
Definition: symmetry.h:423
DSym & operator=(const DSym &)
Disallow assignment.
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:349
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 paramet...
Definition: symmetry.cpp:1435
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:367
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:404
virtual bool is_d_sym() const
Returns true - this is indeed a c symmetry object.
Definition: symmetry.h:428
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.
Definition: symmetry.cpp:1472
DSym(const DSym &)
Disallow copy construction.
virtual string get_name() const
Return DSym::NAME.
Definition: symmetry.h:357
virtual ~DSym()
Definition: symmetry.h:344
virtual vector< Vec3f > get_asym_unit_points(bool inc_mirror=false) const
Definition: symmetry.cpp:1527
virtual string get_desc() const
Get a description.
Definition: symmetry.h:362
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:1420
virtual Transform get_sym(const int n) const
Provides access to the complete set of rotational symmetry operations associated with this symmetry.
Definition: symmetry.cpp:1452
virtual int get_nsym() const
Gets the total number of unique roational symmetry operations associated with this symmetry For D sym...
Definition: symmetry.h:397
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
EmanOrientationGenerator generates orientations quasi-evenly distributed in the asymmetric unit.
Definition: symmetry.h:1084
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:1132
virtual string get_name() const
Return "eman".
Definition: symmetry.h:1100
float get_az_delta(const float &delta, const float &altitude, const int maxcsym) const
Gets the optimum azimuth delta (angular step) for a given altitude, delta and maximum symmetry.
Definition: symmetry.cpp:301
EmanOrientationGenerator(const EmanOrientationGenerator &)
Disallow copy construction.
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1105
EmanOrientationGenerator & operator=(const EmanOrientationGenerator &)
Disallow assignment.
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.cpp:323
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1111
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1092
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
generate orientations given some symmetry type
Definition: symmetry.cpp:389
Sparx even orientation generator - see util_sparx.cpp - Util::even_angles(...) This orientation gener...
Definition: symmetry.h:1300
EvenOrientationGenerator & operator=(const EvenOrientationGenerator &)
Disallow assignment.
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1322
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
Generate even distributed orientations in the asymmetric unit of the symmetry.
Definition: symmetry.cpp:634
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:1344
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.cpp:591
EvenOrientationGenerator(const EvenOrientationGenerator &)
Disallow copy construction.
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1328
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1308
virtual string get_name() const
Return "even".
Definition: symmetry.h:1317
A class one may inherit from to ensure that the responsibilities of being incorporated into an EMAN2:...
Definition: emobject.h:893
Dict params
This is the dictionary the stores the parameters of the object.
Definition: emobject.h:953
Factory is used to store objects to create new instances.
Definition: emobject.h:725
An encapsulation of helical 3D symmetry.
Definition: symmetry.h:447
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
virtual string get_name() const
Return HSym::NAME.
Definition: symmetry.h:463
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.
Definition: symmetry.cpp:1602
HSym & operator=(const HSym &)
Disallow assignment.
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:455
virtual Transform get_sym(const int n) const
Provides access to the complete set of rotational and translational symmetry operations associated wi...
Definition: symmetry.cpp:1648
virtual int get_nsym() const
For symmetries in general this function is supposed to return the number of unique symmetric operatio...
Definition: symmetry.h:519
virtual string get_desc() const
Get a description.
Definition: symmetry.h:468
HSym(const HSym &)
Disallow copy construction.
virtual bool is_h_sym() const
Determines whether or not this Symmetry3D is the helical type - returns true.
Definition: symmetry.h:538
virtual int get_max_csym() const
Gets the maximum cylcic symmetry exhibited by this object.
Definition: symmetry.h:530
virtual ~HSym()
Definition: symmetry.h:450
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class Of all the symmetries,...
Definition: symmetry.h:476
virtual vector< Vec3f > get_asym_unit_points(bool inc_mirror=false) const
Definition: symmetry.cpp:1608
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 paramet...
Definition: symmetry.cpp:1585
static const string NAME
The name of this class - used to access it from factories etc. Should be "h".
Definition: symmetry.h:533
An encapsulation of icosahedral symmetry 222.
Definition: symmetry.h:920
virtual string get_desc() const
Get a description.
Definition: symmetry.h:943
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos2".
Definition: symmetry.h:974
virtual string get_name() const
Return IcosahedralSym::NAME.
Definition: symmetry.h:938
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:949
Icosahedral2Sym(const Icosahedral2Sym &)
Disallow copy construction.
virtual ~Icosahedral2Sym()
Definition: symmetry.h:925
virtual int get_nsym() const
Gets the total number of unique roational symmetry operations associated with this symmetry For icosa...
Definition: symmetry.h:963
Icosahedral2Sym()
Constructor calls PlatonicSym::init.
Definition: symmetry.h:924
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:930
virtual Transform get_sym(const int n) const
This function provides access to the unique rotational symmetries of an icosahedron.
Definition: symmetry.cpp:1871
virtual float get_az_alignment_offset() const
Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric ...
Definition: symmetry.cpp:1869
Icosahedral2Sym & operator=(const Icosahedral2Sym &)
Disallow assignment.
An encapsulation of icosahedral symmetry Doctor Phil has this to say about icosahedral symmetry: "Eac...
Definition: symmetry.h:856
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:866
IcosahedralSym()
Constructor calls PlatonicSym::init.
Definition: symmetry.h:860
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:910
IcosahedralSym(const IcosahedralSym &)
Disallow copy construction.
virtual string get_desc() const
Get a description.
Definition: symmetry.h:879
virtual string get_name() const
Return IcosahedralSym::NAME.
Definition: symmetry.h:874
virtual Transform get_sym(const int n) const
This function provides access to the unique rotational symmetries of an icosahedron.
Definition: symmetry.cpp:1821
virtual int get_nsym() const
Gets the total number of unique rotational symmetry operations associated with this symmetry For icos...
Definition: symmetry.h:899
virtual float get_az_alignment_offset() const
Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric ...
Definition: symmetry.cpp:1819
virtual ~IcosahedralSym()
Definition: symmetry.h:861
IcosahedralSym & operator=(const IcosahedralSym &)
Disallow assignment.
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:885
An encapsulation of octahedral symmetry Doctor Phil has this to say about the octahedral symmetry: "E...
Definition: symmetry.h:780
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:790
virtual Transform get_sym(const int n) const
This function provides access to the unique rotational symmetries of an octahedron.
Definition: symmetry.cpp:1949
virtual int get_nsym() const
Gets the total number of unique roational symmetry operations associated with this symmetry For octah...
Definition: symmetry.h:834
OctahedralSym & operator=(const OctahedralSym &)
Disallow assignment.
virtual string get_name() const
Return OctahedralSym::NAME.
Definition: symmetry.h:798
virtual string get_desc() const
Get a description.
Definition: symmetry.h:803
OctahedralSym(const OctahedralSym &)
Disallow copy construction.
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:809
OctahedralSym()
Constructor calls PlatonicSym::init.
Definition: symmetry.h:784
virtual ~OctahedralSym()
Definition: symmetry.h:785
static const string NAME
The name of this class - used to access it from factories etc. Should be "oct".
Definition: symmetry.h:834
Optimum orientation generator.
Definition: symmetry.h:1439
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1466
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.cpp:779
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
Generate Saff orientations in the asymmetric unit of the symmetry.
Definition: symmetry.cpp:794
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1460
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:1483
virtual string get_name() const
Return "opt".
Definition: symmetry.h:1455
OptimumOrientationGenerator & operator=(const OptimumOrientationGenerator &)
Disallow assignment.
OptimumOrientationGenerator(const OptimumOrientationGenerator &)
Disallow copy construction.
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1447
vector< Vec3f > optimize_distances(const vector< Transform > &v) const
Optimize the distances in separating points on the unit sphere, as described by the the rotations in ...
Definition: symmetry.cpp:844
An orientation generator is a kind of class that will generate orientations for a given symmetry If o...
Definition: symmetry.h:1000
bool add_orientation(vector< Transform > &v, const float &az, const float &alt) const
This functions adds one or more Transform objects to the vector v, depending on the parameters stored...
Definition: symmetry.cpp:273
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const =0
generate orientations given some symmetry type
float get_optimal_delta(const Symmetry3D *const sym, const int &n) const
This function gets the optimal value of the delta (or angular spacing) of the orientations based on a...
Definition: symmetry.cpp:236
OrientationGenerator(const OrientationGenerator &)
Disallow copy construction.
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const =0
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
void get_az_max(const Symmetry3D *const sym, const float &altmax, const bool inc_mirror, const float &alt_iterator, const float &h, bool &d_odd_mirror_flag, float &azmax_adjusted) const
Definition: symmetry.cpp:187
virtual TypeDict get_param_types() const
Definition: symmetry.h:1011
OrientationGenerator & operator=(const OrientationGenerator &)
Disallow assignment.
virtual ~OrientationGenerator()
Definition: symmetry.h:1003
A base (or parent) class for the Platonic symmetries.
Definition: symmetry.h:582
float platonic_alt_lower_bound(const float &azimuth, const float &alpha) const
Returns the lower bound of the asymmetric unit, as dependent on azimuth, and on alpha - alpha is alt_...
Definition: symmetry.cpp:1737
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.
Definition: symmetry.cpp:1750
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class Platonic symmetries actually hav...
Definition: symmetry.h:591
virtual vector< Vec3f > get_asym_unit_points(bool inc_mirror=false) const
Definition: symmetry.cpp:1777
void init()
Init - Called to initialize platonic_params, should be called in the constructor of all Platonic soli...
Definition: symmetry.cpp:1673
PlatonicSym(const PlatonicSym &)
Disallow copy construction.
virtual Dict get_delimiters(const bool inc_mirror=false) const
Returns the range of altitude and azimuth angles which encompass the asymmetric unit of the Platonic ...
Definition: symmetry.cpp:1694
virtual ~PlatonicSym()
Definition: symmetry.h:585
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 paramet...
Definition: symmetry.cpp:1711
Dict platonic_params
A dictionary that stores important angles, in radians.
Definition: symmetry.h:631
PlatonicSym & operator=(const PlatonicSym &)
Disallow assignment.
virtual bool is_platonic_sym() const
Determines whether or not this Symmetry3D is the platonic type - returns true.
Definition: symmetry.h:627
Random Orientation Generator - carefully generates uniformly random orientations in any asymmetric un...
Definition: symmetry.h:1235
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.h:1280
RandomOrientationGenerator & operator=(const RandomOrientationGenerator &)
Disallow assignment.
virtual string get_name() const
Return "random".
Definition: symmetry.h:1251
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1262
static const string NAME
The name of this class - used to access it from factories etc.
Definition: symmetry.h:1278
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
Generate random orientations in the asymmetric unit of the symmetry.
Definition: symmetry.cpp:546
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1256
RandomOrientationGenerator(const RandomOrientationGenerator &)
Disallow copy construction.
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1243
Saff orientation generator - based on the work of Saff and Kuijlaars, 1997 E.B.
Definition: symmetry.h:1366
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1393
SaffOrientationGenerator(const SaffOrientationGenerator &)
Disallow copy construction.
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.cpp:681
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
Generate Saff orientations in the asymmetric unit of the symmetry.
Definition: symmetry.cpp:722
virtual string get_name() const
Return "saff".
Definition: symmetry.h:1382
SaffOrientationGenerator & operator=(const SaffOrientationGenerator &)
Disallow assignment.
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1387
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1374
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:1409
SingleOrientationGenerator generates a single orientation with the specified EMAN-style Euler angles.
Definition: symmetry.h:1165
virtual vector< Transform > gen_orientations(const Symmetry3D *const sym) const
generate orientations given some symmetry type
Definition: symmetry.cpp:524
SingleOrientationGenerator(const SingleOrientationGenerator &)
Disallow copy construction.
SingleOrientationGenerator & operator=(const SingleOrientationGenerator &)
Disallow assignment.
virtual int get_orientations_tally(const Symmetry3D *const sym, const float &delta) const
This function returns how many orientations will be generated for a given delta (angular spacing) It ...
Definition: symmetry.cpp:519
virtual string get_name() const
Return "eman".
Definition: symmetry.h:1181
static const string NAME
The name of this class - used to access it from factories etc. Should be "icos".
Definition: symmetry.h:1210
virtual TypeDict get_param_types() const
Get a dictionary containing the permissable parameters of this class.
Definition: symmetry.h:1192
virtual string get_desc() const
Get a description.
Definition: symmetry.h:1186
static OrientationGenerator * NEW()
Factory support function NEW.
Definition: symmetry.h:1173
Symmetry3D - A base class for 3D Symmetry objects.
Definition: symmetry.h:57
int num_triangles
This is stores the number of triangles returned by get_asym_unit_triangles(true)
Definition: symmetry.h:212
vector< vector< Vec3f > > au_sym_triangles
This cache is of size cache_size.
Definition: symmetry.h:214
void cache_au_planes() const
Establish the asymmetric unit planes cache.
Definition: symmetry.cpp:1020
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 o...
Definition: symmetry.h:106
virtual bool is_h_sym() const
A function that is used to determine if this is a Helical symmetry object This function is only virtu...
Definition: symmetry.h:100
virtual int get_max_csym() const =0
The Symmetry3D object must return the maximum degree of symmetry it exhibits about any one axis.
virtual bool is_tet_sym() const
A function that is used to determine if this is the tetrahedral symmetry object This function is only...
Definition: symmetry.h:118
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 asy...
Definition: symmetry.cpp:1155
virtual int get_nsym() const =0
The total number of unique symmetry operations that will be return by this object when a calling prog...
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.
virtual ~Symmetry3D()
Definition: symmetry.cpp:963
vector< vector< Vec3f > >::const_iterator cit
Definition: symmetry.h:59
static vector< Transform > get_symmetries(const string &symmetry)
Definition: symmetry.cpp:1240
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 un...
Definition: symmetry.cpp:1001
int cache_size
Have to remember the cache size.
Definition: symmetry.h:210
virtual bool is_platonic_sym() const
A function that is used to determine if this is a platonic symmetry object This function is only virt...
Definition: symmetry.h:94
void delete_au_planes()
Clear the asymmetric unit planes cache.
Definition: symmetry.cpp:1059
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 ...
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 'n...
Definition: symmetry.cpp:1072
virtual vector< Transform > get_syms() const
Definition: symmetry.cpp:1224
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 paramet...
float ** cached_au_planes
The asymmetric unit planes are cached to provide a great speed up the point_in_which_asym_unit functi...
Definition: symmetry.h:207
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 Orientati...
Definition: symmetry.cpp:167
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 functi...
vector< vector< Vec3f > >::iterator ncit
Definition: symmetry.h:60
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...
virtual float get_az_alignment_offset() const
This functionality is only relevant to platonic symmetries.
Definition: symmetry.h:86
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 o...
Definition: symmetry.h:112
Symmetry3D & operator=(const Symmetry3D &)
Disallow assignment.
Symmetry3D(const Symmetry3D &)
Disallow copy construction.
An encapsulation of tetrahedral symmetry Doctor Phil has this to say about tetrahedral symmetry: " Ea...
Definition: symmetry.h:676
virtual ~TetrahedralSym()
Definition: symmetry.h:681
TetrahedralSym & operator=(const TetrahedralSym &)
Disallow assignment.
virtual vector< Vec3f > get_asym_unit_points(bool inc_mirror=false) const
Definition: symmetry.cpp:2031
virtual bool is_tet_sym() const
A function that is used to determine if this is the tetrahedral symmetry object.
Definition: symmetry.h:758
TetrahedralSym(const TetrahedralSym &)
Disallow copy construction.
static Symmetry3D * NEW()
Factory support function NEW.
Definition: symmetry.h:686
static const string NAME
The name of this class - used to access it from factories etc. Should be "tet".
Definition: symmetry.h:747
virtual string get_name() const
Return TetrahedralSym::NAME.
Definition: symmetry.h:694
TetrahedralSym()
Constructor calls PlatonicSym::init.
Definition: symmetry.h:680
virtual int get_nsym() const
Gets the total number of unique roational symmetry operations associated with this symmetry For tetra...
Definition: symmetry.h:736
virtual float get_az_alignment_offset() const
Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric ...
Definition: symmetry.cpp:1977
virtual string get_desc() const
Get a description.
Definition: symmetry.h:700
virtual Transform get_sym(const int n) const
This function provides access to the unique rotational symmetries of a tetrahedron.
Definition: symmetry.cpp:2006
virtual bool is_in_asym_unit(const float &altitude, const float &azimuth, const bool inc_mirror) const
In tetrahedral symmetry special consideration must be taken when generating orientations in the asymm...
Definition: symmetry.cpp:1979
virtual int get_max_csym() const
Gets the maximum symmetry of this object.
Definition: symmetry.h:706
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330
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 asymmetr...
Definition: symmetry.cpp:974
E2Exception class.
Definition: aligner.h:40
void dump_orientgens()
Dumps useful information about the OrientationGenerator factory.
Definition: symmetry.cpp:157
map< string, vector< string > > dump_symmetries_list()
dump_symmetries_list, useful for obtaining symmetry information
Definition: symmetry.cpp:70
map< string, vector< string > > dump_orientgens_list()
Can be used to get useful information about the OrientationGenerator factory.
Definition: symmetry.cpp:162
void dump_symmetries()
dump symmetries, useful for obtaining symmetry information
Definition: symmetry.cpp:65