 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
22 "Usage: bradsec [options] input.img output.img",
23 "---------------------------------------------",
24 "Generates symmetry-adjusted radial sections from 3D images.",
25 "The symmetry for O must be either O-3 or O-4.",
26 "The symmetry for I must be either I-3 or I-5.",
29 "-verbose 7 Verbosity of output.",
30 "-datatype u Force writing of a new data type.",
31 "-sampling 1.5,1.5,1.5 Sampling (default from image; a single value can be given).",
32 "-origin 0,-10,30 Set the origin for radial profile (default image origin).",
33 "-radii 14,123,2.68 Start, end and step size for radial shell calculation (default from input).",
34 "-symmetry C5 Point group symmetry.",
35 "-fraction 0.3 Spherical fraction (1=spherical shells, 0=symmetry-related shells).",
36 "-fill 127 Fill value for excluded region: average (default), background, or value.",
39 "-Postscript radsec.ps Symmetry-adjusted profile.",
44 int main(
int argc,
char **argv)
51 double rad_start(0), rad_end(0);
54 double spherical_fraction(0);
63 for ( curropt = option; curropt; curropt = curropt->
next ) {
64 if ( curropt->
tag ==
"datatype" )
66 if ( curropt->
tag ==
"origin" ) {
67 if ( curropt->
value[0] ==
'c' ) {
70 origin = curropt->
origin();
74 if ( curropt->
tag ==
"sampling" )
75 sam = curropt->
scale();
76 if ( curropt->
tag ==
"radii" )
77 if ( curropt->
values(rad_start, rad_end, rad_step) < 2 )
78 cerr <<
"-radii: A range and step size must be specified!" << endl;
79 if ( curropt->
tag ==
"symmetry" )
81 if ( curropt->
tag ==
"fraction" )
82 if ( ( spherical_fraction = curropt->
value.
real() ) <= 0 )
83 cerr <<
"-fraction: A fraction must be specified!" << endl;
84 if ( curropt->
tag ==
"fill" )
85 fill = curropt->
fill(fill_type);
86 if ( curropt->
tag ==
"Postscript" )
95 cerr <<
"Error: No input file read!" << endl;
100 if ( optind < argc ) outfile = argv[optind];
106 if ( set_origin == 2 ) p->
origin(p->
size()/2);
112 Bimage* prad = p->
radial_sections(rad_start, rad_end, rad_step, spherical_fraction, sym, fill_type, fill);
114 cerr <<
"Error: No output image generated!" << endl;
119 Bstring title =
"Symmetry-adjusted radial average: " + sym->
label;
155 for ( i=1; i<ncol; ++i ) {
166 for ( i=0; i<plot->
rows(); ++i )
169 for ( i=0, k=plot->
rows(); i<p->data_size(); ++i, ++k )
170 (*plot)[k] = (*p)[i];
A class for a command line input option.
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Vector3< double > scale()
int bexit(int value)
Exit function for cleanup and debugging.
int main(int argc, char **argv)
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Vector3< long > size() const
Header file for option handlers.
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 * radial_symmetry_adjusted(double rad_start, double rad_end, double rad_step, double spherical_fraction, Bsymmetry *sym)
Calculates the symmetry-adjusted radial average of an image.
General image parameter class.
Utilities for timing functions.
Bimage * radial_sections(double rad_start, double rad_end, double rad_step, double spherical_fraction, Bsymmetry *sym, int fill_type=FILL_USER, double fill=0)
Calculates an image with slices giving the radial section projections.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
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 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.
Bplot * img_plot_radial(Bimage *p, Bstring &title)