Xmipp  v3.23.11-Nereus
movie_estimate_gain.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Victoria Peredo
4  * Estrella Fernandez
5  * Carlos Oscar S. Sorzano (coss@cnb.csic.es)
6  *
7  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22  * 02111-1307 USA
23  *
24  * All comments concerning this program package may be sent to the
25  * e-mail address 'xmipp@cnb.csic.es'
26  ***************************************************************************/
27 #ifndef _PROG_ESTIMATE_GAIN_HH
28 #define _PROG_ESTIMATE_GAIN_HH
29 
30 #include <core/xmipp_program.h>
31 #include <core/xmipp_image.h>
32 #include <core/metadata_vec.h>
33 
37 
40 
41 
43 {
44 public:
45  FileName fnIn; // Set of input images
46  FileName fnRoot; // Correction image
47  FileName fnCorrected; // Corrected movie
48  int Niter; // Number of iterations
51  int frameStep;
53  bool applyGain;
54 public:
55  void defineParams();
56  void readParams();
57  void show();
58  void run();
59 
60  void produceSideInfo();
61  void computeHistograms(const MultidimArray<double> &Iframe);
62  void normalizeHistograms();
63  void invertHistograms();
64 
65  void constructSmoothHistogramsByColumn(const double *listOfWeights, int width);
66  void constructSmoothHistogramsByRow(const double *listOfWeights, int width);
67  void transformGrayValuesColumn(const MultidimArray<double> &Iframe, MultidimArray<double> &IframeTransformedColumn);
68  void transformGrayValuesRow(const MultidimArray<double> &Iframe, MultidimArray<double> &IframeTransformedRow);
70 
71  size_t selectBestSigmaByColumn(const MultidimArray<double> &Iframe);
72  size_t selectBestSigmaByRow(const MultidimArray<double> &Iframe);
73 
74 
75 
76 public:
81 
82  std::vector<double> listOfSigmas;
83  std::vector<double> listOfWidths;
84  std::vector<double *> listOfWeights;
85  int Xdim, Ydim;
86 };
87 
89 #endif
MultidimArray< double > rowH
size_t selectBestSigmaByRow(const MultidimArray< double > &Iframe)
std::vector< double > listOfSigmas
std::vector< double * > listOfWeights
void computeTransformedHistograms(const MultidimArray< double > &Iframe)
void constructSmoothHistogramsByColumn(const double *listOfWeights, int width)
void computeHistograms(const MultidimArray< double > &Iframe)
MultidimArray< double > sumObs
MultidimArray< double > columnH
double computeTVColumns(MultidimArray< double > &I)
MultidimArray< double > smoothRowH
void transformGrayValuesRow(const MultidimArray< double > &Iframe, MultidimArray< double > &IframeTransformedRow)
MultidimArray< double > smoothColumnH
void transformGrayValuesColumn(const MultidimArray< double > &Iframe, MultidimArray< double > &IframeTransformedColumn)
MultidimArray< double > aSingleRowH
std::vector< double > listOfWidths
MultidimArray< double > aSingleColumnH
void constructSmoothHistogramsByRow(const double *listOfWeights, int width)
double computeTVRows(MultidimArray< double > &I)
size_t selectBestSigmaByColumn(const MultidimArray< double > &Iframe)