90 size_t xdim =
XSIZE(im);
91 size_t ydim =
YSIZE(im);
93 int numZer = (size_t)coef.
sum();
108 double iMaxDim2 = 2./
std::max(xdim,ydim);
113 weightedLeastSquaresHelper.
w.
resizeNoCopy(weightedLeastSquaresHelper.
b);
128 for (
int py = 0; py < polOrder; ++py)
130 double ypy=std::pow(y,py);
131 for (
int px = 0; px < polOrder; ++px)
132 dMij(polValue,px,py) = ypy*std::pow(x,px);
138 for (
int k=0;
k < numZer; ++
k)
146 for (
size_t px = 0; px < (*fMat).Xdim(); ++px)
147 for (
size_t py = 0; py < (*fMat).Ydim(); ++py)
148 temp +=
dMij(*fMat,py,px)*
dMij(polValue,py,px);
150 dMij(zerMat,pixel_idx,
k) = temp;
173 for (
int k=0;
k < numZer; ++
k)
187 save()=reconstructed;
188 save.
write(
"reconstructedZernikes.xmp");
189 ROI.
write(
"ROI.txt");
#define A2D_ELEM(v, i, j)
void resizeNoCopy(const MultidimArray< T1 > &v)
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 abs(Image< double > &op)
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 FOR_ALL_ELEMENTS_IN_ARRAY2D(m)
void resizeNoCopy(int Ydim, int Xdim)
Matrix1D< double > fittedCoeffs
void write(const FileName &fn) const
void max(Image< double > &op1, const Image< double > &op2)
double sum(bool average=false) const
void create(const Matrix1D< int > &coef)
void resizeNoCopy(int Xdim)
void weightedLeastSquares(WeightedLeastSquaresHelper &h, Matrix1D< double > &result)