Xmipp  v3.23.11-Nereus
polar.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Sjors H.W. Scheres (scheres@cnb.csic.es)
4  *
5  * This code is strongly based on ideas by Pawel Penczek & Zhengfan
6  * Yang as implemented in SPARX at the University of Texas - Houston
7  * Medical School
8  *
9  * see P. A. Penczek, R. Renka, and H. Schomberg,
10  * J. Opt. Soc. Am. _21_, 449 (2004)
11  *
12  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27  * 02111-1307 USA
28  *
29  * All comments concerning this program package may be sent to the
30  * e-mail address 'xmipp@cnb.csic.es'
31  ***************************************************************************/
32 #ifndef POLAR_H
33 #define POLAR_H
34 #include <mutex>
35 #include "core/multidim_array.h"
37 #include "core/xmipp_fftw.h"
38 #include "core/xmipp_filename.h"
39 
40 constexpr int FULL_CIRCLES = 0;
41 constexpr int HALF_CIRCLES = 1;
42 constexpr bool DONT_CONJUGATE = false;
43 constexpr bool CONJUGATE = true;
44 constexpr bool DONT_KEEP_TRANSFORM = false;
45 constexpr bool KEEP_TRANSFORM = true;
46 
49 
50 
53 {
54 public:
55  std::vector<FourierTransformer *> transformers;
56  std::vector<MultidimArray<double> > arrays;
59  Polar_fftw_plans(const Polar_fftw_plans&)=delete; // Remove the copy constructor
60  Polar_fftw_plans & operator=(const Polar_fftw_plans&)=delete; // Remove the copy assignment
63 };
64 
66 template<typename T>
67 class Polar
68 {
69 protected:
70  FileName fn_pol; // name of the polar
71 public:
72  int mode; // Use full or half circles
73  double oversample;
74  std::vector<double> ring_radius; // radius of each ring
75  std::vector<MultidimArray<T> > rings; // vector with all rings
76 public:
86  {
87  fn_pol = "";
88  ring_radius.clear();
89  rings.clear();
90  mode = FULL_CIRCLES;
91  oversample = 1.;
92  }
93 
100  Polar(const Polar& P)
101  {
102  rings = P.rings;
103  fn_pol = P.fn_pol;
104  ring_radius = P.ring_radius;
105  mode = P.mode;
106  oversample = P.oversample;
107  }
108 
112  {
113  rings.clear();
114  ring_radius.clear();
115  }
116 
119  Polar& operator=(const Polar& P)
120  {
121  if (this != &P)
122  {
123  fn_pol = P.fn_pol;
124  rings = P.rings;
125  ring_radius = P.ring_radius;
126  mode = P.mode;
127  oversample = P.oversample;
128  }
129  return *this;
130  }
131 
134  Polar& operator-(const T val) const
135  {
136  Polar<T> result;
137  result = *(this);
138  for (size_t i = 0; i < rings.size(); i++)
139  for (size_t j = 0; j < XSIZE(rings[i]); j++)
140  result(i,j) -= val;
141 
142  return result;
143  }
144 
147  Polar& operator+(const T val)
148  {
149  Polar<T> result;
150  result = *(this);
151  for (size_t i = 0; i < rings.size(); i++)
152  for (size_t j = 0; j < XSIZE(rings[i]); j++)
153  result(i,j) += val;
154 
155  return result;
156  }
157 
160  Polar& operator*(const T val)
161  {
162  Polar<T> result;
163  result = *(this);
164  for (size_t i = 0; i < rings.size(); i++)
165  for (size_t j = 0; j < XSIZE(rings[i]); j++)
166  result(i,j) *= val;
167 
168  return result;
169  }
170 
173  Polar& operator/(const T val)
174  {
175  Polar<T> result;
176  result = *(this);
177  for (size_t i = 0; i < rings.size(); i++)
178  for (size_t j = 0; j < XSIZE(rings[i]); j++)
179  result(i,j) /= val;
180 
181  return result;
182  }
183 
186  void operator-=(const T val)
187  {
188  size_t imax=rings.size();
189  for (size_t i = 0; i < imax; i++)
190  {
191  MultidimArray<T> &rings_i=rings[i];
192  for (size_t j = 0; j < XSIZE(rings_i); j++)
193  DIRECT_A1D_ELEM(rings_i,j) -= val;
194  }
195  }
196 
199  void operator+=(const T val)
200  {
201  size_t imax=rings.size();
202  for (size_t i = 0; i < imax; i++)
203  {
204  MultidimArray<T> &rings_i=rings[i];
205  for (int j = 0; j < XSIZE(rings_i); j++)
206  DIRECT_A1D_ELEM(rings_i,j) += val;
207  }
208  }
209 
212  void operator*=(const T val)
213  {
214  size_t imax=rings.size();
215  for (size_t i = 0; i < imax; i++)
216  {
217  MultidimArray<T> &rings_i=rings[i];
218  for (int j = 0; j < XSIZE(rings_i); j++)
219  DIRECT_A1D_ELEM(rings_i,j) *= val;
220  }
221  }
222 
225  void operator/=(const T val)
226  {
227  size_t imax=rings.size();
228  double ival=1.0/val;
229  for (size_t i = 0; i < imax; i++)
230  {
231  MultidimArray<T> &rings_i=rings[i];
232  for (size_t j = 0; j < XSIZE(rings_i); j++)
233  DIRECT_A1D_ELEM(rings_i,j) *= ival;
234  }
235  }
236 
240  {
241  for (size_t i = 0; i < rings.size(); i++)
242  for (size_t j = 0; j < XSIZE(rings[i]); j++)
243  (*(this))(i,j) -= in(i,j);
244  }
245 
249  {
250  for (size_t i = 0; i < rings.size(); i++)
251  for (size_t j = 0; j < XSIZE(rings[i]); j++)
252  (*(this))(i,j) += in(i,j);
253  }
254 
258  {
259  for (size_t i = 0; i < rings.size(); i++)
260  for (size_t j = 0; j < XSIZE(rings[i]); j++)
261  (*(this))(i,j) *= in(i,j);
262  }
263 
267  {
268  for (size_t i = 0; i < rings.size(); i++)
269  for (size_t j = 0; j < XSIZE(rings[i]); j++)
270  (*(this))(i,j) /= in(i,j);
271  }
272 
282  void rename(const FileName &newName)
283  {
284  fn_pol = newName;
285  }
286 
295  void clear()
296  {
297  fn_pol = "";
298  rings.clear();
299  ring_radius.clear();
300  mode = FULL_CIRCLES;
301  oversample = 1.;
302  }
303 
313  const FileName & name() const
314  {
315  return fn_pol;
316  }
317 
326  int getRingNo() const
327  {
328  return rings.size();
329  }
330 
343  int getMode() const
344  {
345  return mode;
346  }
347 
360  double getOversample() const
361  {
362  return oversample;
363  }
364 
373  int getSampleNo(int iring) const
374  {
375  return XSIZE(rings[iring]);
376  }
377 
387  {
388  return XSIZE(rings[rings.size()-1]);
389  }
390 
399  double getRadius(int iring) const
400  {
401  return ring_radius[iring];
402  }
403 
413  {
414  return rings[i];
415  }
416  const MultidimArray< T >& getRing(int i) const
417  {
418  return rings[i];
419  }
420 
430  void setRing(int i, MultidimArray< T > val)
431  {
432  rings[i] = val;
433  }
434 
446  T& getPixel(int r, int f) const
447  {
448  return rings[r](f);
449  }
450 
462  T& operator()(int r, int f) const
463  {
464  return DIRECT_A1D_ELEM(rings[r],f);
465  }
466 
479  void setPixel(int r, int f, T val) const
480  {
481  rings[r](f) = val;
482  }
483 
484 
488  void computeAverageAndStddev(double &avg, double &stddev,
489  int mode = FULL_CIRCLES) const
490  {
491  double aux;
492  double sum = 0.;
493  double sum2=0.;
494  double twopi;
495  double w;
496  double N = 0;
497 
498  if (mode == FULL_CIRCLES)
499  twopi = 2.*PI;
500  else if (mode == HALF_CIRCLES)
501  twopi = PI;
502  else
503  REPORT_ERROR(ERR_VALUE_INCORRECT,"Incorrect mode for computeAverageAndStddev");
504 
505  size_t imax=rings.size();
506  const double *ptrRing_radius=&ring_radius[0];
507  for (size_t i = 0; i < imax; ++i, ++ptrRing_radius)
508  {
509  // take varying sampling into account
510  w = (twopi * (*ptrRing_radius)) / (double) XSIZE(rings[i]);
511  const MultidimArray<T> &rings_i=rings[i];
512  for (size_t j = 0; j < XSIZE(rings_i); j++)
513  {
514  aux = DIRECT_A1D_ELEM(rings_i,j);
515  double waux=w*aux;
516  sum += waux;
517  sum2 += waux * aux;
518  N += w;
519  }
520  }
521  if (N>0)
522  {
523  sum2 = sum2 / N;
524  avg = sum / N;
525  stddev=sqrt(fabs(sum2-avg*avg));
526  }
527  else if (N != 0.)
528  {
529  avg = sum;
530  stddev=sqrt(fabs(sum2-avg*avg));
531  }
532  else
533  stddev=avg=0;
534  }
535 
536  void normalize(double average, double stddev)
537  {
538  size_t imax=rings.size();
539  double istddev=1.0/stddev;
540  for (size_t i = 0; i < imax; i++)
541  {
542  MultidimArray<T> &rings_i=rings[i];
543  for (size_t j = 0; j < XSIZE(rings_i); j++)
544  DIRECT_A1D_ELEM(rings_i,j) = (DIRECT_A1D_ELEM(rings_i,j)-average)*istddev;
545  }
546  }
547 
558 #define GRIDDING_K 6
559  void getCartesianCoordinates(std::vector<double> &x,
560  std::vector<double> &y,
561  std::vector<T> &data,
562  const int extra_shell = GRIDDING_K/2)
563  {
564  // Only for full circles for now!
565  if (mode != FULL_CIRCLES)
566  REPORT_ERROR(ERR_VALUE_INCORRECT,"VoronoiArea only implemented for FULL_CIRCLES mode of Polar");
567 
568  // First fill the vector with the originally sampled coordinates
569  x.clear();
570  y.clear();
571  data.clear();
572  for (int i = 0; i < rings.size(); i++)
573  {
574  int nsam = XSIZE(rings[i]);
575  float dphi = TWOPI / (float)nsam;
576  float radius = ring_radius[i];
577  for (int j = 0; j < nsam; j++)
578  {
579  float tmp = j * dphi;
580  x.push_back(radius * sin(tmp));
581  y.push_back(radius * cos(tmp));
582  data.push_back(rings[i](j));
583  }
584  }
585 
586  // Add additional points on the inside and outside of the rings
587  // Add a maximum of "extra_shell" rings
588  // Set data to zero here
589  auto first_ring = (int)floor(ring_radius[0]);
590  auto last_ring = (int)ceil(ring_radius[rings.size()-1]);
591  int outer = last_ring + extra_shell;
592  int inner = XMIPP_MAX(0,first_ring - extra_shell);
593  for (int iradius = 0; iradius < outer; iradius +=1)
594  {
595  if ( (iradius >= inner && iradius < first_ring) ||
596  (iradius <= outer && iradius > last_ring) )
597  {
598  double radius=iradius;
599  int nsam = 2 * (int)( 0.5 * oversample * TWOPI * radius );
600  nsam = XMIPP_MAX(1, nsam);
601  float dphi = TWOPI / (float)nsam;
602  for (int j = 0; j < nsam; j++)
603  {
604  float tmp = j * dphi;
605  x.push_back(radius * sin(tmp));
606  y.push_back(radius * cos(tmp));
607  data.push_back(0.);
608  }
609  }
610  }
611  }
612 
626  int first_ring, int last_ring, int BsplineOrder=3,
627  double xoff = 0., double yoff = 0.,
628  double oversample1 = 1., int mode1 = FULL_CIRCLES)
629  {
630  double twopi;
631  double xp;
632  double yp;
633  double minxp;
634  double maxxp;
635  double minyp;
636  double maxyp;
637 
638  auto noOfRings = getNoOfRings(first_ring, last_ring);
639  rings.resize(noOfRings);
640  ring_radius.resize(noOfRings);
641 
642  mode = mode1;
643  oversample = oversample1;
644 
645  if (mode == FULL_CIRCLES)
646  twopi = TWOPI;
647  else if (mode == HALF_CIRCLES)
648  twopi = PI;
649  else
650  REPORT_ERROR(ERR_VALUE_INCORRECT,"Incorrect mode for getPolarFromCartesian");
651 
652 
653  // Limits of the matrix (not oversized!)
654  minxp = FIRST_XMIPP_INDEX(XSIZE(M1));
655  minyp = FIRST_XMIPP_INDEX(YSIZE(M1));
656  maxxp = LAST_XMIPP_INDEX(XSIZE(M1));
657  maxyp = LAST_XMIPP_INDEX(YSIZE(M1));
658  double minxp_e=minxp-XMIPP_EQUAL_ACCURACY;
659  double minyp_e=minyp-XMIPP_EQUAL_ACCURACY;
660  double maxxp_e=maxxp+XMIPP_EQUAL_ACCURACY;
661  double maxyp_e=maxyp+XMIPP_EQUAL_ACCURACY;
662 
663  std::lock_guard<std::mutex> lockGuard(m_mutex);
664 
665  ensureAngleCache(first_ring, last_ring);
666 
667  // Loop over all polar coordinates
668  for (int r = 0; r < noOfRings; ++r)
669  {
670  float radius = (float) r + first_ring;
671  ring_radius.at(r) = radius;
672  auto &Mring = rings.at(r);
673  // Non-constant sampling!! (always even for convenient Half2Whole of FTs)
674  int nsam = getNoOfSamples(twopi, radius);
675  Mring.resizeNoCopy(nsam);
676 
677  auto &s = m_lastSinRadius.at(r);
678  auto &c = m_lastCosRadius.at(r);
679 
680  for (int sample = 0; sample < nsam; ++sample)
681  {
682  // from polar to original cartesian coordinates
683  xp = s.at(sample);
684  yp = c.at(sample);
685 
686  // Origin offsets
687  xp += xoff;
688  yp += yoff;
689 
690  // Wrap coordinates
691  if (xp < minxp_e || xp > maxxp_e)
692  xp = realWRAP(xp, minxp - 0.5, maxxp + 0.5);
693  if (yp < minyp_e || yp > maxyp_e)
694  yp = realWRAP(yp, minyp - 0.5, maxyp + 0.5);
695 
696  // Perform the convolution interpolation
697  if (BsplineOrder==1)
698  DIRECT_A1D_ELEM(Mring,sample) = M1.interpolatedElement2DOutsideZero(xp,yp);
699  else
700  DIRECT_A1D_ELEM(Mring,sample) = M1.interpolatedElementBSpline2D(xp,yp,BsplineOrder);
701  }
702  }
703  }
704 
709  {
710  (out.arrays).resize(rings.size());
711  for (size_t iring = 0; iring < rings.size(); iring++)
712  {
713  (out.arrays)[iring] = rings[iring];
714  auto *ptr_transformer = new FourierTransformer();
715  ptr_transformer->setReal((out.arrays)[iring]);
716  out.transformers.push_back(ptr_transformer);
717  }
718  }
719 
720 private:
721  void ensureAngleCache(int firstRing, int lastRing);
722 
723  int getNoOfSamples(double angle, double radius) {
724  int result = 2 * (int)( 0.5 * oversample * angle * radius );
725  return XMIPP_MAX(1, result);
726  }
727 
728  int getNoOfRings(int firstRing, int lastRing) {
729  return lastRing - firstRing + 1;
730  }
731 
732  int m_lastFirstRing = 0;
733  int m_lastLastRing = 0;
734  int m_lastMode = 0;
735  std::vector<std::vector<float>> m_lastSinRadius;
736  std::vector<std::vector<float>> m_lastCosRadius;
737  std::mutex m_mutex;
738 };
739 
761  Polar<std::complex<double> > &out,
762  Polar_fftw_plans &plans,
763  bool conjugated = DONT_CONJUGATE);
764 
785 void inverseFourierTransformRings(Polar<std::complex<double> > & in,
786  Polar<double > &out,
787  Polar_fftw_plans &plans,
788  bool conjugated = DONT_CONJUGATE);
789 
792 {
793 public:
796 };
797 
828 void rotationalCorrelation(const Polar<std::complex<double> > &M1,
829  const Polar<std::complex<double> > &M2,
830  MultidimArray<double> &angles,
832 
835 template<bool NORMALIZE>
837  Polar<double> &inAux,
838  Polar<std::complex<double> > &out, bool conjugated, int first_ring,
839  int last_ring, Polar_fftw_plans *&plans, int BsplineOrder);
840 
841 template<bool NORMALIZE>
843  Polar< std::complex<double> > &out, bool flag,
844  int first_ring, int last_ring, Polar_fftw_plans *&plans,
845  int BsplineOrder=3);
846 
847 // Compute the normalized Polar Fourier transform --------------------------
849  Polar<std::complex<double> > &out, bool conjugated,Polar_fftw_plans *&plans);
850 
852 double best_rotation(const Polar< std::complex<double> > &I1,
853  const Polar< std::complex<double> > &I2, RotationalCorrelationAux &aux);
854 
858  int splineOrder=1, int wrap=xmipp_transformation::WRAP);
859 
866  double Rmin, double Rmax, double deltaR,
867  double angMin, double angMax, double deltaAng);
868 
879  Matrix1D<double> &R,
880  double zoomFactor,
881  double Rmin, double Rmax, int NRSteps,
882  float angMin, double angMax, int NAngSteps);
883 
890  double Rmin, double Rmax, double deltaR,
891  float angMin, double angMax, float deltaAng,
893 
900  MultidimArray<double> &out, double Rmin, double Rmax, double deltaR=1.,
901  double deltaRot=2.*PI/360., double deltaTilt=PI/180.);
903 #endif
Mutex mutex
#define YSIZE(v)
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
std::vector< FourierTransformer * > transformers
Definition: polar.h:55
__host__ __device__ float2 floor(const float2 v)
Polar & operator=(const Polar &P)
Definition: polar.h:119
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)
Definition: polar.cpp:276
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
void operator/=(const T val)
Definition: polar.h:225
Polar & operator/=(const Polar< T > in)
Definition: polar.h:266
void operator*=(const T val)
Definition: polar.h:212
doublereal * c
T & getPixel(int r, int f) const
Definition: polar.h:446
void inverseFourierTransformRings(Polar< std::complex< double > > &in, Polar< double > &out, Polar_fftw_plans &plans, bool conjugated=DONT_CONJUGATE)
Definition: polar.cpp:87
FileName fn_pol
Definition: polar.h:70
void sqrt(Image< double > &op)
int getSampleNoOuterRing() const
Definition: polar.h:386
static double * y
Polar & operator*(const T val)
Definition: polar.h:160
void rotationalCorrelation(const Polar< std::complex< double > > &M1, const Polar< std::complex< double > > &M2, MultidimArray< double > &angles, RotationalCorrelationAux &aux)
Definition: polar.cpp:99
void computeAverageAndStddev(double &avg, double &stddev, int mode=FULL_CIRCLES) const
Definition: polar.h:488
void alignRotationally(MultidimArray< double > &I1, MultidimArray< double > &I2, RotationalCorrelationAux &aux, int splineOrder=1, int wrap=xmipp_transformation::WRAP)
Definition: polar.cpp:234
constexpr bool CONJUGATE
Definition: polar.h:43
void normalizedPolarFourierTransform(Polar< double > &polarIn, Polar< std::complex< double > > &out, bool conjugated, Polar_fftw_plans *&plans)
Definition: polar.cpp:197
int getSampleNo(int iring) const
Definition: polar.h:373
#define TWOPI
Definition: xmipp_macros.h:111
doublereal * w
const MultidimArray< T > & getRing(int i) const
Definition: polar.h:416
double getOversample() const
Definition: polar.h:360
~Polar_fftw_plans()
Destructor.
Definition: polar.cpp:28
const FileName & name() const
Definition: polar.h:313
constexpr bool KEEP_TRANSFORM
Definition: polar.h:45
void rename(const FileName &newName)
Definition: polar.h:282
double oversample
Definition: polar.h:73
doublereal * x
#define i
Polar & operator-=(const Polar< T > in)
Definition: polar.h:239
constexpr int FULL_CIRCLES
Definition: polar.h:40
#define GRIDDING_K
Definition: polar.h:558
Polar_fftw_plans & operator=(const Polar_fftw_plans &)=delete
#define DIRECT_A1D_ELEM(v, i)
Polar(const Polar &P)
Definition: polar.h:100
void image_convertCartesianToPolar(MultidimArray< double > &in, MultidimArray< double > &out, double Rmin, double Rmax, double deltaR, double angMin, double angMax, double deltaAng)
#define M2
double best_rotation(const Polar< std::complex< double > > &I1, const Polar< std::complex< double > > &I2, RotationalCorrelationAux &aux)
Definition: polar.cpp:212
Polar & operator-(const T val) const
Definition: polar.h:134
#define M1
long flag
char axis
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
MultidimArray< std::complex< double > > Fsum
Definition: polar.h:795
int in
double * f
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.)
Definition: polar.cpp:356
void setPixel(int r, int f, T val) const
Definition: polar.h:479
#define XMIPP_EQUAL_ACCURACY
Definition: xmipp_macros.h:119
Polar & operator+(const T val)
Definition: polar.h:147
std::vector< double > ring_radius
Definition: polar.h:74
Polar & operator+=(const Polar< T > in)
Definition: polar.h:248
#define XSIZE(v)
void operator+=(const T val)
Definition: polar.h:199
double getRadius(int iring) const
Definition: polar.h:399
void mode
Polar()
Definition: polar.h:85
constexpr int HALF_CIRCLES
Definition: polar.h:41
constexpr bool DONT_CONJUGATE
Definition: polar.h:42
Polar_fftw_plans()
Empty constructor.
Definition: polar.h:58
int mode
Definition: polar.h:72
T interpolatedElementBSpline2D(double x, double y, int SplineDegree=3) const
#define j
void normalize(double average, double stddev)
Definition: polar.h:536
void operator-=(const T val)
Definition: polar.h:186
void fourierTransformRings(Polar< double > &in, Polar< std::complex< double > > &out, Polar_fftw_plans &plans, bool conjugated=DONT_CONJUGATE)
Definition: polar.cpp:34
T & operator()(int r, int f) const
Definition: polar.h:462
Definition: polar.h:67
Polar & operator*=(const Polar< T > in)
Definition: polar.h:257
constexpr bool DONT_KEEP_TRANSFORM
Definition: polar.h:44
FourierTransformer local_transformer
Definition: polar.h:794
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)
Definition: polar.cpp:153
#define FIRST_XMIPP_INDEX(size)
Definition: xmipp_macros.h:439
MultidimArray< T > & getRing(int i)
Definition: polar.h:412
int getRingNo() const
Definition: polar.h:326
#define realWRAP(x, x0, xF)
Definition: xmipp_macros.h:304
~Polar()
Definition: polar.h:111
T interpolatedElement2DOutsideZero(double x, double y) const
std::vector< MultidimArray< T > > rings
Definition: polar.h:75
void getCartesianCoordinates(std::vector< double > &x, std::vector< double > &y, std::vector< T > &data, const int extra_shell=GRIDDING_K/2)
Definition: polar.h:559
#define LAST_XMIPP_INDEX(size)
Definition: xmipp_macros.h:448
int getMode() const
Definition: polar.h:343
#define PI
Definition: tools.h:43
void calculateFftwPlans(Polar_fftw_plans &out)
Definition: polar.h:708
Incorrect value received.
Definition: xmipp_error.h:195
std::vector< MultidimArray< double > > arrays
Definition: polar.h:56
void clear()
Definition: polar.h:295
Polar & operator/(const T val)
Definition: polar.h:173
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)
Definition: polar.cpp:305
void setRing(int i, MultidimArray< T > val)
Definition: polar.h:430