Xmipp  v3.23.11-Nereus
ml_refine3d.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Sjors Scheres scheres@cnb.csic.es (2004)
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 _ML_REFINE3D_H
27 #define _ML_REFINE3D_H
28 
29 #include "core/metadata_vec.h"
30 #include "core/xmipp_program.h"
31 #include "data/sampling.h"
32 
33 class ProgReconsBase;
34 class ML2DBaseProgram;
35 
36 //types of reconstructions to be used
37 #define RECONS_ART 0
38 #define RECONS_FOURIER 1
39 
40 #define EMPTY_PROJECTIONS 0
41 #define EMPTY_VOLUMES 1
42 
43 #define FN_ITER_VOLMD() getIterExtraPath(fn_root, iter) + "volumes.xmd"
44 
45 
51 {
52 public:
53  // Filenames for input images, reference volumes, symmetry file and output rootname
55  // Metadata with reference volumes
57  // Number of volumes to refine
58  size_t Nvols;
59  // Iteration numbers
60  size_t iter, istart, Niter;
61  // Convergence check
62  double eps;
63  // Angular sampling interval (degree)
64  double angular;
65  // Type of reconstruction to use
67  // Low-pass filter digital frequency
68  double lowpass;
69  // For user-provided tilt range
71  // Parameters of wlsart reconstruction
74  // Do not use a starting volume in wlsART reconstruction
76  // Threshold for flooding-like solvent mask
78  // Do Wang/Terwilliger-like probabilistic solvent flattening
80  // Do separate_object-like selection of largest connected volume in
81  // binarized solvent mask
83  // Dilate (binarized) solvent mask?
85  // Use MLF mode
87  // Flag to skip reconstruction
89  // Perturb angles of reference projections
90  bool do_perturb;
91  // sampling object
93  // Symmetry setup
95  // Number of reference projections per 3D model
97 
98  //MPI related stuff
99  size_t rank, size;
100 
101  //This is the list of output filename base for
102  //reconstruction of volumes
104  // A pointer to the 2D alignment and classification program
106 
107 private:
109  void showToStream(std::ostream &out);
110 
111 public:
114  ProgMLRefine3D(bool fourier = false);
116  ~ProgMLRefine3D();
118  void defineParams();
120  void readParams();
122  void show();
123 
125  void createSampling();
126  //Call produceSideInfo of ML2D and
127  // Fill sampling and create DFlib
128  virtual void produceSideInfo();
129  virtual void produceSideInfo2();
130 
132  void run();
133 
136  virtual void createEmptyFiles(int type);
137 
140  virtual void projectVolumes(MetaData &mdProj) ;
141 
143  virtual void makeNoiseImages() ;
144 
146  virtual ProgReconsBase * createReconsProgram(FileName &input, FileName &output);
147 
149  virtual void reconstructVolumes();
150 
152  virtual void calculate3DSSNR(MultidimArray<double> &spectral_signal);
153 
155  virtual void copyVolumes();
157  void updateVolumesMetadata();
158 
160  virtual void postProcessVolumes();
161 
163  virtual bool checkConvergence() ;
164 
165 }; // class ProgMLRefine3D
167 #endif
double wlsart_lambda
Definition: ml_refine3d.h:72
FileName fn_ref
Definition: ml_refine3d.h:54
void run()
Provides implementation of the run function.
double tilt_rangeF
Definition: ml_refine3d.h:70
virtual void produceSideInfo()
double threshold_solvent
Definition: ml_refine3d.h:77
StringVector reconsOutFnBase
Definition: ml_refine3d.h:103
FileName fn_solv
Definition: ml_refine3d.h:54
bool do_prob_solvent
Definition: ml_refine3d.h:79
bool skip_reconstruction
Definition: ml_refine3d.h:88
StringVector reconsMdFn
Definition: ml_refine3d.h:103
ML2DBaseProgram * ml2d
Definition: ml_refine3d.h:105
virtual void createEmptyFiles(int type)
double angular
Definition: ml_refine3d.h:64
virtual bool checkConvergence()
Convergency check.
std::vector< String > StringVector
Definition: xmipp_strings.h:35
double wlsart_kappa
Definition: ml_refine3d.h:72
viol type
FileName fn_sym
Definition: ml_refine3d.h:54
void readParams()
Read additional arguments for 3D-process from command line.
void defineParams()
Define the parameters accepted.
Definition: ml_refine3d.cpp:76
void createSampling()
Create sampling for projecting volumes.
FileName fn_sel
Definition: ml_refine3d.h:54
bool wlsart_no_start
Definition: ml_refine3d.h:75
virtual void calculate3DSSNR(MultidimArray< double > &spectral_signal)
Calculate 3D SSNR according to Unser ea. (2005)
FileName fn_root
Definition: ml_refine3d.h:54
double tilt_range0
Definition: ml_refine3d.h:70
virtual void projectVolumes(MetaData &mdProj)
Sampling mysampling
Definition: ml_refine3d.h:92
virtual void reconstructVolumes()
reconstruction by (weighted ART) or Fourier interpolation
FileName fn_iter
Definition: ml_refine3d.h:54
virtual void produceSideInfo2()
MetaDataVec mdVol
Definition: ml_refine3d.h:56
bool do_deblob_solvent
Definition: ml_refine3d.h:82
FileName fn_symmask
Definition: ml_refine3d.h:54
void show()
Show.
virtual void copyVolumes()
virtual void postProcessVolumes()
Masking, filtering etc. of the volume.
virtual ProgReconsBase * createReconsProgram(FileName &input, FileName &output)
Create the program to be used for reconstruction of the volumes.
double lowpass
Definition: ml_refine3d.h:68
void updateVolumesMetadata()
ProgMLRefine3D(bool fourier=false)
Definition: ml_refine3d.cpp:58
virtual void makeNoiseImages()
(For mpi-version only:) calculate noise averages and write to disc