Xmipp  v3.23.11-Nereus
validation_tilt_pairs.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Jose Luis Vilas (jlvilas@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #ifndef VALIDATE_TILT_PAIRS_H
27 #define VALIDATE_TILT_PAIRS_H
28 
29 #include <core/xmipp_fftw.h>
30 #include <core/args.h>
31 #include <core/xmipp_funcs.h>
32 
34 #include <core/xmipp_image.h>
35 #include <core/geometry.h>
36 #include <data/filters.h>
37 #include <core/xmipp_program.h>
38 #include <complex>
39 
44 {
45 public:
52 
53 public:
55  void defineParams();
56 
58  void quaternion2Paulibasis(double rot, double tilt, double psi, std::complex<double>(&L)[4]);
59 
61  void Pauliproduct(std::complex<double> A[4], std::complex<double> B[4], std::complex<double> (&P)[4]);
62 
64  void inverse_matrixSU2(std::complex<double> Original[4], std::complex<double> (&Inver)[4]);
65 
67  void Paulibasis2matrix(std::complex<double> P[4], std::complex<double> (&M)[4]);
68 
69  //From a Pauli vecto, its inverse is calculated
70  void InversefromPaulibasis(std::complex<double> Original[4], std::complex<double> (&Inver)[4]);
71 
73  //in the Pauli Basis M=P[0] Sigma0 + P[1] Sigma1 + P[2] Sigma2 + P[3] Sigma3
74  void matrix2Paulibasis(std::complex<double> M[4], std::complex<double> (&P)[4]);
75 
77  void extrarotationangles(std::complex<double> R[4], double &alpha_x, double &alpha_y);
78 
80  // and returns the tranformation angles, alpha_x an alpha_y for the transformation Et=R(alpha_y)R(alpha_x)Eu.
81  //Where Et an Eu, are the tilted and untilted images.
82  void angles2tranformation(double untilt_angles[3], double tilt_angles[3], double alpha_x, double alpha_y);
83 
85  void readParams();
86 
88  void run();
89 
90 
91 };
93 #endif
void inverse_matrixSU2(std::complex< double > Original[4], std::complex< double >(&Inver)[4])
Inverse of a matrix (expressed in Pauli basis)
void extrarotationangles(std::complex< double > R[4], double &alpha_x, double &alpha_y)
Extract angles alpha_x and alpha_y from the transformation matrix.
void Paulibasis2matrix(std::complex< double > P[4], std::complex< double >(&M)[4])
A Pauli span is converted to a 2x2 matrix.
void InversefromPaulibasis(std::complex< double > Original[4], std::complex< double >(&Inver)[4])
void quaternion2Paulibasis(double rot, double tilt, double psi, std::complex< double >(&L)[4])
Transform a set of angles/orientations to a matrix expressed in Pauli basis.
void readParams()
Read parameters from the command line.
void defineParams()
Define parameters in the command line.
void Pauliproduct(std::complex< double > A[4], std::complex< double > B[4], std::complex< double >(&P)[4])
It calculates the product of two matrix expressed in Pauli matrices by their matrix elements A an B...
void angles2tranformation(double untilt_angles[3], double tilt_angles[3], double alpha_x, double alpha_y)
It takes two sets of angles (rotu, tiltu, psiu) which define Eu, and (rott, tiltt, psit) which define Et,.
double psi(const double x)
void matrix2Paulibasis(std::complex< double > M[4], std::complex< double >(&P)[4])
It takes a 2x2 matrix (where M[0] = m11; M[1]=m12; M[2]=m21; M[3]=m22) and express the matrix M...
void run()
Execute de program.