 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
22 "Usage: bcyl [options] input.img output.img",
23 "------------------------------------------",
24 "Unwraps an image to its cylindrical projection.",
27 "-symmetrize Symmetrizes a map cylindrically around the origin.",
28 "-unwrap 1.5 Unwraps an image to its cylindrical projection with the given angle.",
29 "-autocorrelate Autocorrelates the unwrapped map and outputs the autocorrelation map.",
30 "-rescale -0.1,5.2 Rescale data to average and standard deviation (after -truncate).",
31 "-shells Calculate cylindrical shells projecting along the y-axis.",
32 "-reslice yzx Reslice (switch axes) after unwrapping.",
35 "-verbose 7 Verbosity of output.",
36 "-datatype u Force writing of a new data type.",
37 "-origin 0,-10.5,30 Set the origin.",
38 "-resolution 4.5,130 Resolution range for correlation (default 0 - 1e6 angstrom).",
43 int main(
int argc,
char **argv)
47 double unwrap_angle(0);
51 double nuavg(0), nustd(0);
57 double hires(0), lores(1e6);
62 for ( curropt = option; curropt; curropt = curropt->
next ) {
63 if ( curropt->
tag ==
"symmetrize" ) symmetrize = 1;
64 if ( curropt->
tag ==
"unwrap" ) {
65 if ( ( unwrap_angle = curropt->
value.
real() ) < 0.1 )
66 cerr <<
"-unwrap: An angle must be specified!" << endl;
68 unwrap_angle *=
M_PI/180.0;
70 if ( curropt->
tag ==
"autocorrelate" ) autocorrelate = 1;
71 if ( curropt->
tag ==
"shells" ) shells = 1;
72 if ( curropt->
tag ==
"rescale" ) {
73 if ( curropt->
values(nuavg, nustd) < 2 )
74 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
77 if ( nustd <= 0 ) setrescale = 0;
79 if ( curropt->
tag ==
"reslice" ) {
81 cerr <<
"-reslice: The order of x, y and z must be specified!" << endl;
83 order = curropt->
value;
87 if ( curropt->
tag ==
"datatype" )
89 if ( curropt->
tag ==
"origin" ) {
90 if ( curropt->
value[0] ==
'c' ) {
93 origin = curropt->
origin();
97 if ( curropt->
tag ==
"resolution" )
98 if ( curropt->
values(hires, lores) < 1 )
99 cerr <<
"-resolution: A high resolution limit must be specified" << endl;
107 if ( p == NULL )
bexit(-1);
117 if ( unwrap_angle > 0 ) {
121 if ( autocorrelate ) {
129 if ( optind < argc ) {
131 if ( setreslice ) p->
reslice(order);
151 long i, x, y(0), z, z1, z2, zm, n, dz(10);
154 for ( n=0; n<p->
images(); n++ ) {
156 cout <<
"Image " << n+1 <<
":" << endl <<
"Angle\tz\tCC" << endl;
157 for ( x=0; x<p->
sizeX(); x++ ) {
159 for ( z=z1, zm=0, cc_max = p->
minimum(); z<z2; z++ ) {
160 i = p->
index(0, x, y, z, n);
167 z1 = (zm > dz)? zm - dz: 0;
A class for a command line input option.
Bimage * symmetrize_cylinder(int flag)
Calculates a cylindrically symmetrized map.
void reslice(const char *order)
int cylindrical_shells()
Calculates an image with slices representing cylindrical shell projections.
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.
Vector3< double > origin()
int main(int argc, char **argv)
Bimage * cartesian_to_cylindrical(long nannuli, long nphi, int flag=0)
Calculates an image with cylindrical coordinates.
long values(T1 &v1, T2 &v2)
int img_plot_max_vs_angle(Bimage *p)
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.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
ostream & tab(ostream &out)
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.
long index(long nx, long ny) const
Header file for 2D and 3D image I/O.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
int auto_correlate(double hires, double lores)
Calculates an autocorrelation map by Fast Fourier transformation.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.