 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
22 "Usage: btomres [options] input.star [input2.star]",
23 "-------------------------------------------------",
24 "Program to determine the resolution of micrographs in a tilt series.",
25 "If the -micrograph option is used, only one micrograph will be processed",
26 "and the postscript file will contain the FSC plot."
27 "If the -micrograph option is not used, the whole tilt series will be",
28 "processed and the postrscript file will contain a plot of the tilt angle",
29 "versus the resolution, as well as a second plot, the NLOO3D FSC curve."
32 "-verbose 7 Verbosity of output.",
33 "-datatype u Force writing of a new data type.",
34 "-sampling 1.5,1.5,1.5 Sampling of input images (A/pixel; a single value can be given).",
35 "-resolution 20 Resolution limit (angstrom, default Nyquist).",
36 "-ratio 2.5 Radial sampling to Cartesian sampling ratio (default 1).",
37 "-scale 1.2 Scale or magnification of reconstruction compared to original images (default 1).",
38 "-size 100,120,90 Size of reconstruction (default from images).",
39 "-cutoff 0.3 Resolution cutoff for FRC (default 0.5).",
40 "-micrograph 56 Micrograph number to use for the resolution test (first = 0).",
41 "-fast 10 Fast mode, only use micrographs within the given angle from the selected one (default all).",
42 "-CTF flip Apply CTF correction to images before reconstruction (default not).",
43 "-wiener 0.15 Wiener factor for CTF correction (default 0.2).",
46 "-output file.star Output parameter file name.",
47 "-reconstruction file.mrc Output 2D reconstruction file name.",
48 "-Postscript file.ps Postscript output filename.",
53 int main(
int argc,
char **argv)
60 double sampling_ratio(1);
63 double fast_angle(
M_PI);
73 for ( curropt = option; curropt; curropt = curropt->
next ) {
74 if ( curropt->
tag ==
"datatype" )
76 if ( curropt->
tag ==
"sampling" )
77 sam = curropt->
scale();
78 if ( curropt->
tag ==
"resolution" )
79 if ( ( resolution = curropt->
value.
real() ) < 0.1 )
80 cerr <<
"-resolution: A positive resolution limit must be specified!" << endl;
81 if ( curropt->
tag ==
"ratio" )
82 if ( ( sampling_ratio = curropt->
value.
real() ) < 1 )
83 cerr <<
"-ratio: A ratio must be specified!" << endl;
84 if ( curropt->
tag ==
"resolution" )
85 if ( ( resolution = curropt->
value.
real() ) < 0.1 )
86 cerr <<
"-resolution: A positive resolution limit must be specified!" << endl;
87 if ( curropt->
tag ==
"size" )
88 size = curropt->
size();
89 if ( curropt->
tag ==
"scale" )
90 if ( ( scale = curropt->
value.
real() ) < 0.1 )
91 cerr <<
"-scale: A scale must be specified!" << endl;
92 if ( curropt->
tag ==
"cutoff" )
93 if ( ( cutoff = curropt->
value.
real() ) < 0.01 )
94 cerr <<
"-cutoff: A cuttoff must be specified!" << endl;
95 if ( curropt->
tag ==
"micrograph" )
97 cerr <<
"-micrograph: A micrograph number must be specified!" << endl;
98 if ( curropt->
tag ==
"fast" ) {
99 if ( ( fast_angle = curropt->
value.
real() ) < 0.1 )
100 cerr <<
"-fast: An angle must be specified!" << endl;
102 fast_angle *=
M_PI/180.0;
104 if ( curropt->
tag ==
"CTF" )
106 if ( curropt->
tag ==
"wiener" ) {
107 if ( ( wiener = curropt->
value.
real() ) < 0.000001 )
108 cerr <<
"-wiener: A Wiener factor must be specified!" << endl;
110 if ( wiener < 0.01 ) wiener = 0.01;
114 if ( curropt->
tag ==
"output" )
116 if ( curropt->
tag ==
"reconstruction" )
118 if ( curropt->
tag ==
"Postscript" )
127 while ( optind < argc )
string_add(&file_list, argv[optind++]);
129 cerr <<
"Error: No parameter files specified!" << endl;
137 cerr <<
"Error: No input file read!" << endl;
151 Bstring title(
"Micrograph resolution for a tilt series");
155 scale, size, fast_angle, ctf_action, wiener, cutoff, ps_file);
157 for ( mg = field->
mg, i=0; mg; mg = mg->
next, i++ )
158 if ( i == mg_num ) mg_res = mg;
161 if ( prec && recfile.
length() ) {
169 mg_res->
fmg = recfile;
179 resolution, sampling_ratio, scale, size,
180 fast_angle, ctf_action, wiener, cutoff);
A class for a command line input option.
vector< Bplot * > project_tomo_resolution(Bproject *project, double hi_res, double sampling_ratio, double scale, Vector3< long > size, double fast_angle, int action, double wiener, double cutoff)
Estimating the resolution of the tomogram from an aligned tilt series.
int project_kill(Bproject *project)
Frees a whole project.
int main(int argc, char **argv)
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
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.
Functions to assess the resoltion of a tomographic tilt series.
Header file for reading and writing micrograph parameters.
void origin(double x, double y, double z)
int project_set_mg_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the micrographs.
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.
double timer_start()
Starts timer and prints the time.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
Bimage * mg_tomo_resolution(Bproject *project, int micrograph_id, double hi_res, double sampling_ratio, double scale, Vector3< long > size, double fast_angle, int action, double wiener, double cutoff, Bstring &psfile)
Estimating the resolution of one micrograph in an aligned tilt series.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
void origin(double ox, double oy, double oz)
void change_type(char letter)
Get the data type indicated by a single letter code.
Functions to do a tomographic reconstruction.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
DataType
Base data type specifier.
int phase_shift_to_center()
Phase shifts a set of reflections to the nominal center of the image origin.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
long statistics()
Calculates the statistics for an image.