 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: bheight [options] input.img output.img",
25 "---------------------------------------------",
26 "Calculates 2D height images from a 3D map.",
29 "-axis y Project down a major axis (x, y, z or 0, 1, 2).",
30 "-View 0.3,-0.5,0.8,33 View to generate symmetry-related projections.",
31 "-Tilt -65,72,2.5,55 Tilt series of projections with angle min, max, step and axis angle.",
32 "-side 15 Generate side view projections within the given angle from the equator.",
33 "-random 24 Generate a number of random projections.",
36 "-verbose 7 Verbosity of output.",
37 "-datatype u Force writing of a new data type.",
38 "-origin 10,-10,20 Origin for rotation (voxels, default 0,0,0).",
39 "-sampling 2,3.5,1 Sampling (angstrom/voxel, a single value sets all three).",
40 "-symmetry D6 Symmetry: Point group identifier.",
41 "-angles 8,6 Step sizes for theta and phi in the asymmetric unit, one value sets both.",
42 "-threshold 1.2 Density threshold to indicate boundary of object (default 0).",
45 "-Plotviews plot.ps Output postscript file with a plot of projection vectors.",
50 int main(
int argc,
char **argv)
61 double ang_min(0), ang_max(0), ang_step(0), ang_axis(0);
74 for ( curropt = option; curropt; curropt = curropt->
next ) {
75 if ( curropt->
tag ==
"axis" )
76 if ( ( axis = curropt->
value[0] ) <
'a' )
77 cerr <<
"-axis: An axis for projection must be specified!" << endl;
78 if ( curropt->
tag ==
"datatype" )
80 if ( curropt->
tag ==
"origin" ) {
81 if ( curropt->
value[0] ==
'c' ) {
84 origin = curropt->
origin();
88 if ( curropt->
tag ==
"sampling" )
89 sam = curropt->
scale();
90 if ( curropt->
tag ==
"random" )
92 cerr <<
"-random: A number of views must be specified!" << endl;
93 if ( curropt->
tag ==
"symmetry" )
95 if ( curropt->
tag ==
"angles" ) {
96 if ( ( i = curropt->
values(theta_step, phi_step) ) < 1 )
97 cerr <<
"-angles: An angle step size must be specified!" << endl;
99 theta_step *=
M_PI/180.0;
100 if ( i < 2 ) phi_step = theta_step;
101 else phi_step *=
M_PI/180.0;
104 if ( curropt->
tag ==
"View" ) {
105 theview = curropt->
view();
106 symviews = ps_flag = 1;
108 if ( curropt->
tag ==
"Tilt" ) {
109 if ( curropt->
values(ang_min, ang_max, ang_step, ang_axis) < 3 )
110 cerr <<
"-Tilt: Three angles must be specified!" << endl;
112 ang_min *=
M_PI/180.0;
113 ang_max *=
M_PI/180.0;
114 ang_step *=
M_PI/180.0;
115 ang_axis *=
M_PI/180.0;
118 if ( curropt->
tag ==
"side" ) {
119 if ( ( side_ang = curropt->
value.
real() ) < 1 )
120 cerr <<
"-side: One angle must be specified!" << endl;
122 side_ang *=
M_PI/180.0;
124 if ( curropt->
tag ==
"threshold" )
125 if ( ( threshold = curropt->
value.
real() ) < 0 )
126 cerr <<
"-threshold: A positive value must be specified!" << endl;
127 if ( curropt->
tag ==
"Plotviews" )
140 }
else if ( side_ang > -1 ) {
141 views =
side_views(sym, side_ang, theta_step, phi_step);
142 }
else if ( ang_step ) {
143 views =
tilt_views(ang_min, ang_max, ang_step, ang_axis);
144 }
else if ( symviews ) {
146 }
else if ( theta_step && phi_step ) {
153 cout <<
"Generating " << nviews <<
" projections" <<endl << endl;
155 ps_views(ps_file, symmetry_string, views, ps_flag);
157 }
else if ( axis ==
'z' ) {
158 views =
new View(0,0,1,0);
159 }
else if ( axis ==
'y' ) {
160 views =
new View(0,1,0,0);
161 }
else if ( axis ==
'x' ) {
162 views =
new View(1,0,0,0);
167 if ( optind >= argc ) {
174 if ( optind < argc - 1 ) dataflag = 1;
177 if ( p == NULL )
bexit(-1);
195 if ( optind < argc ) {
A class for a command line input option.
Bimage * height(View *views, double threshold=0)
Calculates a set of height images from a 3D density map.
Vector3< double > scale()
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
Header file for general symmetry functions.
View * random_views(int nviews)
Calculates a set of random views.
int bexit(int value)
Exit function for cleanup and debugging.
Vector3< double > default_origin()
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.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
View * asymmetric_unit_views(Bsymmetry *sym, double theta_step, double phi_step, int flag)
Initializes a well-distributed set of views in an asymmetric unit.
Vector3< double > origin()
long count_list(char *list)
Counts the number of items in a linked list.
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.
Utilities for timing functions.
Bstring symmetry_string()
int ps_views(Bstring &filename, Bstring &symmetry_string, View *view, int flags)
Generates postscript plot of views on the unit sphere.
View * side_views(Bsymmetry *sym, double side_ang, double theta_step, double phi_step)
Initializes a set of views around the z-axis for helical projection.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
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 main(int argc, char **argv)
View * tilt_views(double ang_min, double ang_max, double ang_step, double axis)
Initializes a set of views tilted around the y axis.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Header file for generalized linked list functions.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
Header file for postscript tools dealing with views.