 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: bflat [options] input.img output.img",
25 "-------------------------------------------",
26 "Does phase extension by solvent flattening.",
27 "The amplitudes are defined in three possible mutually exclusive ways:",
28 "1. Derived from the input map (default).",
29 "2. Derived from a reference map.",
30 "3. Specified in an external amplitude map.",
33 "-symmetrize C5 Apply point group symmetry.",
36 "-verbose 7 Verbosity of output.",
37 "-datatype u Force writing of a new data type.",
38 "-resolution 35,15.5,1.5 Resolution limit start, end and step (default 30,20,1).",
39 "-iterations 80 Iterations (default 1).",
40 "-exit 0.1 Exit condition based on amplitude RMSD (default 0.01).",
41 "-output 5 Number of iterations between writing output maps (default 100).",
44 "-Reference file.map File to generate amplitudes from (default amplitudes from input map).",
45 "-Amplitudes file.map File with amplitudes (default amplitudes from input map).",
46 "-Mask mask.tif Mask file.",
51 int main (
int argc,
char **argv)
59 double hi_res(20), lo_res(30);
69 for ( curropt = option; curropt; curropt = curropt->
next ) {
70 if ( curropt->
tag ==
"symmetrize" )
72 if ( curropt->
tag ==
"datatype" )
74 if ( curropt->
tag ==
"resolution" )
75 if ( curropt->
values(lo_res, hi_res, step_res) < 1 )
76 cerr <<
"-resolution: A high resolution limit must be specified!" << endl;
77 if ( curropt->
tag ==
"iterations" )
79 cerr <<
"-iterations: A number of iterations must be specified!" << endl;
80 if ( curropt->
tag ==
"output" )
82 cerr <<
"-output: A number of iterations must be specified!" << endl;
83 if ( curropt->
tag ==
"exit" )
84 if ( ( Rtarget = curropt->
value.
real() ) < 1 )
85 cerr <<
"-exit: A target RMSD must be specified!" << endl;
86 if ( curropt->
tag ==
"Reference" )
88 if ( curropt->
tag ==
"Amplitude" )
90 if ( curropt->
tag ==
"Mask" )
98 if ( optind < argc - 1 ) dataflag = 1;
101 cerr <<
"Error: No input file read!" << endl;
105 if ( optind >= argc ) {
106 cerr <<
"Error: No output file specified!" << endl;
118 if ( maskfile.
length() ) {
119 pmask =
read_img(maskfile, dataflag, 0);
120 if ( pmask == NULL ) {
121 cerr <<
"Error: Mask file " << maskfile <<
" not read!" << endl;
130 pref =
read_img(reffile, dataflag, 0);
131 }
else if ( ampfile.
length() ) {
132 pamp =
read_img(ampfile, dataflag, 0);
137 if ( pref ) pref->
fft();
141 Bstring filename, outname(argv[optind]);
143 double res = lo_res, R = 1e37;
146 cout <<
"Iter\tRes\tRMSD" << endl;
147 for ( i=0; i<imax && R>Rtarget; i++ ) {
148 if ( res > hi_res ) res -= step_res;
163 cout << i+1 <<
tab << res <<
tab << R << endl;
171 if ( (i+1)%iout == 0 && (i+1) != imax ) {
180 if ( optind < argc ) {
A class for a command line input option.
double symmetrize(Bstring &symmetry_string, int flag)
double merge_amplitudes_and_phases(Bimage *pamp)
Merges the amplitudes from one map with the phases of another.
Bimage * copy()
Copies the header information and data of an image into a new image structure.
Header file for general symmetry functions.
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.
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.
double timer_start()
Starts timer and prints the time.
int fspace_bandpass(double res_hi, double res_lo=0, double width=0)
Applies a bandpass filter to an image.
Header file for general utilities.
ostream & tab(ostream &out)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
void change_type(char letter)
Get the data type indicated by a single letter code.
Header file for 2D and 3D image I/O.
int main(int argc, char **argv)
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int subtract_background()
Subtracts the background for each sub-image.
DataType
Base data type specifier.
long statistics()
Calculates the statistics for an image.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.