 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: bsym [options] in.img out.img",
27 "------------------------------------",
28 "Analyzes for and applies point group symmetry to images.",
29 "Generates symmetry axes for point group symmetries.",
32 "-invert Invert density in the image.",
33 "-rescale -0.1,5.2 Rescale symmetrized data to average and standard deviation.",
34 "-axis 3,1 Rotate to desired axis, with flag for alternate (requires -symmetry).",
35 "-handedness 1.4 Check handedness above threshold (density is positive).",
36 "-check C,D,I Check symmetry in correctly oriented map.",
37 "-find 1.5,2,1 Find orientation: angle step, binning, and",
38 " flag to skip major axis (use with -symmetry).",
39 "-change C5,C6 Change point group symmetry.",
40 "-Views Output all symmetry-related views, (filename: out_??.img).",
41 "-asu 3 Output a single or multi-level mask of asymmetric units (use with -symmetry).",
42 " > 0, generate the corresponding asymetric unit.",
43 " == 0, generate all asymetric units.",
44 "-edge oval Apply an edge smoothing of the indicated type.",
45 "-replicate Replicate the asymmetric unit (use with -symmetry).",
46 "-nonorm Do not normalize after symmetrization (use with -symmetry).",
47 "-show Show operational symmetry matrices (use with -symmetry).",
48 "-pdb Show PDB symmetry matrices (use with -symmetry).",
51 "-verbose 7 Verbosity of output.",
52 "-datatype f Force writing of a new image data type.",
53 "-origin 0,22.5,30 Set the origin for rotation.",
54 "-reference 0,1.5,-0.2,35 Reference symmetry axis and rotation angle (default 0,0,1,0).",
55 "-resolution 15.6,200 Resolution limits for cross-correlation (default 0).",
56 "-symmetry C5 Point group symmetry.",
57 "-fill 0.02 Fill value (default image background).",
58 "-radius 34.5,1.2 Radius in voxels of repeats for changing symmetry.",
59 " and slope along z to adjust the radius.",
62 "-Template temp.pif Template to find symmetry equivalent.",
63 "-mask mask.mrc Mask (must be the same size as the template).",
66 "-Parameters out.star Output STAR file with symmetry axes and orders.",
71 int main(
int argc,
char **argv)
76 double nuavg(0), nustd(0);
77 long axis(0), axis_flag(0);
87 double hires(0), lores(0);
93 int write_all_views(0);
95 double hand_threshold(0);
107 for ( curropt = option; curropt; curropt = curropt->
next ) {
108 if ( curropt->
tag ==
"datatype" )
110 if ( curropt->
tag ==
"invert" )
112 if ( curropt->
tag ==
"rescale" )
113 if ( curropt->
values(nuavg, nustd) < 2 )
114 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
115 if ( curropt->
tag ==
"axis" )
116 if ( curropt->
values(axis, axis_flag) < 1 )
117 cerr <<
"-axis: An axis order must be specified!" << endl;
118 if ( curropt->
tag ==
"check" ) check_sym = curropt->
value;
119 if ( curropt->
tag ==
"find" ) {
120 if ( curropt->
values(find_angle, find_bin, flags) < 1 )
121 cerr <<
"-find: An angle step size must be specified!" << endl;
123 find_angle *=
M_PI/180.0;
125 if ( curropt->
tag ==
"change" ) {
129 if ( curropt->
tag ==
"origin" ) {
130 if ( curropt->
value[0] ==
'c' ) {
133 origin = curropt->
origin();
137 if ( curropt->
tag ==
"reference" )
138 ref_view = curropt->
view();
139 if ( curropt->
tag ==
"resolution" )
140 if ( curropt->
values(hires, lores) < 1 )
141 cerr <<
"-resolution: Resolution limits must be specified!" << endl;
142 if ( curropt->
tag ==
"symmetry" )
144 if ( curropt->
tag ==
"fill" )
145 fill = curropt->
fill(fill_type);
146 if ( curropt->
tag ==
"Views" )
148 if ( curropt->
tag ==
"asu" )
150 cerr <<
"-asu: An asymmetric unit index must be specified!" << endl;
151 if ( curropt->
tag ==
"edge" ) {
153 cerr <<
"-edge: An edge shape must be specified." << endl;
155 if ( tolower(curropt->
value[0]) ==
'r' ) setedge = 0;
156 if ( tolower(curropt->
value[0]) ==
'o' ) setedge = 1;
157 if ( tolower(curropt->
value[0]) ==
'c' ) setedge = 2;
160 if ( curropt->
tag ==
"replicate" )
162 if ( curropt->
tag ==
"nonorm" )
164 if ( curropt->
tag ==
"show" )
show |= 1;
165 if ( curropt->
tag ==
"pdb" )
show |= 2;
166 if ( curropt->
tag ==
"handedness" ) {
167 if ( ( hand_threshold = curropt->
value.
real() ) )
168 cerr <<
"-handedness: A density threshold must be specified!" << endl;
172 if ( curropt->
tag ==
"radius" )
173 if ( curropt->
values(radius, z_slope) < 1 )
174 cerr <<
"-radius: A radius in voxels must be specified!" << endl;
175 if ( curropt->
tag ==
"Template" )
177 if ( curropt->
tag ==
"mask" )
179 if ( curropt->
tag ==
"Parameters" )
195 if ( hand_flag || optind < argc - 1 ) dataflag = 1;
196 if ( optind < argc ) {
197 p =
read_img(argv[optind++], dataflag, -1);
199 cerr <<
"Error: File \"" << argv[optind-1] <<
"\" was not read!" << endl;
206 if ( setinvert ) p->
invert();
217 if ( set_origin == 2 ) p->
origin(p->
size()/2);
222 if ( tempfile.
length() ) {
225 cerr <<
"Error:File \"" << tempfile <<
"\" was not read!" << endl;
235 if ( optind < argc ) {
236 filename = argv[optind];
238 if ( check_sym.
length() ) {
242 if ( write_all_views ) {
244 filename, nudatatype, nuavg, nustd);
246 if ( asu_mask >= 0 ) {
250 }
else if ( find_angle > 0 ) {
252 }
else if ( replicate > 0 ) {
254 }
else if ( symnu ) {
257 }
else if ( axis > 0 ) {
259 }
else if ( ptemp ) {
311 for ( i=1, v=view; v; v=v->
next, i++ ) {
A class for a command line input option.
Header file for reading and writing symmetry operators.
double symmetrize(Bstring &symmetry_string, int flag)
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
int main(int argc, char **argv)
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
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.
double background(long nn)
Vector3< long > size() const
int write_pointgroup(Bstring &filename, Bstring &symmetry_string, View ref_view)
Writing point group symmetry operators.
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.
int replicate_asymmetric_unit(Bsymmetry *sym)
Calculates a full map from one asymmetric unit.
int sym_show_pdb_matrices(Bsymmetry *sym)
Show PDB format symmetry matrices associated with each symmetry operator.
int rotate()
Rotates an image using parameters defined in the image in place.
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.
Bimage * levelmask_asymmetric_units(Bsymmetry *sym, int index)
Calculates a multi-level mask to indicate asymmetric units.
double find_point_group(Bsymmetry *sym, double angle_step, int binfac, double hires, double lores, int flags)
Finds the orientation for an image with a specific point group symmetry.
int change_symmetry(Bsymmetry *symold, Bsymmetry *symnu, double radius, double z_slope)
Changes the symmetry order for cyclic and dihedral maps.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
double check_point_group(Bstring &check_string)
Checks for the requested symmetries.
Matrix3 symmetry_equivalent(Bimage *ptemp, Bimage *pmask, Bsymmetry *sym)
Finds the symmetry equivalent orientation of a particle with respect to a template.
double fill(int &fill_type)
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 sym_show_operational_matrices(Bsymmetry *sym)
Show symmetry matrices associated with each symmetry operator.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Header file for generalized linked list functions.
long rotate_to_axis(Bsymmetry *sym, long axis, long axis_flag)
Rotates to a symmetry axis.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int img_write_symmetry_views(Bimage *p, Bsymmetry *sym, View ref_view, Bstring &filename, DataType datatype, double avg, double std)
Rotates an image to all symmetry-related views and writes out the resultant images.
void invert()
Inverts the data in the image.
DataType
Base data type specifier.
int edge(int type, Vector3< long > rect, Vector3< double > start, double width, int fill_type=0, double fill=0)
Smooths the image edge with a soft rectangular function.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.