 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
23 "Usage: bhelix [options] input.img output.img",
24 "--------------------------------------------",
25 "Symmetrizes and projects images with helical symmetry.",
28 "-normalize Normalize symmetrized output, use for maps close to symmetry (default not).",
29 "-background Calculate new background values.",
30 "-project 20 Generate projections with this angular step size (over 360 degrees).",
31 "-kernel 6,2 Reciprocal space projection: kernel size and power.",
32 "-elliptical 37,5.5 Elliptical distortion: major axis angle and shift (pixels).",
33 "-rescale -0.1,5.2 Rescale data to average and standard deviation.",
35 "Actions for symmetrizing:",
36 "-helix 25.3,67.1,2 Symmetrize: Helical rise and angle, and dyad axis indicated by 2.",
37 " (default 10 angstrom, 45 degrees, no dyad axis).",
38 "-rule 237.5,-2,7 Symmetrize by selection rule: Helical repeat (angstrom), turns and subunits per repeat.",
39 "-super 25.3,67.1,22,15.5 Superhelix: Helical rise and angle, and offset in xy plane.",
40 "-seam 1.5 Symmetrize with the given subunit shift along the seam.",
42 "Actions for determining helical parameters:",
43 "-findrs 5,8,0.1,10,20,1 Find helical parameters in real space:",
44 " rise start, end and increment, rotation angle start, end and increment.",
45 "-findcc 10,22.4,1.5 Find helical parameters by cross-correlation:",
46 " rotation angle start, end and increment.",
47 "-segment 10,22.4,1.5,18 Correlate helical segments: rotation angle start,",
48 " end, increment and segment thickness.",
51 "-verbose 1 Verbosity of output.",
52 "-datatype u Force writing of a new data type.",
53 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
54 "-origin 110,50,44 Origin for helix (default 0,0,0 or from image).",
55 "-zlimits 8,47 Range of slices along the helical axis to use (default 0,inf).",
56 "-radius 22 Radial limit for symmetrization and finding parameters (default from image).",
57 "-resolution 15.6,200 Resolution limits for projection and cross-correlation (default 0).",
58 "-bin 2 Binning for finding parameters (default 1).",
61 "-Postscript file.ps Postscript output file name.",
66 int main(
int argc,
char **argv)
73 double helix_angle(0);
75 double helix_repeat(0);
76 int turns(0), subunits(0);
79 double project_angle(0);
82 double rise_start(0), rise_end(0);
84 double angle_start(0), angle_end(0);
88 double hires(0), lores(0);
89 double nuavg(0), nustd(0);
92 int calc_background(0);
94 int zmin(0), zmax(1000000);
96 double ell_angle(0), ell_shift(0);
102 for ( curropt = option; curropt; curropt = curropt->
next ) {
103 if ( curropt->
tag ==
"datatype" )
105 if ( curropt->
tag ==
"sampling" ) {
106 sam = curropt->
scale();
109 if ( curropt->
tag ==
"helix" ) {
110 if ( curropt->
values(helix_rise, helix_angle, dyad_axis) < 2 )
111 cerr <<
"-helix: Both rise and angle must be specified" << endl;
113 helix_angle *=
M_PI/180.0;
115 if ( curropt->
tag ==
"rule" )
116 if ( curropt->
values(helix_repeat, turns, subunits) < 3 )
117 cerr <<
"-rule: Repeat, turns and subunits must be specified" << endl;
118 if ( curropt->
tag ==
"super" ) {
119 if ( curropt->
values(helix_rise, helix_angle, offset[0], offset[1]) < 3 )
120 cerr <<
"-super: Rise, angle and offset must be specified" << endl;
122 helix_angle *=
M_PI/180.0;
124 if ( curropt->
tag ==
"seam" )
125 if ( ( seam_shift = curropt->
value.
real() ) < 0.1 )
126 cerr <<
"-seam: A unit shift must be specified" << endl;
127 if ( curropt->
tag ==
"project" ) {
128 if ( ( project_angle = curropt->
value.
real() ) < 0.1 )
129 cerr <<
"-project: A projection angle step must be specified" << endl;
131 project_angle *=
M_PI/180.0;
133 if ( curropt->
tag ==
"kernel" )
134 if ( curropt->
values(kernel_width, kernel_power) < 1 )
135 cerr <<
"-kernel: At least the kernel size must be specified!" << endl;
136 if ( curropt->
tag ==
"findcc" )
137 if ( curropt->
values(angle_start, angle_end, angle_step) < 3 )
138 cerr <<
"-findcc: All three angles must be specified" << endl;
139 if ( curropt->
tag ==
"findrs" ) {
142 cerr <<
"-findrs: All six rise and angle parameters must be specified" << endl;
152 if ( curropt->
tag ==
"segment" )
153 if ( curropt->
values(angle_start, angle_end, angle_step, thickness) < 4 )
154 cerr <<
"-segment: All three angles and a thickness must be specified!" << endl;
155 if ( curropt->
tag ==
"elliptical" ) {
156 if ( curropt->
values(ell_angle, ell_shift) < 2 )
157 cerr <<
"-elliptical: Both major axis angle and shift must be specified!" << endl;
159 ell_angle *=
M_PI/180.0;
161 if ( curropt->
tag ==
"rescale" )
162 if ( curropt->
values(nuavg, nustd) < 2 )
163 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
164 if ( curropt->
tag ==
"background" )
166 if ( curropt->
tag ==
"origin" ) {
167 if ( curropt->
value[0] ==
'c' ) {
170 origin = curropt->
origin();
174 if ( curropt->
tag ==
"zlimits" )
175 if ( curropt->
values(zmin, zmax) < 2 )
176 cerr <<
"-zlimits: Both limits on the helical axis must be specified" << endl;
177 if ( curropt->
tag ==
"normalize" )
179 if ( curropt->
tag ==
"radius" )
180 if ( ( radius = curropt->
value.
real() ) < 1 )
181 cerr <<
"-radius: A radius must be specified" << endl;
182 if ( curropt->
tag ==
"resolution" )
183 if ( curropt->
values(hires, lores) < 1 )
184 cerr <<
"-resolution: Resolution limits must be specified!" << endl;
185 if ( curropt->
tag ==
"bin" )
187 cerr <<
"-bin: A bin value must be specified!" << endl;
188 if ( curropt->
tag ==
"Postscript" )
193 angle_start *=
M_PI/180.0;
194 angle_end *=
M_PI/180.0;
195 angle_step *=
M_PI/180.0;
205 if ( kernel_width > 1 )
213 cerr <<
"Error: No input file!" << endl;
222 if ( set_sampling ) p->
sampling(sam);
226 if ( subunits > 0 ) {
227 helix_rise = helix_repeat*1.0L/subunits;
228 helix_angle =
TWOPI*turns*1.0L/subunits;
231 if ( helix_rise && helix_angle ) {
234 seam_shift, dyad_axis, zmin, zmax, radius, norm_flag);
236 dyad_axis, zmin, zmax, radius, norm_flag);
237 }
else if ( p->
sizeZ() > 1 && project_angle ) {
248 if ( angle_step > 0 ) {
249 if ( thickness > 0 ) {
251 angle_start, angle_end, angle_step,
252 find_bin, hires, lores, radius);
253 }
else if ( rise_step > 0 ) {
255 angle_start, angle_end, angle_step, find_bin, radius);
258 find_bin, hires, lores, radius);
269 if ( optind < argc ) {
A class for a command line input option.
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Vector3< double > scale()
Bplot * seamed_helix_symmetrize(double helix_rise, double helix_angle, double seam_shift, int dyad_axis, int zmin, int zmax, double radius, int norm_flag)
Symmetrizes an image given helical symmetry parameters and seam shift parameter.
double helix_symmetrize(double helix_rise, double helix_angle, int dyad_axis, int zmin, int zmax, double radius, int norm_flag=1)
Symmetrizes an image given helical symmetry parameters.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
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 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.
Bimage * project(char axis, int flags=1)
Projects a 3D image to a 2D image down one of the three major axes.
int distort_elliptically(double angle, double shift)
Transforms a tubular cylinder to an elliptical profile.
General image parameter class.
Utilities for timing functions.
vector< double > split_into_doubles(const Bstring &delim)
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.
Bplot * find_helix_parameters(double angle_start, double angle_end, double angle_step, int bin, double hires, double lores, double radius)
Finds the best helix parameters for helical map.
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)
int main(int argc, char **argv)
DataType
Base data type specifier.
double convert_to_helix(double helix_rise, double helix_angle, Vector3< double > offset)
Converts a map to a helix.
Bplot * helix_segment_correlation(int thickness, double angle_start, double angle_end, double angle_step, int bin, double hires, double lores, double radius)
Calculates the correlation over rotation angles between helical segments.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.