 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: bscale [options] input.pif output.map",
21 "--------------------------------------------",
22 "Scales a map with respect to a reference.",
25 "-bin 3 Bin the images before comparison.",
26 "-average 7 Averaging/smoothing filter: kernel size.",
27 "-symmetry C5 Find point group symmetry equivalent.",
28 "-fit Fit the map to the reference.",
29 "-rescale -0.1,5.2 Rescale data to average and standard deviation.",
32 "-verbose 7 Verbosity of output.",
33 "-datatype u Force writing of a new data type.",
34 "-origin 0.8,-10,15.7 Set the origin (default from input image).",
35 "-sampling 1.5,1.5,1.5 Dimension scaling (default 1,1,1 A/pixel).",
36 "-range 0.95,1.08,0.01 Scaling range and step size (default 0.99,1.01,0.01).",
39 "-reference temp.map Reference map to scale to.",
40 "-mask mask.mrc Mask (must be the same size as the reference).",
45 int main(
int argc,
char **argv)
51 double nuavg(0), nustd(0);
56 long average_kernel(0);
57 double smin(0.99), smax(1.01);
65 for ( curropt = option; curropt; curropt = curropt->
next ) {
66 if ( curropt->
tag ==
"bin" )
68 cerr <<
"-bin: The kernel edge size must be specified!" << endl;
69 if ( curropt->
tag ==
"symmetry" )
71 if ( curropt->
tag ==
"fit" ) fit = 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;
76 cerr <<
"-rescale: A positive standard deviation 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 ==
"average" )
92 cerr <<
"-average: The kernel edge size must be specified!" << endl;
93 if ( curropt->
tag ==
"range" )
94 if ( curropt->
values(smin, smax, step) < 2 )
95 cerr <<
"-range: Minimum and maximum scales must be specified!" << endl;
96 if ( curropt->
tag ==
"reference" )
98 if ( curropt->
tag ==
"mask" )
116 else if ( set_origin ) p->
origin(origin);
135 if ( sym && sym->
point > 101 && sym->
point != 432 ) {
160 if ( argc > optind ) {
A class for a command line input option.
Bimage * scale_to_same_size(Bimage *pref)
Scales and image to the given reference.
Vector3< double > scale()
int bexit(int value)
Exit function for cleanup and debugging.
Bimage * scale_to_reference(Bimage *pref, Bimage *pmask, double scalemin, double scalemax, double step)
Scales and image to the given reference, searching for the correct scale.
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()
Bimage * bin_around_origin(int bin)
Bins by an integer size making sure the origin falls on a binned voxel, and returns a new image.
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
void origin(double x, double y, double z)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int rotate()
Rotates an image using parameters defined in the image in place.
General image parameter class.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Matrix3 symmetry_equivalent(Bimage *ptemp, Bimage *pmask, Bsymmetry *sym)
Finds the symmetry equivalent orientation of a particle with respect to a template.
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 filter_average(long kernel_size)
Applies an averaging filter to an image.
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 main(int argc, char **argv)
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.