47 addUsageLine(
"Generate 3D reconstructions from projections using the ART algorithm (even with SIRT).");
48 addUsageLine(
"+A history file with the information of the reconstruction process is created. You can ");
49 addUsageLine(
"+also give symmetry elements to specify different points of view reusing the projections ");
50 addUsageLine(
"+you have. The reconstruction is performed using some basis (blobs or voxels) in ");
51 addUsageLine(
"+different grids (BCC (by default), FCC or CC).");
58 addExampleLine(
"+++* Basis volume definition: The basis volume is defined internally such that it should cover ",
false);
59 addExampleLine(
"+++the space cube corresponding to =(-Xdim/2,-Xdim/2,-Xdim/2)= to =(X dim /2,Xdim/2,Xdim/2)= where Xdim ",
false);
60 addExampleLine(
"+++is the X dimension of the projections.",
false);
61 addExampleLine(
"+++* Voxel volume definition: The final reconstructed volume is defined in such a way that it ",
false);
62 addExampleLine(
"+++covers the whole basis volume. For these two definitions and the fact that the basis has got ",
false);
63 addExampleLine(
"+++some radius (normally 2) the final reconstructions are a little wider than the original ",
false);
65 addExampleLine(
"+++* Crystal reconstructions: Crystal projections must be the deformed projections of the ",
false);
66 addExampleLine(
"+++deformed volume. I mean, the lattice vectors of the volume to reconstruct need not to lie ",
false);
67 addExampleLine(
"+++on a grid point inside the BCC, FCC or CC grid. If we ant to force that they lie on a grid ",
false);
68 addExampleLine(
"+++point we have to deform the volume. When he have this deformed volume and we project it, the ",
false);
69 addExampleLine(
"+++two 3D lattice vectors project to two different 2D lattice vectors, that in principle there ",
false);
70 addExampleLine(
"+++is no relationship between them. We must force this two 2D lattice vectors to align with ",
false);
71 addExampleLine(
"+++=a=(Xdim,0)= and =b=(0,Ydim)= by deforming the projection. This is the second deformation. ",
false);
72 addExampleLine(
"+++This complex projections are either generated from phantoms using the program Project or ",
false);
73 addExampleLine(
"+++from lists of Fourier spots coming out from MRC as APH files by applying the program ",
false);
75 addExampleLine(
"+++* Surface constraints: These constraints force the volume to be 0 at known places. ",
false);
76 addExampleLine(
"+++This has got the beneficial consequence that mass tends to be compacted where it should be.",
false);
77 addExampleLine(
"+++* Grids: This program defines three grids for working with data. The typical simple cubic grid, ",
false);
78 addExampleLine(
"+++the face-centered grid (fcc) and the body-centered cubic grid (bcc). We define these grids as follows: ",
false);
79 addExampleLine(
"+++| Simple Cubic Grid | %ATTACHURL%/image004.gif |",
false);
80 addExampleLine(
"+++| Face-centered cubic grid | %ATTACHURL%/image008.gif |",
false);
81 addExampleLine(
"+++| Body-centered cubic grid | %ATTACHURL%/image006.gif |",
false);
82 addExampleLine(
"+++where %ATTACHURL%/image010.gif is the set of integers and %ATTACHURL%/image002.gif is a positive ",
false);
83 addExampleLine(
"+++real number called sampling distance. See =Gabor H., Geometry of Digital Spaces, Birkhauser, 1998, Massachussets=",
false);
85 addExampleLine(
"+++In the case of the simple cubic grid the voxels are cubes of volume %ATTACHURL%/image013.gif ³",
false);
86 addExampleLine(
"+++. The voxels associated to the bcc grid are truncated octahedra, polyhedra of 8 hexagonal ",
false);
87 addExampleLine(
"+++faces and 6 square faces, of volume 4 %ATTACHURL%/image013.gif ³ .Finally, the voxels associated ",
false);
88 addExampleLine(
"+++to the fcc grid are rhombic dodacehedra, polyhedra of 12 identical rhombic faces, of volume 2 ",
false);
89 addExampleLine(
"+++%ATTACHURL%/image013.gif ³. However, in practice the above definitions are implemented using a ",
false);
90 addExampleLine(
"+++combination of simple cubic grids. Clearly, a simple cubic grid defines the complex simple cubic ",
false);
91 addExampleLine(
"+++grid and thus the relative size used in the implementation is exactly the %ATTACHURL%/image013.gif ³. ",
false);
92 addExampleLine(
"+++For defining the bcc grid two simple cubic grids are used, it can be seen from the definition for ",
false);
93 addExampleLine(
"+++the bcc above that the valid positions for even values of =z=, =x= and =y= have to be also even, ",
false);
94 addExampleLine(
"+++in the case of odd values of =z= , =x= and =y= have to be odd. Consequently, the relative size used ",
false);
95 addExampleLine(
"+++in the BCC grid is equivalent to 2 %ATTACHURL%/image013.gif above. For defining the fcc grid four ",
false);
96 addExampleLine(
"+++simple cubic grids are used, it can be seen from the definition for the fcc above that the valid ",
false);
97 addExampleLine(
"+++positions for even values of =z=, the sum of =x= and =y= has to be even; in the case of odd values ",
false);
98 addExampleLine(
"+++of =z= the sum of =x= and =y= has to be odd. Consequently, the relative size used in the FCC grid ",
false);
99 addExampleLine(
"+++is equivalent to 2 %ATTACHURL%/image013.gif above. %BR%",
false);
103 addExampleLine(
"Create the equivalent noisy reconstruction:",
false);
104 addExampleLine(
"reconstruct_art -i projections.sel -o artrec --noisy_reconstruction");
107 addExampleLine(
"Save the basis information at each iteration:",
false);
108 addExampleLine(
"reconstruct_art -i projections.sel -o artrec -n 3 --save_basis");
133 std::cout <<
" =====================================================================" << std::endl;
134 std::cout <<
" ART reconstruction method " << std::endl;
135 std::cout <<
" =====================================================================" << std::endl;
140 std::cout << std::endl;
142 std::cout <<
" ---------------------------------------------------------------------\n" << std::endl;
155 struct timeval start_time, end_time;
156 long int init_usecs, process_usecs, finish_usecs;
158 gettimeofday(&start_time,
nullptr);
165 std::cout <<
" ---------------------------------------------------------------------" << std::endl;
167 std::cout <<
" ---------------------------------------------------------------------" << std::endl;
172 gettimeofday(&end_time,
nullptr);
174 init_usecs = (end_time.tv_sec-start_time.tv_sec)*1000000+(end_time.tv_usec-start_time.tv_usec);
176 gettimeofday(&start_time,
nullptr);
182 gettimeofday(&end_time,
nullptr);
184 process_usecs = (end_time.tv_sec-start_time.tv_sec)*1000000+(end_time.tv_usec-start_time.tv_usec);
186 gettimeofday(&start_time,
nullptr);
202 Zoutput_volume_size, Youtput_volume_size, Xoutput_volume_size,artPrm.
threads);
210 gettimeofday(&end_time,
nullptr);
212 finish_usecs = (end_time.tv_sec-start_time.tv_sec)*1000000+(end_time.tv_usec-start_time.tv_usec);
214 std::cout <<
"INIT_TIME: " << (double)init_usecs/(
double)1000000 << std::endl;
215 std::cout <<
"PROCESS_TIME: " << (double)process_usecs/(
double)1000000 << std::endl;
216 std::cout <<
"FINISH_TIME: " << (double)finish_usecs/(
double)1000000 << std::endl;
Errors on command line parameters.
int numIMG
Total number of images to process (taking symmetries into account)
size_t projXdim
Projection X dimension.
void setIO(const FileName &fn_in, const FileName &fn_out)
Functions of common reconstruction interface.
Basis basis
Basis function. By default, blobs.
#define REPORT_ERROR(nerr, ErrormMsg)
void initHistory(const GridVolume &vol_basis0)
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
FileName fn_sel
Selection file with all images to process.
std::ofstream * fh_hist
File handler for the history file.
size_t projYdim
Projection Y dimension.
void changeToVoxels(GridVolume &vol_basis, MultidimArray< double > *vol_voxels, int Zdim, int Ydim, int Xdim, int threads=1) const
virtual void readParams(XmippProgram *program)
static void defineParams(XmippProgram *program, bool mpiMode=false)
virtual void postProcess(GridVolume &vol_basis)
ARTReconsBase * artRecons
virtual void preProcess(GridVolume &vol_basis0, int level=FULL, int rank=-1)
Produce Plain side information from the Class parameters.
void addExampleLine(const char *example, bool verbatim=true)
ARTParallelMode parallel_mode
int verbose
Verbosity level.
int no_it
Number of iterations.
void write(const FileName &fn) const
void iterations(GridVolume &vol_basis, int rank=-1)
static void defineParams(XmippProgram *program, const char *prefix=nullptr, const char *comment=nullptr)
bool checkParam(const char *param)
BasicARTParameters artPrm
void addUsageLine(const char *line, bool verbatim=false)
int threads
Number of threads to use. Can not be different than 1 when using MPI.
FileName fn_out
Name of the output volume, also used to set the root of rest output files.
void addParamsLine(const String &line)
Matrix1D< double > lambda_list
Relaxation parameter.