Xmipp  v3.23.11-Nereus
fourier_filter.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Carlos Oscar S. Sorzano (coss@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #ifndef _FOURIER_FILTER_HH
27 #define _FOURIER_FILTER_HH
28 
29 #include "filters.h"
30 #include "data/ctf.h"
31 
70 {
71 public:
72 #define RAISED_COSINE 1
73 
76 
77 #define LOWPASS 1
78 #define HIGHPASS 2
79 #define BANDPASS 3
80 #define STOPBAND 4
81 #define CTF 5
82 #define WEDGE 7
83 #define GAUSSIAN 8
84 #define CONE 9
85 #define CTFPOS 10
86 #define BFACTOR 11
87 #define REALGAUSSIAN 12
88 #define SPARSIFY 13
89 #define STOPLOWBANDX 14
90 #define STOPLOWBANDY 15
91 #define FSCPROFILE 16
92 #define BINARYFILE 17
93 #define ASTIGMATISMPROFILE 18
94 #define CTFINV 19
95 #define CTFPOSINV 20
96 #define CTFDEF 21
97 #define REALGAUSSIANZ 22
98 #define REALGAUSSIANZ2 23
99 #define WEDGE_RC 24
100 
106 
109  double w1;
110 
112  double w2;
113 
116 
118  double t1;
119  double t2;
120  double rot;
121  double tilt;
122  double psi;
123 
125  double percentage;
126 
129 
131  double raised_w;
132 
135 
137  double minCTF;
138 
141 
144 
147 
148 public:
150  static void defineParams(XmippProgram * program);
151 
154  void readParams(XmippProgram * program);
155 
157  void apply(MultidimArray<double> &img);
158 
160  FourierFilter();
161 
163  void init();
164 
166  void show();
167 
171  double maskValue(const Matrix1D<double> &w);
172 
175 
178 
182  void applyMaskFourierSpace(const MultidimArray<double> &v, MultidimArray<std::complex<double> > &V);
183 
185  double maskPower();
186 
188  void correctPhase();
189 public:
190  // Auxiliary vector for representing frequency values
192 
193  // Auxiliary mask for the filter in 3D
195 
196  // Auxiliary mask for the filter in 3D
198 
199  // Transformer
201 
202  // Auxiliary variables for sparsify
205 
206  // Auxiliary variables for FSC profile
207  std::vector<double> freqContFSC;
208  std::vector<double> FSC;
209 };
210 
212 {
213 public:
214  double K; // K*sigma
216  Image<int> mask; // for the case of mask bad pixels
217  double Ts; // Sampling rate
218 
220  static void defineParams(XmippProgram * program);
222  void readParams(XmippProgram * program);
224  void apply(MultidimArray<double> &img);
225 };
226 
229 void bandpassFilter(MultidimArray<double> &img, double w1, double w2, double raised_w);
230 
233 void gaussianFilter(MultidimArray<double> &img, double w1);
234 
238 void realGaussianFilter(MultidimArray<double> &img, double sigma);
240 #endif
CTFDescription ctf
void readParams(XmippProgram *program)
FileName fnFilter
void gaussianFilter(MultidimArray< double > &img, double w1)
static void defineParams(XmippProgram *program)
std::vector< double > FSC
void apply(MultidimArray< double > &img)
MultidimArray< double > vMag
MultidimArray< double > maskFourierd
Matrix1D< double > w
double sampling_rate
double maskValue(const Matrix1D< double > &w)
std::vector< double > freqContFSC
void bandpassFilter(MultidimArray< double > &img, double w1, double w2, double raised_w)
MultidimArray< double > vMagSorted
void realGaussianFilter(MultidimArray< double > &img, double sigma)
void applyMaskFourierSpace(const MultidimArray< double > &v, MultidimArray< std::complex< double > > &V)
MultidimArray< int > maskFourier
void generateMask(MultidimArray< double > &v)
FourierTransformer transformer
void applyMaskSpace(MultidimArray< double > &v)