34 addUsageLine(
"Calculate the resolution of one or more volumes or images with respect to a single reference.");
38 addUsageLine(
"+* Differential Phase Residual (DPR)",
true);
39 addUsageLine(
"+In this method the the resolution is defined as the spatial frequency at which the average phase");
40 addUsageLine(
"+discrepancy between the two transforms exceeds 45 degrees.");
42 addUsageLine(
"+In this method the resolution is defined as the spatial frequency at which annular samplings of");
43 addUsageLine(
"+the two Fourier transforms register negligible cross-correlation.");
44 addUsageLine(
"+* Spectral Signal-to-Noise Ratio (SSNR)",
true);
45 addUsageLine(
"+This method is based on the measurement of the signal-to-noise ratio as a function of spatial");
46 addUsageLine(
"+frequency. The SSNR is determined by comparing the Fourier transform of individual images with ");
47 addUsageLine(
"+that of the global average image. (this option is only available for 2D images not for volumes,");
48 addUsageLine(
"+ see the program ssnr if you are interested in computing the signal to noise ratio in 3D).");
50 addUsageLine(
"+To calculate \"the resolution of a reconstruction\", use --set_of_images, where the program divides the");
51 addUsageLine(
"+corresponding set of projection images into two subsets and reconstructs two volumes from these subsets.");
52 addUsageLine(
"+This program may then be used to calculate the DPR and FRC between these two volumes. The resulting plots");
53 addUsageLine(
"+are commonly used to assess the high-resolution limit of the initial reconstruction (see Frank's book for more details).");
55 addUsageLine(
"The program writes out filename.frc files, for each input volume or image, or selfilename.frc, the");
56 addUsageLine(
"set_of_images mode. These ACSII files contain the DPR, FRC and SSNR as a function of resolution (in 1/Angstrom).");
57 addUsageLine(
" The .frc files also contain a column for the FRC expected for pure noise.");
59 addParamsLine(
" -i <input_file> : either an image/volume or a selection file");
61 addParamsLine(
"or --set_of_images <selfile> : selfile containing a set of 2D-images");
62 addParamsLine(
" [--oroot <root_file=\"\">] : Root of the output metadata. If not set, input file rootname is taken.");
63 addParamsLine(
" [-o <output_file=\"\">] : Output file name.");
65 addParamsLine(
" [--ref <input_file>] : filename for reference image/volume");
66 addParamsLine(
" [--sampling_rate <Ts=1>] : Pixel size (Angstrom)");
68 addParamsLine(
" [--dont_apply_geo] : for 2D-images: do not apply transformation stored in the header");
69 addParamsLine(
" [--do_dpr] : compute dpr, by default only frc is computed");
70 addParamsLine(
" [--max_sam <max_sr=-1>] : set fsc to 0 for frequencies above this one (Angstrom), -1 -> all fequencies");
71 addParamsLine(
" : --max_sam = 10A -> frequencies higher than 0.1 A^-1 =0");
73 addParamsLine(
" [--do_rfactor] : compute R-factor for input volumes");
74 addParamsLine(
" [--min_sam <min_sr=-1>] : minimum frequency may use for calculating R-factor (Angstrom)");
75 addParamsLine(
" : --min_sam = 10A -> frequencies smaller than 0.1 A^-1 =0");
77 addExampleLine(
"Resolution of subset2.vol volume with respect to subset1.vol reference volume using 5.6 pixel size (in Angstrom):",
false);
78 addExampleLine(
"xmipp_resolution_fsc --ref subset1.vol -i subset2.vol --sampling_rate 5.6 ");
79 addExampleLine(
"Resolution of a set of images using 5.6 pixel size (in Angstrom):",
false);
80 addExampleLine(
"xmipp_resolution_fsc --set_of_images selfile.sel --sampling_rate 5.6");
129 fn_frc = fnRoot +
".frc";
136 if(max_sam >0 && ((1./
dAi(freq,
i))<max_sam) )
162 fn_frc.
compose(
"rfactor", fn_frc);
173 refI().setXmippOrigin();
178 img().setXmippOrigin();
188 frc_dpr(refI(), img(),
sam, freq, frc, frc_noise, dpr, error_l2,
do_dpr,
do_rfactor, min_samp,
sam/
max_sam, &rFactor);
200 MDout.
write(fnRoot+
".frc");
double getDoubleParam(const char *param, int arg=0)
void writeFiles(const FileName &fnRoot, const MultidimArray< double > &freq, const MultidimArray< double > &frc, const MultidimArray< double > &frc_noise, const MultidimArray< double > &dpr, const MultidimArray< double > &error_l2, double max_sam, bool do_dpr, double rFactor)
#define REPORT_ERROR(nerr, ErrormMsg)
void compose(const String &str, const size_t no, const String &ext="")
void frc_dpr(MultidimArray< double > &m1, MultidimArray< double > &m2, double sampling_rate, MultidimArray< double > &freq, MultidimArray< double > &frc, MultidimArray< double > &frc_noise, MultidimArray< double > &dpr, MultidimArray< double > &error_l2, bool dodpr, bool doRfactor, double minFreq, double maxFreq, double *rFactor)
const FileName & name() const
const char * getParam(const char *param, int arg=0)
Incorrect argument received.
void addExampleLine(const char *example, bool verbatim=true)
#define FOR_ALL_ELEMENTS_IN_ARRAY1D(v)
bool checkParam(const char *param)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)