Xmipp
v3.23.11-Nereus
|
#include <symmetries.h>
Public Member Functions | |
SymList () | |
SymList (const FileName &fn_sym, double accuracy=SYM_ACCURACY) | |
bool | isSymmetryGroup (FileName fn_sym, int &pgGroup, int &pgOrder) |
void | fillSymmetryClass (const FileName &symmetry, int pgGroup, int pgOrder, std::vector< std::string > &fileContent) |
void | getMatrices (int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const |
void | setMatrices (int i, const Matrix2D< double > &L, const Matrix2D< double > &R) |
void | getShift (int i, Matrix1D< double > &shift) const |
void | setShift (int i, const Matrix1D< double > &shift) |
void | addShift (const Matrix1D< double > &shift) |
int | readSymmetryFile (FileName fn_sym, double accuracy=SYM_ACCURACY) |
void | addMatrices (const Matrix2D< double > &L, const Matrix2D< double > &R, int chain_length) |
void | computeSubgroup (double accuracy=SYM_ACCURACY) |
int | symsNo () const |
int | spaceGroup () const |
int | trueSymsNo () const |
int | crystallographicSpaceGroup (double mag_a, double mag_b, double ang_a2b_deg) const |
double | nonRedundantProjectionSphere (int pgGroup, int pgOrder) |
double | computeDistance (double rot1, double tilt1, double psi1, double &rot2, double &tilt2, double &psi2, bool projdir_mode, bool check_mirrors, bool object_rotation=false, bool write_mirrors=true) |
void | computeDistance (MetaData &md, bool projdir_mode, bool check_mirrors, bool object_rotation=false) |
void | breakSymmetry (double rot1, double tilt1, double psi1, double &rot2, double &tilt2, double &psi2) |
Public Attributes | |
Matrix2D< double > | __L |
Matrix2D< double > | __R |
Matrix2D< double > | __shift |
Matrix1D< int > | __chain_length |
int | true_symNo |
int | __sym_elements |
Symmetry List class. Internally the symmetry list class is implemented as a single 2D matrix, where every 4 rows (remember that in 3D the geometrical transformation matrices are 4x4) comprise a symmetry matrix. Access, and ways to modify the symmetry list are supplied. Remind that any symmetry is expressed in terms of two matrices L and R, so that any Euler matrix must be transformed by L*Euler*R resulting into a new perspective of the volume which is equivalent to the original one.
The typical use of the symmetry lists is to read the symmetry file, and do nothing else but reading matrices from it.
The symmetry file format is
Definition at line 138 of file symmetries.h.
|
inline |
Create an empty list. The 2D matrices are 0x0. \ Ex: SymList SL;
Definition at line 162 of file symmetries.h.
|
inline |
Create Symmetry List from a Symmetry file. All the subgroup elements are computed automatically. \ Ex: SymList SL("sym.txt");
Definition at line 170 of file symmetries.h.
void SymList::addMatrices | ( | const Matrix2D< double > & | L, |
const Matrix2D< double > & | R, | ||
int | chain_length | ||
) |
Add symmetry matrices to the symmetry list. The given matrix must specify a point of view equivalent to the actual point of view. The matrices are added to the subgroup generator but the subgroup is not updated, you must do it manually using computeSubgroup. What is more, the subgroup after the insertion is corrupted.
The chain length is the number of single matrices multiplication of which the inserted one is compound.
Definition at line 418 of file symmetries.cpp.
void SymList::addShift | ( | const Matrix1D< double > & | shift | ) |
Add shift. Add a shift vector to the shift matrix. An exception is thrown if the input vector is not a 3x1 vector.
Definition at line 408 of file symmetries.cpp.
void SymList::breakSymmetry | ( | double | rot1, |
double | tilt1, | ||
double | psi1, | ||
double & | rot2, | ||
double & | tilt2, | ||
double & | psi2 | ||
) |
Return equivalent set of angles for a given symmetry
Definition at line 1253 of file symmetries.cpp.
double SymList::computeDistance | ( | double | rot1, |
double | tilt1, | ||
double | psi1, | ||
double & | rot2, | ||
double & | tilt2, | ||
double & | psi2, | ||
bool | projdir_mode, | ||
bool | check_mirrors, | ||
bool | object_rotation = false , |
||
bool | write_mirrors = true |
||
) |
Check symmetries. Given two sets of angles, modify set2 to be as close to set1 as possible considering the symmetries. Distances are measured over the sphere. If the projdir_mode is set to true, then the similarity is measured only using the projection direction. The function returns the minimum distance between the two angle sets after the symmetry is considered. If check_mirrors is set, up-down corrections are also considered. Object_rotation controls the way that symmetry is applied (LR if object_rotation=false or RL if object_rotation=true). Normally it is set to false.
Definition at line 1188 of file symmetries.cpp.
void SymList::computeDistance | ( | MetaData & | md, |
bool | projdir_mode, | ||
bool | check_mirrors, | ||
bool | object_rotation = false |
||
) |
auxiliary function that calls double computeDistance(double rot1, double tilt1, double psi1, double &rot2, double &tilt2, double &psi2, bool projdir_mode, bool check_mirrors, bool object_rotation=false); from a metadata. Input metadata _angleRot _angleRot2 _angleTilt _angleTilt2 _anglePsi _anglePsi2 _anglePsiDiff _image
output metadata
_angleRot _angleRot2 _angleRotDiff _angleTilt _angleTilt2 _angleTiltDiff _anglePsi _anglePsi2 _anglePsiDiff _angleDiff _image
Definition at line 1157 of file symmetries.cpp.
void SymList::computeSubgroup | ( | double | accuracy = SYM_ACCURACY | ) |
Compute subgroup for this structure. After adding or setting a matrix, the subgroup information is lost, you must recalculate it using this function. The different matrices are multiplied until no more different matrices are produced. The accuracy is used in order to compare when two matrix elements are the same.
So far, all the shifts associated to generated matrices are set to 0
Definition at line 467 of file symmetries.cpp.
int SymList::crystallographicSpaceGroup | ( | double | mag_a, |
double | mag_b, | ||
double | ang_a2b_deg | ||
) | const |
Guess Crystallographic space group. Return the http://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-getgen number. So far it has only been implemented for P1 (1), P2122 & P2212 (17), P4 (75), P4212 (90) and P6 (168).
Mag_a and Mag_b are the crystal vector magnitude.
Guess Crystallographic space group. Return the group number http://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-getgen. So far it has only been implemented for P1 (1), P2_122 (17) , P22_12, P4 (75), P4212 (90) and P6 (168)
Definition at line 541 of file symmetries.cpp.
void SymList::fillSymmetryClass | ( | const FileName & | symmetry, |
int | pgGroup, | ||
int | pgOrder, | ||
std::vector< std::string > & | fileContent | ||
) |
void SymList::getMatrices | ( | int | i, |
Matrix2D< double > & | L, | ||
Matrix2D< double > & | R, | ||
bool | homogeneous = true |
||
) | const |
Get matrices from the symmetry list. The number of matrices inside the list is given by symsNo. This function return the 4x4 (homogeneous=true) or 3x3 (homogeneous=false) transformation matrices associated to the one in the list which occupies the position 'i'. The matrix numbering within the list starts at 0. The output transformation matrices is given as a pointer to gain speed. \ Ex:
Definition at line 348 of file symmetries.cpp.
void SymList::getShift | ( | int | i, |
Matrix1D< double > & | shift | ||
) | const |
Get shift. Returns the shift associated to a certain symmetry.
Definition at line 391 of file symmetries.cpp.
bool SymList::isSymmetryGroup | ( | FileName | fn_sym, |
int & | pgGroup, | ||
int & | pgOrder | ||
) |
translate string fn_sym to symmetry group, return false is translation is not possible. See http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/Symmetry for details. It also fill the symmetry information
Definition at line 601 of file symmetries.cpp.
double SymList::nonRedundantProjectionSphere | ( | int | pgGroup, |
int | pgOrder | ||
) |
Return the area of the non redundant part of the projection sphere
Definition at line 1048 of file symmetries.cpp.
int SymList::readSymmetryFile | ( | FileName | fn_sym, |
double | accuracy = SYM_ACCURACY |
||
) |
Read a symmetry file into a symmetry list. The former symmetry list is overwritten with the new one. All the subgroup members are added to the list. If the accuracy is negative then the subgroup is not generated. return symmetry group \ Ex: SL.readSymmetryFile("sym.txt");
Definition at line 33 of file symmetries.cpp.
Set a couple of matrices in the symmetry list. The number of matrices inside the list is given by symsNo. This function sets the 4x4 transformation matrices associated to the one in the list which occupies the position 'i'. The matrix numbering within the list starts at 0. \ Ex:
Definition at line 378 of file symmetries.cpp.
void SymList::setShift | ( | int | i, |
const Matrix1D< double > & | shift | ||
) |
Set shift. Set the shift associated to a certain symmetry.
Definition at line 399 of file symmetries.cpp.
|
inline |
|
inline |
Number of symmetry matrices inside the structure. This is the number of all the matrices inside the subgroup. \ Ex:
Definition at line 268 of file symmetries.h.
|
inline |
Number of symmetry matrices which generated the structure. This is the number of the matrices which generated the structure, notice that it should be always less or equal to the total number of matrices in the subgroup.
Definition at line 283 of file symmetries.h.
Matrix1D<int> SymList::__chain_length |
Definition at line 148 of file symmetries.h.
Matrix2D<double> SymList::__L |
Definition at line 146 of file symmetries.h.
Matrix2D<double> SymList::__R |
Definition at line 146 of file symmetries.h.
Matrix2D<double> SymList::__shift |
Definition at line 147 of file symmetries.h.
int SymList::__sym_elements |
Definition at line 156 of file symmetries.h.
int SymList::true_symNo |
Definition at line 153 of file symmetries.h.