Xmipp  v3.23.11-Nereus
resolution_monogenic_signal.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_MONOGENIC_SIGNAL_RES
28 #define _PROG_MONOGENIC_SIGNAL_RES
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 <data/monogenic_signal.h>
41 #include <string>
42 #include "symmetrize.h"
43 
50 {
51 public:
55 
58 
61  int Nvoxels, nthrs;
62 
65 
68 
69 public:
70 
71  void defineParams();
72  void readParams();
73  void produceSideInfo();
74 
75  void excludeArea(MultidimArray<int> &pMask, MultidimArray<int> &pMaskExcl);
76 
77  /* Mogonogenid amplitud of a volume, given an input volume,
78  * the monogenic amplitud is calculated and low pass filtered at frequency w1*/
79  void amplitudeMonogenicSignal3D(MultidimArray< std::complex<double> > &myfftV,
80  double freq, double freqH, double freqL, MultidimArray<double> &amplitude,
81  int count, FileName fnDebug);
82 
83  void refiningMask(const MultidimArray< std::complex<double> > &myfftV,
84  MultidimArray<double> &iu, int thrs, MultidimArray<int> &pMask);
85 
86 
88  MultidimArray<double> &resolutionVol,
89  std::vector<double> &list, double &cut_value, MultidimArray<int> &pMask);
90 
91  void run();
92 
93 private:
94  Image<int> mask, maskExcl;
95  MultidimArray<double> iu, VRiesz; // Inverse of the frequency
96  MultidimArray< std::complex<double> > fftV, *fftN; // Fourier transform of the input volume
97  FourierTransformer transformer_inv;
98  MultidimArray< std::complex<double> > fftVRiesz, fftVRiesz_aux;
99  FourierFilter lowPassFilter, FilterBand;
100  bool halfMapsGiven;
101  Image<double> Vfiltered, VresolutionFiltered;
102  Matrix1D<double> freq_fourier;
103  Matrix1D<double> freq_fourier_x, freq_fourier_y, freq_fourier_z;
104  Matrix2D<double> resolutionMatrix, maskMatrix;
105 };
107 #endif
void amplitudeMonogenicSignal3D(MultidimArray< std::complex< double > > &myfftV, double freq, double freqH, double freqL, MultidimArray< double > &amplitude, int count, FileName fnDebug)
void excludeArea(MultidimArray< int > &pMask, MultidimArray< int > &pMaskExcl)
void postProcessingLocalResolutions(MultidimArray< double > &FilteredMap, MultidimArray< double > &resolutionVol, std::vector< double > &list, double &cut_value, MultidimArray< int > &pMask)
void refiningMask(const MultidimArray< std::complex< double > > &myfftV, MultidimArray< double > &iu, int thrs, MultidimArray< int > &pMask)