 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: bftr [options] file.spi file.mrc",
21 "---------------------------------------",
22 "Resizing an image using Fourier transformation.",
25 "-scale 1.56 Isotropic scale (required to resize the data).",
26 "-translate 0.3,-4.1,3.3 Translation.",
27 "-bandpass 25.3,200 Bandpass filter: resolution limits (angstrom).",
28 "-filterextremes Remove extreme regions (such as micrograph labels)",
31 "-verbose 7 Verbosity of output",
32 "-datatype u Force writing of a new data type",
33 "-origin 0,-10,30 Set origin, used with -size option (default 0,0,0)",
34 "-size 22,33,14 New size (voxels, default from data)",
35 "-sampling 2,3.5,1 Sampling before rescaling (angstrom/voxel, a single value sets all three)",
38 "-reference ref.map Reference for resizing.",
43 int main(
int argc,
char **argv)
55 int filter_extremes(0);
61 for ( curropt = option; curropt; curropt = curropt->
next ) {
62 if ( curropt->
tag ==
"datatype" )
64 if ( curropt->
tag ==
"origin" ) {
65 if ( curropt->
value[0] ==
'c' ) {
68 origin = curropt->
origin();
72 if ( curropt->
tag ==
"scale" )
73 if ( ( scale = curropt->
value.
real() ) < 0.001 )
74 cerr <<
"-scale: A scale must be specified!" << endl;
75 if ( curropt->
tag ==
"translate" )
77 if ( curropt->
tag ==
"bandpass" ) {
78 if ( curropt->
values(res_hi, res_lo) < 1 )
79 cerr <<
"-bandpass: The resolution limits must be specified!" << endl;
81 if ( res_hi > res_lo ) swap(res_hi, res_lo);
83 if ( curropt->
tag ==
"size" )
84 size = curropt->
size();
85 if ( curropt->
tag ==
"sampling" )
86 sam = curropt->
scale();
87 if ( curropt->
tag ==
"filterextremes" )
89 if ( curropt->
tag ==
"reference" )
100 if ( ( p =
read_img(argv[optind++], 1, -1) ) == NULL ) {
101 cerr <<
"File not read!" << endl;
106 if ( ( pref =
read_img(reffile, 1, -1) ) == NULL ) {
107 cerr <<
"File " << reffile <<
" not read!" << endl;
118 if ( set_origin == 2 ) p->
origin(p->
size()/2);
123 if ( optind < argc ) {
124 if ( filter_extremes )
130 }
else if ( reffile.
length() ) {
A class for a command line input option.
Vector3< double > scale()
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.
Vector3< long > size() const
Header file for option handlers.
Vector3< double > origin()
int main(int argc, char **argv)
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 fspace_translate(Vector3< double > shift)
Translates an image in frequency space to avoid interpolation.
General image parameter class.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Vector3< double > vector3()
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 option_kill(Boption *option)
Deallocates a linked list of option structures.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
int fspace_resize(double scale, double res_hi, double res_lo)
Resizes an image in frequency space to avoid interpolation.
int filter_extremes()
Filters the extremes out of a micrograph image.
int resize(Vector3< long > nusize, Vector3< long > translate, int fill_type=0, double fill=0)
Resizes without interpolation or rescaling.