Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | List of all members

#include <mpi_classify_CL2D.h>

Collaboration diagram for CL2DClass:
Collaboration graph
[legend]

Public Member Functions

 CL2DClass ()
 
 CL2DClass (const CL2DClass &other)
 
 CL2DClass (const CL2DClass &&)=delete
 
 ~CL2DClass ()
 
CL2DClassoperator= (const CL2DClass &other)
 
CL2DClassoperator= (const CL2DClass &&)=delete
 
void updateProjection (const MultidimArray< double > &I, const CL2DAssignment &assigned, bool force=false)
 
void updateNonProjection (double corr, bool force=false)
 
void transferUpdate (bool centerReference=true)
 
void fitBasic (MultidimArray< double > &I, CL2DAssignment &result, bool reverse=false)
 
void fit (MultidimArray< double > &I, CL2DAssignment &result)
 
void lookForNeighbours (const std::vector< CL2DClass *> listP, int K)
 Look for K-nearest neighbours. More...
 

Public Attributes

MultidimArray< double > P
 
MultidimArray< double > Pupdate
 
Polar< std::complex< double > > polarFourierP
 
MultidimArray< double > rotationalCorr
 
Polar_fftw_plansplans
 
CorrelationAux corrAux
 
RotationalCorrelationAux rotAux
 
std::vector< CL2DAssignmentcurrentListImg
 
std::vector< CL2DAssignmentnextListImg
 
std::vector< double > nextNonClassCorr
 
Histogram1D histClass
 
Histogram1D histNonClass
 
std::vector< int > neighboursIdx
 

Detailed Description

CL2DClass class

Definition at line 67 of file mpi_classify_CL2D.h.

Constructor & Destructor Documentation

◆ CL2DClass() [1/3]

CL2DClass::CL2DClass ( )

Empty constructor

Definition at line 85 of file mpi_classify_CL2D.cpp.

86 {
87  plans = NULL;
88  P.initZeros(prm->Ydim, prm->Xdim);
89  P.setXmippOrigin();
90  Pupdate = P;
91 }
MultidimArray< double > P
MultidimArray< double > Pupdate
ProgClassifyCL2D * prm
void initZeros(const MultidimArray< T1 > &op)
Polar_fftw_plans * plans

◆ CL2DClass() [2/3]

CL2DClass::CL2DClass ( const CL2DClass other)

Copy constructor

Definition at line 93 of file mpi_classify_CL2D.cpp.

94 {
95  *this=other;
96 }

◆ CL2DClass() [3/3]

CL2DClass::CL2DClass ( const CL2DClass &&  )
delete

◆ ~CL2DClass()

CL2DClass::~CL2DClass ( )

Destructor

Definition at line 116 of file mpi_classify_CL2D.cpp.

117 {
118  delete plans;
119 }
Polar_fftw_plans * plans

Member Function Documentation

◆ fit()

void CL2DClass::fit ( MultidimArray< double > &  I,
CL2DAssignment result 
)

Compute the fit of the input image with this node (check mirrors).

Definition at line 431 of file mpi_classify_CL2D.cpp.

432 {
433  if (currentListImg.size() == 0)
434  return;
435 
436  // Try this image
437  MultidimArray<double> Idirect = I;
438  CL2DAssignment resultDirect;
439  fitBasic(Idirect, resultDirect);
440 
441  // Try its mirror
442  CL2DAssignment resultMirror;
443  MultidimArray<double> Imirror;
444  if (prm->mirrorImages)
445  {
446  Imirror=I;
447  fitBasic(Imirror, resultMirror, true);
448  }
449  else
450  resultMirror.corr=-1e38;
451 
452  if (resultMirror.corr > resultDirect.corr)
453  {
454  I = Imirror;
455  result.copyAlignment(resultMirror);
456  }
457  else
458  {
459  I = Idirect;
460  result.copyAlignment(resultDirect);
461  }
462 
463  result.likelihood = 0;
464  if (!prm->classicalMultiref)
465  {
466  // Find the likelihood
467  int idx;
468  histClass.val2index(result.corr, idx);
469  if (idx < 0)
470  return;
471  double likelihoodClass = 0;
472  for (int i = 0; i <= idx; i++)
473  likelihoodClass += DIRECT_A1D_ELEM(histClass,i);
474  histNonClass.val2index(result.corr, idx);
475  if (idx < 0)
476  return;
477  double likelihoodNonClass = 0;
478  for (int i = 0; i <= idx; i++)
479  likelihoodNonClass += DIRECT_A1D_ELEM(histNonClass,i);
480  result.likelihood = likelihoodClass * likelihoodNonClass;
481  }
482 }
void val2index(double v, int &i) const
Definition: histogram.h:271
Histogram1D histClass
bool classicalMultiref
Classical Multiref.
#define i
void copyAlignment(const CL2DAssignment &alignment)
Copy alignment.
#define DIRECT_A1D_ELEM(v, i)
void fitBasic(MultidimArray< double > &I, CL2DAssignment &result, bool reverse=false)
std::vector< CL2DAssignment > currentListImg
bool mirrorImages
Mirror.
ProgClassifyCL2D * prm
Histogram1D histNonClass

◆ fitBasic()

void CL2DClass::fitBasic ( MultidimArray< double > &  I,
CL2DAssignment result,
bool  reverse = false 
)

Compute the fit of the input image with this node. The input image is rotationally and traslationally aligned (2 iterations), to make it fit with the node.

Definition at line 220 of file mpi_classify_CL2D.cpp.

222 {
223  if (reverse)
224  {
225  I.selfReverseX();
226  I.setXmippOrigin();
227  }
228 
229  Matrix2D<double> ARS, ASR, R(3, 3), INV;
230  ARS.initIdentity(3);
231  ASR = ARS;
232  INV = ARS; // avoid creating a new transformation matrix per applyGeometry call
233  MultidimArray<double> IauxSR = I, IauxRS = I;
234 // Mcorr.resizeNoCopy(I);
235  Polar<std::complex<double> > polarFourierI;
237 #ifdef DEBUG_MORE
238  Image<double> save2;
239  save2()=P;
240  save2.write("PPPI1.xmp");
241 #endif
242 
243  // Align the image with the node
244  if (prm->alignImages)
245  {
246  double shiftXSR=INITIAL_SHIFT_THRESHOLD, shiftYSR=INITIAL_SHIFT_THRESHOLD, bestRotSR=INITIAL_ROTATE_THRESHOLD;
247  double shiftXRS=INITIAL_SHIFT_THRESHOLD, shiftYRS=INITIAL_SHIFT_THRESHOLD, bestRotRS=INITIAL_ROTATE_THRESHOLD;
248 
249  for (int i = 0; i < 3; i++)
250  {
251  // Shift then rotate
252  if (((shiftXSR > SHIFT_THRESHOLD) || (shiftXSR < (-SHIFT_THRESHOLD))) ||
253  ((shiftYSR > SHIFT_THRESHOLD) || (shiftYSR < (-SHIFT_THRESHOLD))))
254  {
255  bestShift(P, corrAux.FFT1, IauxSR, shiftXSR, shiftYSR, corrAux);
256  MAT_ELEM(ASR,0,2) += shiftXSR;
257  MAT_ELEM(ASR,1,2) += shiftYSR;
258  ASR.inv(INV);
259  applyGeometry(xmipp_transformation::LINEAR, IauxSR, I, INV, xmipp_transformation::IS_INV, xmipp_transformation::WRAP);
260  }
261 
262  #ifdef DEBUG_MORE
263  save2()=IauxSR;
264  save2.write("PPPIauxSR_afterShift.xmp");
265  std::cout << "ASR\n" << ASR << std::endl;
266  #endif
267 
269  if (bestRotSR > ROTATE_THRESHOLD)
270  {
271  polarFourierTransform<true>(IauxSR, fitBasic_aux, polarFourierI, true,
272  XSIZE(P) / 5, XSIZE(P) / 2-2, plans, 1);
273 
274  bestRotSR = best_rotation(polarFourierP, polarFourierI, rotAux);
275  rotation2DMatrix(bestRotSR, R);
276  M3x3_BY_M3x3(ASR,R,ASR);
277  ASR.inv(INV);
278  applyGeometry(xmipp_transformation::LINEAR, IauxSR, I, INV, xmipp_transformation::IS_INV, xmipp_transformation::WRAP);
279  }
280 
281  #ifdef DEBUG_MORE
282  save2()=IauxSR;
283  save2.write("PPPIauxSR_afterShiftAndRotation.xmp");
284  std::cout << "ASR\n" << ASR << std::endl;
285  #endif
286 
287  // Rotate then shift
288  if (bestRotRS > ROTATE_THRESHOLD)
289  {
290  polarFourierTransform<true>(IauxRS, fitBasic_aux, polarFourierI, true,
291  XSIZE(P) / 5, XSIZE(P) / 2-2, plans, 1);
292 
293  bestRotRS = best_rotation(polarFourierP, polarFourierI, rotAux);
294  rotation2DMatrix(bestRotRS, R);
295  M3x3_BY_M3x3(ARS,R,ARS);
296  ARS.inv(INV);
297  applyGeometry(xmipp_transformation::LINEAR, IauxRS, I, INV, xmipp_transformation::IS_INV, xmipp_transformation::WRAP);
298  }
299 
300 #ifdef DEBUG_MORE
301  save2()=IauxRS;
302  save2.write("PPPIauxRS_afterRotation.xmp");
303  std::cout << "ARS\n" << ARS << std::endl;
304 #endif
305 
306  if (((shiftXRS > SHIFT_THRESHOLD) || (shiftXRS < (-SHIFT_THRESHOLD))) ||
307  ((shiftYRS > SHIFT_THRESHOLD) || (shiftYRS < (-SHIFT_THRESHOLD))))
308  {
309  bestShift(P, corrAux.FFT1, IauxRS, shiftXRS, shiftYRS, corrAux);
310  MAT_ELEM(ARS,0,2) += shiftXRS;
311  MAT_ELEM(ARS,1,2) += shiftYRS;
312  ARS.inv(INV);
313  applyGeometry(xmipp_transformation::LINEAR, IauxRS, I, INV, xmipp_transformation::IS_INV, xmipp_transformation::WRAP);
314  }
315 
316  #ifdef DEBUG_MORE
317  save2()=IauxRS;
318  save2.write("PPPIauxRS_afterRotationAndShift.xmp");
319  std::cout << "ARS\n" << ARS << std::endl;
320 
321  char c;
322  std::cout << "Press any key\n";
323  std::cin >> c;
324  #endif
325  }
326  }
327 
328  // Compute the correntropy
329  double corrRS=0.0, corrSR=0.0;
330  MultidimArray<int> &imask = prm->mask;
331  if (prm->useThresholdMask)
332  {
333  imask.initZeros(IauxRS);
335  if (DIRECT_MULTIDIM_ELEM(IauxRS,n)>prm->threshold)
336  DIRECT_MULTIDIM_ELEM(imask,n)=1;
338  if (DIRECT_MULTIDIM_ELEM(IauxSR,n)>prm->threshold)
339  DIRECT_MULTIDIM_ELEM(imask,n)=1;
340  }
341  if (prm->useCorrelation)
342  {
343  corrRS = corrSR = 0;
344  long N = 0;
346  {
347  if (DIRECT_MULTIDIM_ELEM(imask,n))
348  {
349  double Pval = DIRECT_MULTIDIM_ELEM(P, n);
350  corrRS += Pval * DIRECT_MULTIDIM_ELEM(IauxRS, n);
351  corrSR += Pval * DIRECT_MULTIDIM_ELEM(IauxSR, n);
352  ++N;
353  }
354  }
355  if (0 == N) {
356  REPORT_ERROR(ERR_UNCLASSIFIED, "This should never happen. If you know how to reproduce"
357  "this issue, please contact developers.");
358  }
359  corrRS /= N;
360  corrSR /= N;
361  }
362  else
363  {
364  corrRS = fastCorrentropy(P, IauxRS, prm->sigma,
365  prm->gaussianInterpolator, imask);
366  corrSR = fastCorrentropy(P, IauxSR, prm->sigma,
367  prm->gaussianInterpolator, imask);
368  }
369 #ifdef DEBUG_MORE
370  std::cout << "corrRS=" << corrRS << std::endl;
371  std::cout << "corrSR=" << corrSR << std::endl;
372 #endif
373 
374 
375  // Prepare result
376  if (reverse)
377  {
378  // COSS: Check that this is correct
379  MAT_ELEM(ARS,0,0) *= -1;
380  MAT_ELEM(ARS,1,0) *= -1;
381  MAT_ELEM(ASR,0,0) *= -1;
382  MAT_ELEM(ASR,1,0) *= -1;
383  }
384 
385  CL2DAssignment candidateRS, candidateSR;
386  candidateRS.readAlignment(ARS);
387  candidateSR.readAlignment(ASR);
388  if (candidateRS.shiftx * candidateRS.shiftx +
389  candidateRS.shifty * candidateRS.shifty > prm->maxShift2)
390  candidateRS.corr = 0;
391  else
392  candidateRS.corr = corrRS;
393  if (candidateSR.shiftx * candidateSR.shiftx +
394  candidateSR.shifty * candidateSR.shifty > prm->maxShift2)
395  candidateSR.corr = 0;
396  else
397  candidateSR.corr = corrSR;
398 
399  if (candidateRS.corr >= candidateSR.corr)
400  {
401  I = IauxRS;
402  result.copyAlignment(candidateRS);
403  }
404  else if (candidateSR.corr > candidateRS.corr)
405  {
406  I = IauxSR;
407  result.copyAlignment(candidateSR);
408  }
409  else
410  // This is for NaNs, Infs, ...
411  result.corr = 0;
412 
413 #ifdef DEBUG
414 
415  Image<double> save;
416  save()=P;
417  save.write("PPPI1.xmp");
418  save()=I;
419  save.write("PPPI2.xmp");
420  save()=P-I;
421  save.write("PPPdiff.xmp");
422  std::cout << "sigma=" << prm->sigma << " corr=" << result.corr
423  << ". Press" << std::endl;
424  char c;
425  std::cin >> c;
426 #endif
427 }
Just to locate unclassified errors.
Definition: xmipp_error.h:192
MultidimArray< double > P
FourierTransformer transformer1
Definition: xmipp_fftw.h:555
#define SPEED_UP_tempsDouble
Definition: xmipp_macros.h:413
constexpr float INITIAL_ROTATE_THRESHOLD
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
doublereal * c
void applyGeometry(int SplineDegree, MultidimArray< std::complex< double > > &V2, const MultidimArray< std::complex< double > > &V1, const Matrix2D< double > &A, bool inv, bool wrap, std::complex< double > outside, MultidimArray< double > *BcoeffsPtr)
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
void inv(Matrix2D< T > &result) const
Definition: matrix2d.cpp:663
double fastCorrentropy(const MultidimArray< double > &x, const MultidimArray< double > &y, double sigma, const GaussianInterpolator &G, const MultidimArray< int > &mask)
Definition: filters.cpp:1244
CorrelationAux corrAux
#define i
#define MAT_ELEM(m, i, j)
Definition: matrix2d.h:116
void copyAlignment(const CL2DAssignment &alignment)
Copy alignment.
double best_rotation(const Polar< std::complex< double > > &I1, const Polar< std::complex< double > > &I2, RotationalCorrelationAux &aux)
Definition: polar.cpp:212
constexpr double INITIAL_SHIFT_THRESHOLD
#define M3x3_BY_M3x3(A, B, C)
Definition: matrix2d.h:182
bool alignImages
Don&#39;t align images.
#define XSIZE(v)
#define FOR_ALL_DIRECT_ELEMENTS_IN_MULTIDIMARRAY(v)
double sigma
Noise in the images.
Polar< std::complex< double > > polarFourierP
#define DIRECT_MULTIDIM_ELEM(v, n)
bool useCorrelation
Use Correlation instead of Correntropy.
MultidimArray< std::complex< double > > FFT1
Definition: xmipp_fftw.h:554
RotationalCorrelationAux rotAux
void FourierTransform(T &v, T1 &V, bool getCopy=true)
Definition: xmipp_fftw.h:166
void rotation2DMatrix(T ang, Matrix2D< T > &result, bool homogeneous)
template void polarFourierTransform< true >(MultidimArray< double > const &, Polar< double > &, Polar< std::complex< double > > &, bool, int, int, Polar_fftw_plans *&, int)
Definition: polar.h:67
bool useThresholdMask
Use threshold mask.
template float bestShift(MultidimArray< float > &, float &, float &, const MultidimArray< int > *, int)
double threshold
Threshold to use.
ProgClassifyCL2D * prm
void initZeros(const MultidimArray< T1 > &op)
MultidimArray< int > mask
Mask for the background.
GaussianInterpolator gaussianInterpolator
int * n
constexpr float ROTATE_THRESHOLD
constexpr double SHIFT_THRESHOLD
void readAlignment(const Matrix2D< double > &M)
Read alignment parameters.
void initIdentity()
Definition: matrix2d.h:673
Polar_fftw_plans * plans

◆ lookForNeighbours()

void CL2DClass::lookForNeighbours ( const std::vector< CL2DClass *>  listP,
int  K 
)

Look for K-nearest neighbours.

Definition at line 486 of file mpi_classify_CL2D.cpp.

487 {
488  int Q = listP.size();
489  neighboursIdx.clear();
490  if (K == Q)
491  {
492  // As many neighbours as codes
493  for (int q = 0; q < Q; q++)
494  neighboursIdx.push_back(q);
495  }
496  else
497  {
498  MultidimArray<double> distanceCode;
499  distanceCode.initZeros(Q);
500  CL2DAssignment assignment;
502  for (int q = 0; q < Q; q++)
503  {
504  if (listP[q] == this)
505  distanceCode(q) = 1;
506  else
507  {
508  I = listP[q]->P;
509  fit(I, assignment);
510  A1D_ELEM(distanceCode,q) = assignment.corr;
511  }
512  }
513 
514  MultidimArray<int> idx;
515  distanceCode.indexSort(idx);
516  for (int k = 0; k < K; k++)
517  neighboursIdx.push_back(idx(Q - k - 1) - 1);
518  }
519 #ifdef DEBUG
520  Image<double> save;
521  save()=P;
522  save.write("PPPthis.xmp");
523  for (int k=0; k<K; k++)
524  {
525  save()=listP[neighboursIdx[k]]->P;
526  save.write((std::string)"PPPneigh"+integerToString(k,1));
527  }
528  std::cout << "Neighbours saved. Press any key\n";
529  char c;
530  std::cin >> c;
531 #endif
532 }
MultidimArray< double > P
doublereal * c
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
#define A1D_ELEM(v, i)
String integerToString(int I, int _width, char fill_with)
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 fit(MultidimArray< double > &I, CL2DAssignment &result)
constexpr int K
void initZeros(const MultidimArray< T1 > &op)
std::vector< int > neighboursIdx
void indexSort(MultidimArray< int > &indx) const

◆ operator=() [1/2]

CL2DClass & CL2DClass::operator= ( const CL2DClass other)

Copy assignment

Definition at line 98 of file mpi_classify_CL2D.cpp.

99 {
100  plans = NULL;
101 
102  CL2DAssignment assignment;
103  assignment.corr = 1;
104  Pupdate = other.P;
105  nextListImg.push_back(assignment);
106  transferUpdate();
107 
109  histClass = other.histClass;
110  histNonClass = other.histNonClass;
112 
113  return *this;
114 }
std::vector< CL2DAssignment > nextListImg
MultidimArray< double > P
Histogram1D histClass
MultidimArray< double > Pupdate
void transferUpdate(bool centerReference=true)
std::vector< CL2DAssignment > currentListImg
std::vector< int > neighboursIdx
Histogram1D histNonClass
Polar_fftw_plans * plans

◆ operator=() [2/2]

CL2DClass& CL2DClass::operator= ( const CL2DClass &&  )
delete

◆ transferUpdate()

void CL2DClass::transferUpdate ( bool  centerReference = true)

Transfer update

Definition at line 133 of file mpi_classify_CL2D.cpp.

134 {
135  if (nextListImg.size() > 0)
136  {
137  // Take from Pupdate
138  double iNq = 1.0 / nextListImg.size();
139  Pupdate *= iNq;
140  if (prm->normalizeImages)
141  Pupdate.statisticsAdjust(0., 1.);
142  P = Pupdate;
145  DIRECT_MULTIDIM_ELEM(P,n) = 0;
147 
148  // Make sure the image is centered
149  if (centerReference && prm->alignImages)
152  if (!DIRECT_A2D_ELEM(prm->mask,i,j))
153  DIRECT_A2D_ELEM(P,i,j) = 0;
154 
155  // Compute the polar Fourier transform of the full image
157  XSIZE(P) / 2-2, plans, 1);
158  size_t finalSize = 2 * polarFourierP.getSampleNoOuterRing() - 1;
159  if (XSIZE(rotationalCorr) != finalSize)
160  rotationalCorr.resize(finalSize);
162 
163  // Take the list of images
165  nextListImg.clear();
166 
167  // Update the histogram of corrs of elements inside and outside the class
168  if (!prm->classicalMultiref)
169  {
170  MultidimArray<double> classCorr, nonClassCorr;
171 
172  classCorr.resizeNoCopy(currentListImg.size());
174  DIRECT_A1D_ELEM(classCorr,i) = currentListImg[i].corr;
175 
176  nonClassCorr.resizeNoCopy(nextNonClassCorr.size());
178  DIRECT_A1D_ELEM(nonClassCorr,i) = nextNonClassCorr[i];
179  nextNonClassCorr.clear();
180 
181  double minC=0., maxC=0.;
182  classCorr.computeDoubleMinMax(minC, maxC);
183  double minN=0., maxN=0.;
184  nonClassCorr.computeDoubleMinMax(minN, maxN);
185  double c0 = XMIPP_MIN(minC,minN);
186  double cF = XMIPP_MAX(maxC,maxN);
187  compute_hist(classCorr, histClass, c0, cF, 200);
188  compute_hist(nonClassCorr, histNonClass, c0, cF, 200);
189  histClass += 1; // Laplace correction
190  histNonClass += 1;
191  histClass /= histClass.sum();
193  }
194 
195 #ifdef DEBUG
196  histClass.write("PPPclass.txt");
197  histNonClass.write("PPPnonClass.txt");
198  std::cout << "Histograms have been written. Press any key\n";
199  char c;
200  std::cin >> c;
201 #endif
202 
203  }
204  else
205  {
206  currentListImg.clear();
207  P.initZeros();
208  }
209 }
std::vector< CL2DAssignment > nextListImg
MultidimArray< double > P
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
#define FOR_ALL_DIRECT_ELEMENTS_IN_ARRAY2D(m)
doublereal * c
void resizeNoCopy(const MultidimArray< T1 > &v)
Histogram1D histClass
#define DIRECT_A2D_ELEM(v, i, j)
CorrelationAux corrAux
bool classicalMultiref
Classical Multiref.
#define FOR_ALL_DIRECT_ELEMENTS_IN_ARRAY1D(v)
#define i
bool normalizeImages
Normalize input images.
Matrix2D< double > centerImage(MultidimArray< double > &I, CorrelationAux &aux, RotationalCorrelationAux &aux2, int Niter, bool limitShift)
Definition: filters.cpp:3277
MultidimArray< double > Pupdate
#define DIRECT_A1D_ELEM(v, i)
void compute_hist(const MultidimArrayGeneric &array, Histogram1D &hist, int no_steps)
Definition: histogram.cpp:572
std::vector< double > nextNonClassCorr
void setReal(MultidimArray< double > &img)
Definition: xmipp_fftw.cpp:129
bool alignImages
Don&#39;t align images.
#define XSIZE(v)
void computeDoubleMinMax(double &minval, double &maxval) const
#define FOR_ALL_DIRECT_ELEMENTS_IN_MULTIDIMARRAY(v)
Polar< std::complex< double > > polarFourierP
#define DIRECT_MULTIDIM_ELEM(v, n)
MultidimArray< double > rotationalCorr
RotationalCorrelationAux rotAux
#define XMIPP_MIN(x, y)
Definition: xmipp_macros.h:181
#define j
template void polarFourierTransform< true >(MultidimArray< double > const &, Polar< double > &, Polar< std::complex< double > > &, bool, int, int, Polar_fftw_plans *&, int)
std::vector< CL2DAssignment > currentListImg
FourierTransformer local_transformer
Definition: polar.h:794
void write(const FileName &fn, MDLabel=MDL_X, MDLabel=MDL_COUNT)
Definition: histogram.cpp:129
ProgClassifyCL2D * prm
void initZeros(const MultidimArray< T1 > &op)
MultidimArray< int > mask
Mask for the background.
int * n
Histogram1D histNonClass
double sum() const
void statisticsAdjust(U avgF, U stddevF)
Polar_fftw_plans * plans

◆ updateNonProjection()

void CL2DClass::updateNonProjection ( double  corr,
bool  force = false 
)
inline

Update non-projection

Definition at line 128 of file mpi_classify_CL2D.h.

129  {
130  if (corr>0 || force)
131  nextNonClassCorr.push_back(corr);
132  }
std::vector< double > nextNonClassCorr

◆ updateProjection()

void CL2DClass::updateProjection ( const MultidimArray< double > &  I,
const CL2DAssignment assigned,
bool  force = false 
)

Update projection.

Definition at line 121 of file mpi_classify_CL2D.cpp.

124 {
125  if ((assigned.corr > 0 && assigned.objId != BAD_OBJID) || force)
126  {
127  Pupdate += I;
128  nextListImg.push_back(assigned);
129  }
130 }
std::vector< CL2DAssignment > nextListImg
MultidimArray< double > Pupdate
#define BAD_OBJID
Definition: metadata_base.h:55

Member Data Documentation

◆ corrAux

CorrelationAux CL2DClass::corrAux

Definition at line 85 of file mpi_classify_CL2D.h.

◆ currentListImg

std::vector<CL2DAssignment> CL2DClass::currentListImg

Definition at line 91 of file mpi_classify_CL2D.h.

◆ histClass

Histogram1D CL2DClass::histClass

Definition at line 100 of file mpi_classify_CL2D.h.

◆ histNonClass

Histogram1D CL2DClass::histNonClass

Definition at line 103 of file mpi_classify_CL2D.h.

◆ neighboursIdx

std::vector<int> CL2DClass::neighboursIdx

Definition at line 106 of file mpi_classify_CL2D.h.

◆ nextListImg

std::vector<CL2DAssignment> CL2DClass::nextListImg

Definition at line 94 of file mpi_classify_CL2D.h.

◆ nextNonClassCorr

std::vector<double> CL2DClass::nextNonClassCorr

Definition at line 97 of file mpi_classify_CL2D.h.

◆ P

MultidimArray<double> CL2DClass::P

Definition at line 70 of file mpi_classify_CL2D.h.

◆ plans

Polar_fftw_plans* CL2DClass::plans

Definition at line 82 of file mpi_classify_CL2D.h.

◆ polarFourierP

Polar<std::complex <double> > CL2DClass::polarFourierP

Definition at line 76 of file mpi_classify_CL2D.h.

◆ Pupdate

MultidimArray<double> CL2DClass::Pupdate

Definition at line 73 of file mpi_classify_CL2D.h.

◆ rotationalCorr

MultidimArray<double> CL2DClass::rotationalCorr

Definition at line 79 of file mpi_classify_CL2D.h.

◆ rotAux

RotationalCorrelationAux CL2DClass::rotAux

Definition at line 88 of file mpi_classify_CL2D.h.


The documentation for this class was generated from the following files: