Xmipp  v3.23.11-Nereus
Functions
program_image_residuals.cpp File Reference
#include "program_image_residuals.h"
#include "data/filters.h"
Include dependency graph for program_image_residuals.cpp:

Go to the source code of this file.

Functions

void updateRavg (MetaData &mdR, Matrix2D< double > &Ravg)
 
double computeCovarianceMatrixDivergence (const Matrix2D< double > &C1, const Matrix2D< double > &C2)
 Compute the divergence between two covariance matrices. More...
 

Function Documentation

◆ updateRavg()

void updateRavg ( MetaData mdR,
Matrix2D< double > &  Ravg 
)

Definition at line 78 of file program_image_residuals.cpp.

79 {
80  FileName fnR;
81  Matrix2D<double> R, Rinv, newRavg;
82  Image<double> IR;
83  newRavg.initZeros(Ravg);
84  for (size_t objId : mdR.ids())
85  {
86  mdR.getValue(MDL_IMAGE_COVARIANCE,fnR,objId);
87  IR.read(fnR);
88  IR().copy(R);
89 
90  R+=Ravg;
91  R*=0.5;
92  R.inv(Rinv);
93  newRavg+=Rinv;
94  }
95  newRavg*=1.0/mdR.size();
96  newRavg.inv(Ravg);
97 }
void inv(Matrix2D< T > &result) const
Definition: matrix2d.cpp:663
virtual IdIteratorProxy< false > ids()
virtual bool getValue(MDObject &mdValueOut, size_t id) const =0
virtual size_t size() const =0
Name of the covariance imagee associated to this image.
void initZeros()
Definition: matrix2d.h:626
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void copy(const ImageBase &other)