Xmipp  v3.23.11-Nereus
volumeset_align.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Mohamad Harastani mohamad.harastani@upmc.fr
4  * Slavica Jonic slavica.jonic@upmc.fr
5  * Carlos Oscar Sanchez Sorzano coss.eps@ceu.es
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.uam.es'
24  ***************************************************************************/
25 #ifndef _PROG_VOLUMESET_ALIGN
26 #define _PROG_VOLUMESET_ALIGN
27 
29 #include "core/rerunable_program.h"
30 #include "core/matrix1d.h"
31 
36 {
37 public:
38 
40  bool resume = false;
41 
44 
47 
50 
51  // starting and ending tilt angles for compensating for a single tilt wedge mask for tomography data
52  int tilt0;
53  int tiltF;
54 
55  // maximum search frequency and shift while rigid body alignment
56  double frm_freq;
57  int frm_shift;
58 
59  // mask
61 
62  // for fetching the rigid-body alignment parameters for each volume
65  float fitness;
66 
67  // flag indicates if there is a compensation for the missing wedge (volumes are rotated by 90 degrees about y axis for this purpose)
68  bool flipped = false;
69 
70  // Random generator seed
71  int rangen = 0;
72 
73  // All estimated parameters (with the cost)
75 
76  // Current volume being considered
78 
79  // Template for temporal filename generation
80  char nameTemplate[256];
81 
84 
86  void defineParams();
87 
89  void readParams();
90 
93  virtual void preProcess();
94 
96  void processImage(const FileName &fnImg, const FileName &, const MDRow &, MDRow &);
97 
99  virtual void finishProcessing();
100 
102  virtual void writeVolumeParameters(const FileName &fnImg);
103 
104  protected:
105  virtual void createWorkFiles() {
106  return Rerunable::createWorkFiles(resume, getInputMd());
107  }
108 
109  private:
110 
112 
113  std::vector<MDLabel> getLabelsForEmpty() override {
114  return std::vector<MDLabel>{MDL_IMAGE, MDL_ENABLED, MDL_IMAGE,
118  }
119 
120  void computeFitness();
121 
122 };
124 #endif
125 
Rotation angle of an image (double,degrees)
virtual void writeVolumeParameters(const FileName &fnImg)
Tilting angle of an image (double,degrees)
float Matrix_Angles_Shifts[6]
Shift for the image in the X axis (double)
ProgVolumeSetAlign()
Empty constructor.
Special label to be used when gathering MDs in MpiMetadataPrograms.
bool alignVolumes
Align volumes.
Matrix1D< double > parameters
Is this image enabled? (int [-1 or 1])
void readParams()
Read arguments from command line.
virtual void createWorkFiles(bool resume, MetaData *md)
Angle between y-axis and tilt-axis (double, degrees) for untilted micrographs.
void processImage(const FileName &fnImg, const FileName &, const MDRow &, MDRow &)
Maximum cross-correlation for the image (double)
virtual void preProcess()
virtual void finishProcessing()
FileName fnREF
Reference volume structure.
virtual void createWorkFiles()
Shift for the image in the Z axis (double)
FileName fnOutDir
Output directory.
Shift for the image in the Y axis (double)
Name of an image (std::string)
void defineParams()
Define params.