 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
21 "Usage: bresolve [options] input1.img input2.img",
22 "-----------------------------------------------",
23 "Determines the resolution (FSC and DPR) from two images.",
26 "-rescale -0.1,5.2 Rescale data to average and standard deviation.",
27 "-variancemask 45 Mask from local variance of reference with given kernel size.",
30 "-verbose 7 Verbosity of output.",
31 "-sampling 1.5,1.5,1.5 Sampling (angstrom/pixel, a single value sets all three).",
32 "-resolution 15 Resolution limit for output (angstrom).",
33 "-aligned 25 Resolution limit for alignment (angstrom).",
34 "-fsccut 0.8,0.5,0.143 Resolution cutoffs for FSC.",
35 "-dprcut 45,70 Resolution cutoffs for DPR.",
36 "-ratio 2.5 Radial sampling to Cartesian sampling ratio (default 1).",
39 "-map file.map 3D reference file name.",
40 "-mask mask.tif Real space mask (same size as reference).",
43 "-output file.star Output STAR format file.",
44 "-Postscript file.ps Postscript output filename.",
45 "-XML file.xml XML output filename.",
46 "-tsv file.tsv Tab-separated values output filename.",
51 int main(
int argc,
char* argv[])
54 double nuavg(0), nustd(0);
58 double aligned_res(0);
59 double fsccut[4] = {0.3,0,0,0};
60 double dprcut[4] = {0,0,0,0};
61 double sampling_ratio(1);
71 for ( curropt = option; curropt; curropt = curropt->
next ) {
72 if ( curropt->
tag ==
"rescale" )
73 if ( curropt->
values(nuavg, nustd) < 2 )
74 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
75 if ( curropt->
tag ==
"variancemask" )
77 cerr <<
"-variancemask: A kernel edge size must be specified!" << endl;
78 if ( curropt->
tag ==
"sampling" )
79 sam = curropt->
scale();
80 if ( curropt->
tag ==
"resolution" )
81 if ( ( hi_res = curropt->
value.
real() ) < 1 )
82 cerr <<
"-resolution: A resolution must be specified!" << endl;
83 if ( curropt->
tag ==
"aligned" )
84 if ( ( aligned_res = curropt->
value.
real() ) < 1 )
85 cerr <<
"-aligned: A resolution must be specified!" << endl;
86 if ( curropt->
tag ==
"fsccut" )
87 if ( curropt->
values(fsccut[0], fsccut[1], fsccut[2], fsccut[3]) < 1 )
88 cerr <<
"-fsccut: At least one FSC threshold must be specified!" << endl;
89 if ( curropt->
tag ==
"dprcut" )
90 if ( curropt->
values(dprcut[0], dprcut[1], dprcut[2], dprcut[3]) < 1 )
91 cerr <<
"-dprcut: A DPR threshold must be specified!" << endl;
92 if ( curropt->
tag ==
"ratio" )
93 if ( ( sampling_ratio = curropt->
value.
real() ) < 0.1 )
94 cerr <<
"-ratio: A ratio must be specified!" << endl;
95 if ( curropt->
tag ==
"map" )
97 if ( curropt->
tag ==
"mask" )
98 real_mask_file = curropt->
filename();
99 if ( curropt->
tag ==
"Postscript" )
101 if ( curropt->
tag ==
"XML" )
103 if ( curropt->
tag ==
"tsv" )
111 fftwf_init_threads();
120 if ( map_file.
length() < 1 ) map_file = argv[optind++];
125 cerr <<
"Error: The number of images should match!" << endl;
135 if ( real_mask_file.
length() ) {
136 pmask =
read_img(real_mask_file, 1, 0);
137 }
else if ( var_kernel > 1 ) {
154 if ( pc->
images() == 1 ) {
155 plot = pc->
fsc_dpr(hi_res, sampling_ratio, (dprcut[0] == 0));
158 plot = pc->
fsc(hi_res, sampling_ratio);
171 fftwf_cleanup_threads();
A class for a command line input option.
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Vector3< double > scale()
Bplot * fsc_dpr(double hi_res, double sampling_ratio=1, int flag=0)
Calculates an FSC and DPR curves from two images.
size_t system_processors()
Returns the number of processors.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
void resolution_display(double *fsccut=NULL, double *dprcut=NULL)
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
void multiply(long j, Complex< double > cv)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
General image parameter class.
Utilities for timing functions.
void xml_write_fsc(Bstring &filename, Bplot *plot)
Bimage * resolution_prepare(Bimage *p)
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Bplot * fsc(double hi_res, double sampling_ratio=1)
void write_tsv(Bstring &filename)
int main(int argc, char *argv[])
Header file for 2D and 3D image I/O.
Bimage * variance_mask(long kernel_size, double lowvar=1e-6, int bkg_flag=0)
Calculates a mask based on local variance.
int filter_average(long kernel_size)
Applies an averaging filter to an image.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Library routines to read and write FSC curves.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.