Xmipp  v3.23.11-Nereus
volume_local_sharpening.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_LOC_SHARPENING
28 #define _PROG_LOC_SHARPENING
29 
30 #include <iostream>
31 #include <core/xmipp_program.h>
32 #include <core/xmipp_image.h>
33 #include <core/xmipp_hdf5.h>
34 #include <core/xmipp_fft.h>
35 #include <core/xmipp_fftw.h>
36 #include <math.h>
37 #include <limits>
38 #include <complex>
39 #include <data/fourier_filter.h>
40 #include <data/filters.h>
41 #include <string>
42 #include "symmetrize.h"
43 
50 {
51 public:
54 
57  int Niter, Nthread;
58 
59 public:
60 
61  void defineParams();
62  void readParams();
63  void produceSideInfo();
64 
65  /* Mogonogenid amplitud of a volume, given an input volume,
66  * the monogenic amplitud is calculated and low pass filtered at frequency w1*/
67  void lowPassFilterFunction(const MultidimArray< std::complex<double> > &myfftV,
68  double w, double wL, MultidimArray<double> &filteredVol, int count);
69 
70  void bandPassFilterFunction(const MultidimArray< std::complex<double> > &myfftV,
71  double w, double wL, MultidimArray<double> &filteredVol, int count);
72  void wideBandPassFilter(const MultidimArray< std::complex<double> > &myfftV,
73  double wmin, double wmax, double wL, MultidimArray<double> &filteredVol);
74 
76  double &maxRes, double &minRes);
77 
79  const MultidimArray< double >&vol, double &stddev, bool outside=false );
80 
81  void localfiltering(MultidimArray< std::complex<double> > &myfftV,
82  MultidimArray<double> &localfilteredVol,
83  double &minFreq, double &maxFreq, double &step);
84 
85  void amplitudeMonogenicSignalBP(MultidimArray< std::complex<double> > &myfftV,
86  double w1, double w1l, MultidimArray<double> &amplitude, int count);
87 
88  void sameEnergy(MultidimArray< std::complex<double> > &myfftV,
89  MultidimArray<double> &localfilteredVol,
90  double &minFreq, double &maxFreq, double &step);
91 
92  void run();
93 
94 public:
98  MultidimArray<double> iu, sharpenedMap; // Inverse of the frequency
99  MultidimArray< std::complex<double> > fftV, fftVfilter; // Fourier transform of the input volume
102 };
104 #endif
void bandPassFilterFunction(const MultidimArray< std::complex< double > > &myfftV, double w, double wL, MultidimArray< double > &filteredVol, int count)
MultidimArray< std::complex< double > > fftV
doublereal * w
MultidimArray< int > mask
void lowPassFilterFunction(const MultidimArray< std::complex< double > > &myfftV, double w, double wL, MultidimArray< double > &filteredVol, int count)
void maxMinResolution(MultidimArray< double > &resVol, double &maxRes, double &minRes)
MultidimArray< std::complex< double > > fftVfilter
void localfiltering(MultidimArray< std::complex< double > > &myfftV, MultidimArray< double > &localfilteredVol, double &minFreq, double &maxFreq, double &step)
void wideBandPassFilter(const MultidimArray< std::complex< double > > &myfftV, double wmin, double wmax, double wL, MultidimArray< double > &filteredVol)
FourierTransformer transformer_inv
void computeAvgStdev_within_binary_mask(const MultidimArray< double > &resVol, const MultidimArray< double > &vol, double &stddev, bool outside=false)
MultidimArray< double > Vorig
MultidimArray< double > iu
FourierTransformer transformer
MultidimArray< double > sharpenedMap
void amplitudeMonogenicSignalBP(MultidimArray< std::complex< double > > &myfftV, double w1, double w1l, MultidimArray< double > &amplitude, int count)
MultidimArray< double > resVol
void sameEnergy(MultidimArray< std::complex< double > > &myfftV, MultidimArray< double > &localfilteredVol, double &minFreq, double &maxFreq, double &step)