 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: bsymcomp [options] input.img output.img",
21 "----------------------------------------------",
22 "Finds the best orientation that fits a symmetrized template.",
23 "The output is the rotated input image.",
26 "-verbose 1 Verbosity of output",
27 "-datatype u Force writing of a new data type.",
28 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; default from input file; a single value can be given).",
29 "-origin 110,50,44 Origin for rotations of the template (default taken from template image).",
30 "-angles 8.8,2.5,5.2 Step size for alpha, theta and phi, one value sets all (default 45 degrees).",
31 "-shift 0.5,3,-2.3 Shift to apply before symmetrization.",
32 "-symmetry C5 Point group symmetry.",
33 "-fill 0.02 Fill value (default image background).",
36 "-Template image.map Template with symmetry to search for.",
42 int main(
int argc,
char** argv)
61 for ( curropt = option; curropt; curropt = curropt->
next ) {
62 if ( curropt->
tag ==
"datatype" )
64 if ( curropt->
tag ==
"sampling" )
65 sam = curropt->
scale();
66 if ( curropt->
tag ==
"origin" ) {
67 if ( curropt->
value[0] ==
'c' ) {
70 origin = curropt->
origin();
74 if ( curropt->
tag ==
"angles" ) {
75 if ( ( i = curropt->
values(alpha_step, theta_step, phi_step) ) < 1 )
76 cerr <<
"-angles: An angle step size must be specified" << endl;
78 if ( i < 2 ) phi_step = theta_step = alpha_step;
79 else if ( i < 3 ) phi_step = theta_step;
80 alpha_step *=
M_PI/180.0;
81 theta_step *=
M_PI/180.0;
82 phi_step *=
M_PI/180.0;
85 if ( curropt->
tag ==
"shift" )
87 if ( curropt->
tag ==
"symmetry" )
89 if ( curropt->
tag ==
"fill" )
90 fill = curropt->
fill(fill_type);
91 if ( curropt->
tag ==
"Template" )
102 cerr <<
"Error: No input file read!" << endl;
108 if ( template_file.
length() )
109 ptemp =
read_img(template_file, 1, 0);
112 cerr <<
"Error: No template file read!" << endl;
128 if ( set_origin == 2 ) {
146 phi_step, theta_step, alpha_step, shift);
149 if ( optind < argc ) {
A class for a command line input option.
Vector3< double > scale()
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.
double background(long nn)
Vector3< long > size() const
Header file for option handlers.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Vector3< double > origin()
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
General image parameter class.
double average(long cc, double xf, double yf, double zf, long nn, double iscale)
Averages in 3D when scaling is less than 1.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Vector3< double > vector3()
double fill(int &fill_type)
int main(int argc, char **argv)
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.
Header file for 2D and 3D image I/O.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
Bimage * find_symmetric_view(Bimage *ptemp, Bsymmetry *sym, double phi_step, double theta_step, double alpha_step, Vector3< double > shift)
Finds the view that on symmetrizing fits best to a symmetric template.