Xmipp  v3.23.11-Nereus
Classes | Functions
Polar coordinates
Collaboration diagram for Polar coordinates:

Classes

class  Polar_fftw_plans
 
class  Polar< T >
 
class  RotationalCorrelationAux
 

Functions

void fourierTransformRings (Polar< double > &in, Polar< std::complex< double > > &out, Polar_fftw_plans &plans, bool conjugated=DONT_CONJUGATE)
 
void inverseFourierTransformRings (Polar< std::complex< double > > &in, Polar< double > &out, Polar_fftw_plans &plans, bool conjugated=DONT_CONJUGATE)
 
void rotationalCorrelation (const Polar< std::complex< double > > &M1, const Polar< std::complex< double > > &M2, MultidimArray< double > &angles, RotationalCorrelationAux &aux)
 
template<bool NORMALIZE>
void polarFourierTransform (const MultidimArray< double > &in, Polar< double > &inAux, Polar< std::complex< double > > &out, bool conjugated, int first_ring, int last_ring, Polar_fftw_plans *&plans, int BsplineOrder)
 
template<bool NORMALIZE>
void polarFourierTransform (const MultidimArray< double > &in, Polar< std::complex< double > > &out, bool flag, int first_ring, int last_ring, Polar_fftw_plans *&plans, int BsplineOrder=3)
 
void normalizedPolarFourierTransform (Polar< double > &polarIn, Polar< std::complex< double > > &out, bool conjugated, Polar_fftw_plans *&plans)
 
double best_rotation (const Polar< std::complex< double > > &I1, const Polar< std::complex< double > > &I2, RotationalCorrelationAux &aux)
 
void alignRotationally (MultidimArray< double > &I1, MultidimArray< double > &I2, RotationalCorrelationAux &aux, int splineOrder=1, int wrap=xmipp_transformation::WRAP)
 
void image_convertCartesianToPolar (MultidimArray< double > &in, MultidimArray< double > &out, double Rmin, double Rmax, double deltaR, double angMin, double angMax, double deltaAng)
 
void image_convertCartesianToPolar_ZoomAtCenter (const MultidimArray< double > &in, MultidimArray< double > &out, Matrix1D< double > &R, double zoomFactor, double Rmin, double Rmax, int NRSteps, float angMin, double angMax, int NAngSteps)
 
void volume_convertCartesianToCylindrical (const MultidimArray< double > &in, MultidimArray< double > &out, double Rmin, double Rmax, double deltaR, float angMin, double angMax, float deltaAng, Matrix1D< double > &axis)
 
void volume_convertCartesianToSpherical (const MultidimArray< double > &in, MultidimArray< double > &out, double Rmin, double Rmax, double deltaR=1., double deltaRot=2.*PI/360., double deltaTilt=PI/180.)
 

Detailed Description

Function Documentation

◆ alignRotationally()

void alignRotationally ( MultidimArray< double > &  I1,
MultidimArray< double > &  I2,
RotationalCorrelationAux aux,
int  splineOrder = 1,
int  wrap = xmipp_transformation::WRAP 
)

Align I2 rotationally to I1

Definition at line 234 of file polar.cpp.

235  {
236  I1.setXmippOrigin();
237  I2.setXmippOrigin();
238 
239  Polar_fftw_plans *plans = nullptr;
240  Polar<std::complex<double> > polarFourierI2;
241  Polar<std::complex<double> > polarFourierI1;
242  polarFourierTransform<true>(I1, polarFourierI1, false, XSIZE(I1) / 5,
243  XSIZE(I1) / 2, plans);
244  polarFourierTransform<true>(I2, polarFourierI2, true, XSIZE(I2) / 5,
245  XSIZE(I2) / 2, plans);
246 
247  MultidimArray<double> rotationalCorr;
248  rotationalCorr.resize(2 * polarFourierI2.getSampleNoOuterRing() - 1);
249  aux.local_transformer.setReal(rotationalCorr);
250  double bestRot = best_rotation(polarFourierI1, polarFourierI2, aux);
251 
252  MultidimArray<double> tmp = I2;
253  rotate(splineOrder, I2, tmp, -bestRot, 'Z', wrap);
254 
255 }
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
#define rotate(a, i, j, k, l)
double best_rotation(const Polar< std::complex< double > > &I1, const Polar< std::complex< double > > &I2, RotationalCorrelationAux &aux)
Definition: polar.cpp:212
void setReal(MultidimArray< double > &img)
Definition: xmipp_fftw.cpp:129
#define XSIZE(v)
template void polarFourierTransform< true >(MultidimArray< double > const &, Polar< double > &, Polar< std::complex< double > > &, bool, int, int, Polar_fftw_plans *&, int)
Definition: polar.h:67
FourierTransformer local_transformer
Definition: polar.h:794

◆ best_rotation()

double best_rotation ( const Polar< std::complex< double > > &  I1,
const Polar< std::complex< double > > &  I2,
RotationalCorrelationAux aux 
)

Best rotation between two normalized polar Fourier transforms.

Definition at line 212 of file polar.cpp.

213  {
214  MultidimArray<double> angles;
215  rotationalCorrelation(I1, I2, angles, aux);
216 
217  // Compute the maximum of correlation (inside local_transformer)
218  const MultidimArray<double> &corr = aux.local_transformer.getReal();
219  int imax = 0;
220  double maxval = DIRECT_MULTIDIM_ELEM(corr,0);
221  double* ptr = nullptr;
222  unsigned long int n;
224  if (*ptr > maxval) {
225  maxval = *ptr;
226  imax = n;
227  }
228 
229  // Return the corresponding angle
230  return DIRECT_A1D_ELEM(angles,imax);
231 }
void rotationalCorrelation(const Polar< std::complex< double > > &M1, const Polar< std::complex< double > > &M2, MultidimArray< double > &angles, RotationalCorrelationAux &aux)
Definition: polar.cpp:99
#define FOR_ALL_DIRECT_ELEMENTS_IN_MULTIDIMARRAY_ptr(v, n, ptr)
const MultidimArray< double > & getReal() const
Definition: xmipp_fftw.cpp:118
#define DIRECT_A1D_ELEM(v, i)
#define DIRECT_MULTIDIM_ELEM(v, n)
FourierTransformer local_transformer
Definition: polar.h:794
int * n

◆ fourierTransformRings()

void fourierTransformRings ( Polar< double > &  in,
Polar< std::complex< double > > &  out,
Polar_fftw_plans plans,
bool  conjugated = DONT_CONJUGATE 
)

Calculate FourierTransform of all rings

This function returns a polar of complex<double> by calculating the FT of all rings

Note that the Polar_fftw_plans may be re-used for polars of the same size They should initially be calculated as in the example below

MultidimArray<double> angles, corr;
M1.calculateFftwPlans(plans); // M1 is a Polar<double>
fourierTransformRings(M1, F1, plans, false);
fourierTransformRings(M1, F2, plans, true);// complex conjugated

Definition at line 34 of file polar.cpp.

36  {
38  out.clear();
39  for (int iring = 0; iring < in.getRingNo(); iring++) {
40 
41  plans.arrays[iring] = in.rings[iring];
42  (plans.transformers[iring])->FourierTransform();
43  (plans.transformers[iring])->getFourierAlias(Fring);
44  if (conjugated) {
45  auto *ptrFring_i = (double*) &DIRECT_A1D_ELEM(Fring,0);
46  ++ptrFring_i;
47  for (size_t i = 0; i < XSIZE(Fring); ++i, ptrFring_i += 2)
48  (*ptrFring_i) *= -1;
49  }
50  out.rings.push_back(Fring);
51  }
52  out.mode = in.mode;
53  out.ring_radius = in.ring_radius;
54 }
std::vector< FourierTransformer * > transformers
Definition: polar.h:55
#define i
#define DIRECT_A1D_ELEM(v, i)
std::vector< double > ring_radius
Definition: polar.h:74
#define XSIZE(v)
void FourierTransform(const MultidimArray< double > &in, MultidimArray< std::complex< double > > &out)
Definition: xmipp_fft.cpp:124
int mode
Definition: polar.h:72
int getRingNo() const
Definition: polar.h:326
std::vector< MultidimArray< T > > rings
Definition: polar.h:75
std::vector< MultidimArray< double > > arrays
Definition: polar.h:56
void clear()
Definition: polar.h:295

◆ image_convertCartesianToPolar()

void image_convertCartesianToPolar ( MultidimArray< double > &  in,
MultidimArray< double > &  out,
double  Rmin,
double  Rmax,
double  deltaR,
double  angMin,
double  angMax,
double  deltaAng 
)

Produce a polar image from a cartesian image. You can give the minimum and maximum radius for the interpolation, the delta radius and the delta angle. It is assumed that the input image has the Xmipp origin. Delta Ang must be in radians.

◆ image_convertCartesianToPolar_ZoomAtCenter()

void image_convertCartesianToPolar_ZoomAtCenter ( const MultidimArray< double > &  in,
MultidimArray< double > &  out,
Matrix1D< double > &  R,
double  zoomFactor,
double  Rmin,
double  Rmax,
int  NRSteps,
float  angMin,
double  angMax,
int  NAngSteps 
)

Produce a polar image from a cartesian image. Identical to the previous function. The Zoom factor must be >=1 (==1 means no zoom). If R is with a 0 size, then it is assumed that this routine must compute the sampling radii. If it is not 0, then it is assumed that the sampling radii have already been calculated.

Definition at line 276 of file polar.cpp.

279  {
280  /* Octave
281  * r=0:64;plot(r,d.^(r/d),r,r,d*((r/d).^2.8));
282  */
283  float deltaAng = (angMax - angMin + 1) / NAngSteps;
284  double deltaR = (Rmax - Rmin + 1) / NRSteps;
285  out.initZeros(NAngSteps, NRSteps);
286  if (VEC_XSIZE(R) == 0) {
287  R.initZeros(NRSteps);
288  double Rrange = Rmax - Rmin;
289  for (int j = 0; j < NRSteps; ++j)
290  VEC_ELEM(R,j) = Rmin
291  + Rrange * pow(j * deltaR / Rrange, zoomFactor);
292  }
293  for (int i = 0; i < NAngSteps; ++i) {
294  float angle = angMin + i * deltaAng;
295  float s = sin(angle);
296  float c = cos(angle);
297  for (int j = 0; j < NRSteps; ++j) {
298  float Rj = VEC_ELEM(R,j);
299  A2D_ELEM(out,i,j) = in.interpolatedElement2D(Rj * c, Rj * s);
300  }
301  }
302 }
#define A2D_ELEM(v, i, j)
#define VEC_ELEM(v, i)
Definition: matrix1d.h:245
#define VEC_XSIZE(m)
Definition: matrix1d.h:77
doublereal * c
#define i
T interpolatedElement2D(double x, double y, T outside_value=(T) 0) const
void initZeros()
Definition: matrix1d.h:592
#define j
void initZeros(const MultidimArray< T1 > &op)

◆ inverseFourierTransformRings()

void inverseFourierTransformRings ( Polar< std::complex< double > > &  in,
Polar< double > &  out,
Polar_fftw_plans plans,
bool  conjugated = DONT_CONJUGATE 
)

Calculate inverse FourierTransform of all rings

This function returns a Polar<double> by calculating the inverse FT of all rings in a Polar<std::complex<double> >

Note that the Polar_fftw_plans may be re-used for polars of the same size They should initially be calculated as in the example below

MultidimArray<double> angles, corr;
M1.calculateFftwPlans(plans); // M1 is a Polar<double>

Definition at line 87 of file polar.cpp.

88  {
89  out.clear();
90  for (int iring = 0; iring < in.getRingNo(); iring++) {
91  (plans.transformers[iring])->setFourier(in.rings[iring]);
92  (plans.transformers[iring])->inverseFourierTransform(); // fReal points to plans.arrays[iring]
93  out.rings.push_back(plans.arrays[iring]);
94  }
95  out.mode = in.mode;
96  out.ring_radius = in.ring_radius;
97 }
std::vector< FourierTransformer * > transformers
Definition: polar.h:55
std::vector< double > ring_radius
Definition: polar.h:74
int mode
Definition: polar.h:72
int getRingNo() const
Definition: polar.h:326
std::vector< MultidimArray< T > > rings
Definition: polar.h:75
std::vector< MultidimArray< double > > arrays
Definition: polar.h:56
void clear()
Definition: polar.h:295

◆ normalizedPolarFourierTransform()

void normalizedPolarFourierTransform ( Polar< double > &  polarIn,
Polar< std::complex< double > > &  out,
bool  conjugated,
Polar_fftw_plans *&  plans 
)

Definition at line 197 of file polar.cpp.

199  {
200  double mean;
201  double stddev;
202  polarIn.computeAverageAndStddev(mean, stddev);
203  polarIn.normalize(mean, stddev);
204  if (plans == nullptr) {
205  plans = new Polar_fftw_plans();
206  polarIn.calculateFftwPlans(*plans);
207  }
208  fourierTransformRings(polarIn, out, *plans, conjugated);
209 }
void computeAverageAndStddev(double &avg, double &stddev, int mode=FULL_CIRCLES) const
Definition: polar.h:488
void normalize(double average, double stddev)
Definition: polar.h:536
void fourierTransformRings(Polar< double > &in, Polar< std::complex< double > > &out, Polar_fftw_plans &plans, bool conjugated)
Definition: polar.cpp:34
void calculateFftwPlans(Polar_fftw_plans &out)
Definition: polar.h:708

◆ polarFourierTransform() [1/2]

template<bool NORMALIZE>
void polarFourierTransform ( const MultidimArray< double > &  in,
Polar< double > &  inAux,
Polar< std::complex< double > > &  out,
bool  conjugated,
int  first_ring,
int  last_ring,
Polar_fftw_plans *&  plans,
int  BsplineOrder 
)

Compute a polar Fourier transform (with/out normalization) of the input image. If plans is NULL, they are computed and returned.

Definition at line 153 of file polar.cpp.

156  {
157  if (BsplineOrder == 1)
158  inAux.getPolarFromCartesianBSpline(in, first_ring, last_ring, 1);
159  else {
161  produceSplineCoefficients(3, Maux, in);
162  inAux.getPolarFromCartesianBSpline(Maux, first_ring, last_ring,
163  BsplineOrder);
164  }
165  if (NORMALIZE) {
166  double mean;
167  double stddev;
168  inAux.computeAverageAndStddev(mean, stddev);
169  inAux.normalize(mean, stddev);
170  }
171  if (plans == nullptr) {
172  plans = new Polar_fftw_plans();
173  inAux.calculateFftwPlans(*plans);
174  }
175  fourierTransformRings(inAux, out, *plans, conjugated);
176 }
void computeAverageAndStddev(double &avg, double &stddev, int mode=FULL_CIRCLES) const
Definition: polar.h:488
void getPolarFromCartesianBSpline(const MultidimArray< T > &M1, int first_ring, int last_ring, int BsplineOrder=3, double xoff=0., double yoff=0., double oversample1=1., int mode1=FULL_CIRCLES)
Definition: polar.h:625
void produceSplineCoefficients(int SplineDegree, MultidimArray< double > &coeffs, const MultidimArray< T > &V1)
void normalize(double average, double stddev)
Definition: polar.h:536
void fourierTransformRings(Polar< double > &in, Polar< std::complex< double > > &out, Polar_fftw_plans &plans, bool conjugated)
Definition: polar.cpp:34
void calculateFftwPlans(Polar_fftw_plans &out)
Definition: polar.h:708

◆ polarFourierTransform() [2/2]

template<bool NORMALIZE>
void polarFourierTransform ( const MultidimArray< double > &  in,
Polar< std::complex< double > > &  out,
bool  flag,
int  first_ring,
int  last_ring,
Polar_fftw_plans *&  plans,
int  BsplineOrder = 3 
)

Definition at line 183 of file polar.cpp.

185  {
186  Polar<double> polarIn;
187  polarFourierTransform<NORMALIZE>(in, polarIn, out, conjugated, first_ring, last_ring, plans, BsplineOrder);
188 }
int in

◆ rotationalCorrelation()

void rotationalCorrelation ( const Polar< std::complex< double > > &  M1,
const Polar< std::complex< double > > &  M2,
MultidimArray< double > &  angles,
RotationalCorrelationAux aux 
)

Fourier-space rotational Cross-Correlation Function

This function returns the rotational cross-correlation function of two complex Polars M1 and M2 using the cross-correlation convolution theorem.

Note that the local_transformer should have corr (with the right size) already in its fReal, and a Fourier Transform already calculated

MultidimArray<double> angles, corr;
FourierTransformer local_transformer;
// M1 and M2 are already Polar<double>
M1.calculateFftwPlans(plans);
fourierTransformRings(M1, F1, plans, false);
fourierTransformRings(M1, F2, plans, true);// complex conjugated
corr.resize(M1.getSampleNoOuterRing());
local_transformer.setReal(corr, true);
local_transformer.FourierTransform();
rotationalCorrelation(F1,F2,angles,corr,local_transformer);

Note that this function can be used for real-space and fourier-space correlations!!

Definition at line 99 of file polar.cpp.

101  {
102  int nrings = M1.getRingNo();
103  if (nrings != M2.getRingNo()) {
104  char errorMsg[256];
105  sprintf(
106  errorMsg,
107  "rotationalCorrelation: polar structures have unequal number of rings:\
108  nrings %d and M2.getRingNo %d",
109  nrings, M2.getRingNo());
110  std::cerr << errorMsg << std::endl;
112  }
113  // Fsum should already be set with the right size in the local_transformer
114  // (i.e. through a FourierTransform of corr)
116  memset((double*) MULTIDIM_ARRAY(aux.Fsum), 0,
117  2 * MULTIDIM_SIZE(aux.Fsum) * sizeof(double));
118 
119  // Multiply M1 and M2 over all rings and sum
120  // Assume M2 is already complex conjugated!
121  std::complex<double> auxC;
122  for (int iring = 0; iring < nrings; iring++) {
123  double w = (2. * PI * M1.ring_radius[iring]);
124  int imax = M1.getSampleNo(iring);
125  const MultidimArray<std::complex<double> > &M1_iring = M1.rings[iring];
126  const MultidimArray<std::complex<double> > &M2_iring = M2.rings[iring];
127  auto *ptr1 = (double*) MULTIDIM_ARRAY(M1_iring);
128  auto *ptr2 = (double*) MULTIDIM_ARRAY(M2_iring);
129  auto *ptrFsum = (double *) MULTIDIM_ARRAY(aux.Fsum);
130  for (int i = 0; i < imax; i++) {
131  double a = *ptr1++;
132  double b = *ptr1++;
133  double c = *ptr2++;
134  double d = *ptr2++;
135  *(ptrFsum++) += w * (a * c - b * d);
136  *(ptrFsum++) += w * (b * c + a * d);
137  }
138  }
139 
140  // Inverse FFT to get real-space correlations
141  // The local_transformer should already have corr as setReal!!
143 
144  angles.resize(XSIZE(aux.local_transformer.getReal()));
145  double Kaux = 360. / XSIZE(angles);
146  for (size_t i = 0; i < XSIZE(angles); i++)
147  DIRECT_A1D_ELEM(angles,i) = (double) i * Kaux;
148 }
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
void inverseFourierTransform()
Definition: xmipp_fftw.cpp:329
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
doublereal * c
#define MULTIDIM_SIZE(v)
#define MULTIDIM_ARRAY(v)
int getSampleNo(int iring) const
Definition: polar.h:373
doublereal * w
#define i
doublereal * d
const MultidimArray< double > & getReal() const
Definition: xmipp_fftw.cpp:118
#define DIRECT_A1D_ELEM(v, i)
doublereal * b
MultidimArray< std::complex< double > > Fsum
Definition: polar.h:795
std::vector< double > ring_radius
Definition: polar.h:74
#define XSIZE(v)
FourierTransformer local_transformer
Definition: polar.h:794
void getFourierAlias(T &V)
Definition: xmipp_fftw.h:207
int getRingNo() const
Definition: polar.h:326
std::vector< MultidimArray< T > > rings
Definition: polar.h:75
#define PI
Definition: tools.h:43
Incorrect value received.
Definition: xmipp_error.h:195
doublereal * a

◆ volume_convertCartesianToCylindrical()

void volume_convertCartesianToCylindrical ( const MultidimArray< double > &  in,
MultidimArray< double > &  out,
double  Rmin,
double  Rmax,
double  deltaR,
float  angMin,
double  angMax,
float  deltaAng,
Matrix1D< double > &  axis 
)

Produce a cylindrical volume from a cartesian volume. You can give the minimum and maximum radius for the interpolation, the delta radius and the delta angle. It is assumed that the input image has the Xmipp origin. Delta Ang must be in radians.

Definition at line 305 of file polar.cpp.

307  {
308  auto NAngSteps = (size_t)floor((angMax - angMin) / deltaAng);
309  auto NRSteps = (size_t)floor((Rmax - Rmin) / deltaR);
310  out.initZeros(ZSIZE(in), NAngSteps, NRSteps);
311  STARTINGZ(out) = STARTINGZ(in);
312  STARTINGY(out) = STARTINGX(out) = 0;
313 
314  // Calculate rotation matrix
316  if (XX(axis)!=0.0 || YY(axis)!=0.0)
317  {
318  // 1) Calculate rotation axis v=(0,0,1) x axis
319  Matrix1D<double> v(3);
320  XX(v)=-YY(axis);
321  YY(v)=XX(axis);
322 
323  // 2) Calculate rotation angle (0,0,1).axis=module(axis).cos(ang)
324  double rotAng=acos(ZZ(axis)/axis.module());
325 
326  // 3) Calculate matrix
327  rotation3DMatrix(RAD2DEG(rotAng), v, M, false);
328  }
329 
330  Matrix1D<double> p(3);
331  Matrix1D<double> pc(3);
333  for (size_t i = 0; i < NAngSteps; ++i) {
334  float angle = angMin + i * deltaAng;
335  float s = sin(angle);
336  float c = cos(angle);
337  for (int k = STARTINGZ(in); k <= FINISHINGZ(in); ++k) {
338  ZZ(p)=k;
339  for (size_t j = 0; j < NRSteps; ++j) {
340  float R = Rmin + j * deltaR;
341  YY(p) = R * s;
342  XX(p) = R * c;
343  if (MAT_XSIZE(M)>0)
344  {
345  M3x3_BY_V3x1(pc,M,p);
346  A3D_ELEM(out,k,i,j) = in.interpolatedElement3D(XX(pc),YY(pc),ZZ(pc));
347  }
348  else
349  A3D_ELEM(out,k,i,j) = in.interpolatedElement3D(XX(p),YY(p),ZZ(p));
350  }
351  }
352  }
353 }
double module() const
Definition: matrix1d.h:983
__host__ __device__ float2 floor(const float2 v)
doublereal * c
#define FINISHINGZ(v)
#define STARTINGX(v)
#define i
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
void rotation3DMatrix(double ang, char axis, Matrix2D< double > &result, bool homogeneous)
#define STARTINGY(v)
#define A3D_ELEM(V, k, i, j)
#define XX(v)
Definition: matrix1d.h:85
#define ZSIZE(v)
T interpolatedElement3D(double x, double y, double z, T outside_value=(T) 0) const
#define j
#define M3x3_BY_V3x1(a, M, b)
Definition: matrix2d.h:170
#define YY(v)
Definition: matrix1d.h:93
#define RAD2DEG(r)
Definition: xmipp_macros.h:320
#define MAT_XSIZE(m)
Definition: matrix2d.h:120
void initZeros(const MultidimArray< T1 > &op)
#define STARTINGZ(v)
#define ZZ(v)
Definition: matrix1d.h:101
#define SPEED_UP_temps012
Definition: xmipp_macros.h:403

◆ volume_convertCartesianToSpherical()

void volume_convertCartesianToSpherical ( const MultidimArray< double > &  in,
MultidimArray< double > &  out,
double  Rmin,
double  Rmax,
double  deltaR = 1.,
double  deltaRot = 2.*PI/360.,
double  deltaTilt = PI/180. 
)

Produce a spherical volume from a cartesian voume. You can give the minimum and maximum radii for the interpolation. It is assumed that the input image has the Xmipp origin. Delta Ang must be in radians.

Definition at line 356 of file polar.cpp.

358  {
359  auto NRotSteps = (size_t)floor(2*PI / deltaRot);
360  auto NTiltSteps = (size_t)floor(PI / deltaRot);
361  auto NRSteps = (size_t)floor((Rmax - Rmin) / deltaR);
362  out.initZeros(NRSteps, NRotSteps, NTiltSteps);
363  STARTINGZ(out) = STARTINGY(out) = STARTINGX(out) = 0;
364 
365  Matrix1D<double> p(3);
366  for (size_t i = 0; i < NRotSteps; ++i) {
367  float rot = i * deltaRot;
368  float c = cos(rot);
369  float s = sin(rot);
370  for (size_t j = 0; j < NRotSteps; ++j) {
371  float tilt = j * deltaTilt;
372  float stilt = sin(tilt);
373  float ctilt = cos(tilt);
374  float sc = stilt * c;
375  float ss = stilt * s;
376  for (size_t k = 0; k<NRSteps; ++k) {
377  float R = Rmin + k * deltaR;
378  ZZ(p)=R*ctilt;
379  YY(p)=R*ss;
380  XX(p)=R*sc;
381  A3D_ELEM(out,k,i,j) = in.interpolatedElement3D(XX(p),YY(p),ZZ(p));
382  }
383  }
384  }
385 }
__host__ __device__ float2 floor(const float2 v)
doublereal * c
#define STARTINGX(v)
#define i
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
#define STARTINGY(v)
#define A3D_ELEM(V, k, i, j)
#define XX(v)
Definition: matrix1d.h:85
T interpolatedElement3D(double x, double y, double z, T outside_value=(T) 0) const
#define j
#define YY(v)
Definition: matrix1d.h:93
void initZeros(const MultidimArray< T1 > &op)
#define PI
Definition: tools.h:43
#define STARTINGZ(v)
#define ZZ(v)
Definition: matrix1d.h:101