Xmipp  v3.23.11-Nereus
resolution_monotomo.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Jose Luis Vilas, jlvilas@cnb.csic.es
4  * Carlos Oscar S. Sorzano coss@cnb.csic.es (2016)
5  *
6  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21  * 02111-1307 USA
22  *
23  * All comments concerning this program package may be sent to the
24  * e-mail address 'xmipp@cnb.csic.es'
25  ***************************************************************************/
26 
27 #ifndef _PROG_MONOTOMO
28 #define _PROG_MONOTOMO
29 
30 #include <iostream>
31 #include <core/xmipp_program.h>
32 #include <core/xmipp_image.h>
33 #include <core/xmipp_fft.h>
34 #include <core/xmipp_fftw.h>
35 #include <math.h>
36 #include <limits>
37 #include <complex>
38 #include <data/fourier_filter.h>
39 #include <data/filters.h>
40 #include <string>
41 
47 class ProgMonoTomo : public XmippProgram
48 {
49 public:
53 
55  double sampling, minRes, maxRes, R;
56 
59 
62 
65 
66 public:
67 
68  void defineParams();
69  void readParams();
70  void produceSideInfo();
71 
72  /* Mogonogenid amplitud of a volume, given an input volume,
73  * the monogenic amplitud is calculated and low pass filtered at frequency w1*/
74  void amplitudeMonogenicSignal3D(MultidimArray< std::complex<double> > &myfftV,
75  double freq, double freqH, double freqL, MultidimArray<double> &amplitude,
76  int count, FileName fnDebug);
77  void firstMonoResEstimation(MultidimArray< std::complex<double> > &myfftV,
78  double freq, double freqH, double freqL, MultidimArray<double> &amplitude,
79  int count, FileName fnDebug, double &mean_Signal,
80  double &mean_noise, double &thresholdFirstEstimation);
81 
83 
84  //Computes the noise distribution inside a box with size boxsize, of a given map, and determines the percentile 95
85  // which is stored in thresholdMatrix.
86  void localNoise(MultidimArray<double> &noiseMap, Matrix2D<double> &noiseMatrix, int boxsize, Matrix2D<double> &thresholdMatrix);
87 
89  std::vector<double> &list);
90 
91  void resolution2eval(int &count_res, double step,
92  double &resolution, double &last_resolution,
93  double &freq, double &freqL,
94  int &last_fourier_idx,
95  bool &continueIter, bool &breakIter);
96 
98  std::vector<double> &list, double &cut_value, double &resolutionThreshold);
99 
100  void run();
101 
102 public:
104  MultidimArray<double> iu, VRiesz; // Inverse of the frequency
105  MultidimArray< std::complex<double> > fftV, *fftN; // Fourier transform of the input volume
113 };
115 #endif
FourierTransformer transformer_inv
void lowestResolutionbyPercentile(MultidimArray< double > &resolutionVol, std::vector< double > &list, double &cut_value, double &resolutionThreshold)
void resolution2eval(int &count_res, double step, double &resolution, double &last_resolution, double &freq, double &freqL, int &last_fourier_idx, bool &continueIter, bool &breakIter)
void localNoise(MultidimArray< double > &noiseMap, Matrix2D< double > &noiseMatrix, int boxsize, Matrix2D< double > &thresholdMatrix)
Matrix1D< double > freq_fourier_z
Image< double > VresolutionFiltered
MultidimArray< double > iu
MultidimArray< double > VRiesz
FourierFilter FilterBand
Matrix1D< double > freq_fourier_y
Matrix2D< double > resolutionMatrix
FourierFilter lowPassFilter
Image< int > mask
MultidimArray< std::complex< double > > * fftN
MultidimArray< std::complex< double > > fftV
void amplitudeMonogenicSignal3D(MultidimArray< std::complex< double > > &myfftV, double freq, double freqH, double freqL, MultidimArray< double > &amplitude, int count, FileName fnDebug)
MultidimArray< std::complex< double > > fftVRiesz
Matrix2D< double > maskMatrix
MultidimArray< std::complex< double > > fftVRiesz_aux
Matrix1D< double > freq_fourier_x
void firstMonoResEstimation(MultidimArray< std::complex< double > > &myfftV, double freq, double freqH, double freqL, MultidimArray< double > &amplitude, int count, FileName fnDebug, double &mean_Signal, double &mean_noise, double &thresholdFirstEstimation)
void median3x3x3(MultidimArray< double > vol, MultidimArray< double > &filtered)
Image< double > Vfiltered
void postProcessingLocalResolutions(MultidimArray< double > &resolutionVol, std::vector< double > &list)