40 #define DBL_EPSILON 2.2204460492503130808472633361816000000000e-16 59 for (
long l = 0; l<
Xdim; l++)
79 for (
long l = 0; l <
Xdim; l++)
99 for (
long l = 0L; l <
Xdim; l++)
101 for (
long m = 0L;
m <
Xdim;
m++)
121 double halfSize=Xdim/2;
139 double abs_cosay =
sqrt(A22*A22+A21*A21);
148 ax = atan2(-A21, A22);
149 az = atan2(-A10, A00);
151 if(fabs(cos(ax)) == 0.0)
152 sign_cosay =
SGN(-A21/sin(ax));
156 sign_cosay =
SGN(A22);
158 sign_cosay = -
SGN(A22);
161 ay = atan2(A20, sign_cosay * abs_cosay);
170 az = atan2(A12, -A02);
176 az = atan2(-A12, A02);
194 double K[4], Arg[4], Ki[4];
197 size_t CC1 = Xdim *
Xdim;
212 for (
int ksi = 0; ksi <
Xdim; ksi++)
214 size_t CC2 = CC1 * ksi;
215 double sc = (double) ksi - K[arr[0]];
216 Arg[0]=
VEC_ELEM(BinvCscaled,0)*sc+K[0];
217 Arg[1]=
VEC_ELEM(BinvCscaled,1)*sc+K[1];
218 Arg[2]=
VEC_ELEM(BinvCscaled,2)*sc+K[2];
219 Arg[3]=
VEC_ELEM(BinvCscaled,3)*sc+K[3];
220 double g = Arg[arr[1]];
221 double h = Arg[arr[2]];
223 auto l1 = (int)ceil(g-2.0);
225 auto m1 = (int)ceil(h-2.0);
227 double columns = 0.0;
229 for (
int m = m1;
m <= m2;
m++)
231 if (m < Xdim && m > -1)
233 size_t CC3 = CC2 + Xdim *
m;
235 for (
int l = l1; l <= l2; l++)
237 if (l < Xdim && l > -1)
239 double gminusl = g - (double) l;
245 double hminusm = h - (double) m;
247 columns += rows * aux;
252 *ptrProjection++ = Proj*absscale;
268 double phi,
double theta,
double psi,
269 double shiftX,
double shiftY,
289 double scale_x, scale_y, scale_z;
290 if (
XX(BinvC) != 0.0)
291 scale_x = 1.0 /
XX(BinvC);
295 if (
YY(BinvC) != 0.0)
296 scale_y = 1.0 /
YY(BinvC);
300 if (
ZZ(BinvC) != 0.0)
301 scale_z = 1.0 /
ZZ(BinvC);
304 double m_x = fabs(scale_x);
305 double m_y = fabs(scale_y);
306 double m_z = fabs(scale_z);
310 double scale = scale_x;
340 double rot,
double tilt,
double psi,
double shiftX,
double shiftY)
348 if (Ydim!=Data.
Xdim || Xdim!=Data.
Xdim)
void reset(int Ydim, int Xdim)
#define REPORT_ERROR(nerr, ErrormMsg)
void Euler_angles2matrix(T alpha, T beta, T gamma, Matrix2D< T > &A, bool homogeneous)
void resizeNoCopy(const MultidimArray< T1 > &v)
void sqrt(Image< double > &op)
#define DIRECT_A2D_ELEM(v, i, j)
void convertAngles(double &phi, double &theta, double &psi)
Transforms angles from (Ry, Rz, Ry) to (Rx, Ry, Rz) system. Returns possible error.
#define MULTIDIM_ARRAY(v)
void inv(Matrix2D< T > &result) const
void projectionRealShears2(MultidimArray< double > &CoefVolume, double absscale, Matrix2D< double > &Binv, Matrix1D< double > &BinvCscaled, int *arr, MultidimArray< double > &projection)
const MultidimArray< double > * volume
MultidimArray< double > Coef_y
void projectVolume(RealShearsInfo &Data, Projection &P, int Ydim, int Xdim, double rot, double tilt, double psi, double shiftX, double shiftY)
Make projection.
MultidimArray< double > Coef_x
#define MAT_ELEM(m, i, j)
#define DIRECT_A1D_ELEM(v, i)
MultidimArray< double > Coef_z
Structure for holding a volume.
RealShearsInfo(const MultidimArray< double > &V)
void getCol(size_t j, Matrix1D< T > &v) const
void projectionRealShears1(RealShearsInfo &Data, double phi, double theta, double psi, double shiftX, double shiftY, MultidimArray< double > &projection)
#define FIRST_XMIPP_INDEX(size)
double psi(const double x)
int CopyDoubleToDouble(double *VolumeSource, long NxSource, long NySource, long NzSource, long XSource, long YSource, long ZSource, double *VolumeDestination, long NxDestination, long NyDestination, long NzDestination, long XDestination, long YDestination, long ZDestination, long NxCopy, long NyCopy, long NzCopy)
Incorrect MultidimArray dimensions.
#define LAST_XMIPP_INDEX(size)