Xmipp  v3.23.11-Nereus
flexible_alignment.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Slavica Jonic slavica.jonic@impmc.jussieu.fr
4  * Carlos Oscar coss@cnb.uam.es
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19  * 02111-1307 USA
20  *
21  * All comments concerning this program package may be sent to the
22  * e-mail address 'xmipp@cnb.uam.es'
23  ***************************************************************************/
24 
25 #ifndef _PROG_FLEXIBLE_ALIGNMENT
26 #define _PROG_FLEXIBLE_ALIGNMENT
27 
29 #include "core/rerunable_program.h"
30 #include "core/matrix1d.h"
31 #include "core/metadata_vec.h"
32 
38 {
39 public:
41  bool MPIversion;
42 
44  bool resume;
45 
48 
51 
54 
56  double maxdefamp;
57 
60 
62  double scale_defamp;
63 
65  double scdefamp;
66 
69 
71  double maxtransl;
72 
74  double sampling_rate;
75 
78 
81 
83  bool projMatch;
84 
87 
90 
93 
96 
99 
102 
105 
106  // value of cost function
108 
109  // value of cost function in angular continuous assignment
111 
113  double sigma;
114 
117 
118 public:
119  // List of modes
120  std::vector<std::string> modeList;
121 
122  // Random generator seed
123  int rangen;
124 
125  // All estimated parameters (with the cost)
127 
128  // Trial parameters
130 
131  // Best trial parameters
133 
134  // Number of modes
136 
137  // Size of the images in the selfile
138  int imgSize;
139 
140  // Current image being considered
142 
143  // Current stage of optimization
145 
146  // Solution of the first stage
148 
149  // Temporary document file
151 
152  // Template for temporal filename generation
153  char nameTemplate[256];
154 
155  //File name of reduced image
157 
158 public:
161 
163  void defineParams();
164 
166  void readParams();
167 
169  void show();
170 
172  FileName createDeformedPDB() const;
173 
177  void performCompleteSearch(int pyramidLevel);
178 
182  double performContinuousAssignment(int pyramidLevel);
183 
185  double eval();
186 
189  virtual void preProcess();
191  virtual void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut);
192 
194  virtual void finishProcessing();
195 
197  virtual void writeImageParameters(const FileName &fnImg);
198 
199  protected:
200  virtual void createWorkFiles() {
201  return Rerunable::createWorkFiles(resume, getInputMd());
202  }
203 
204  private:
206 
207  std::vector<MDLabel> getLabelsForEmpty() override {
208  return std::vector<MDLabel>{MDL_IMAGE, MDL_ENABLED, MDL_ANGLE_ROT,
211  }
212 };
213 
214 
216 #endif
virtual void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
Rotation angle of an image (double,degrees)
double weight_zero_freq
Weight for zero frequency.
bool do_FilterPDBVol
Low-pass filter the volume from PDB.
void readParams()
Read arguments from command line.
void performCompleteSearch(int pyramidLevel)
Tilting angle of an image (double,degrees)
Shift for the image in the X axis (double)
double gaussian_Real_sigma
Gaussian weight sigma in real space.
FileName fnmask
Mask file.
double maxtransl
Maximum translation.
Special label to be used when gathering MDs in MpiMetadataPrograms.
double cutoff_LPfilter
Low-pass cut-off frequency.
double minAngularSampling
Min angular sampling rate.
bool do_centerPDB
Center PDB.
Matrix1D< double > trial_best
Is this image enabled? (int [-1 or 1])
virtual void writeImageParameters(const FileName &fnImg)
virtual void createWorkFiles()
FileName createDeformedPDB() const
virtual void createWorkFiles(bool resume, MetaData *md)
FileName fnPDB
PDB file.
double scdefamp
Scaling factor to scale deformation amplitude.
Matrix1D< double > parameters
Cost for the image (double)
std::vector< std::string > modeList
Normal mode displacements (vector double)
ProgFlexibleAlignment()
Empty constructor.
Matrix1D< double > trial
Matrix1D< double > bestStage1
int max_no_iter
Max iteration number.
double sigmaGaussian
Fixed Gaussian standard deviation.
bool projMatch
ProjMatch.
double performContinuousAssignment(int pyramidLevel)
double translsampling
Translation sampling.
double maxdefamp
Maximum deformation amplitude.
FileName fnModeList
File zith a list of modes.
void defineParams()
Define params.
Shift for the image in the Y axis (double)
FileName fnOutDir
Output directory.
bool useFixedGaussian
Use fixed Gaussian instead of scattering factors.
double sampling_rate
Sampling rate.
Name of an image (std::string)
double defampsampling
Deformation sampling.
double scale_defamp
Temporary.