 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
22 "Usage: btomrec [options] input.star [input2.star]",
23 "-------------------------------------------------",
24 "Reconstructs a tomogram from an aligned tilt series in Fourier space.",
25 "Requires large amounts of disk space.",
28 "-removemarkers 14 Mask out markers with this radius (pixels) before reconstruction.",
29 "-rescale -0.1,5.2 Rescale data to average and standard deviation.",
30 "-slab 25,40 Reconstruct a slab of these slices (default all).",
31 "-transform 2D Back transform reconstruction: none (default), full, slices.",
34 "-verbose 7 Verbosity of output.",
35 "-datatype u Force writing of a new data type.",
36 "-sampling 1.5,1.5,1.5 Sampling of input images (A/pixel; a single value can be given).",
37 "-resolution 20 Resolution limit (angstrom, default Nyquist).",
38 "-scale 1.2 Scale or magnification of reconstruction compared to original images (default 1).",
39 "-size 100,120,90 Size of reconstruction (default from images).",
40 "-interpolation weighted Interpolation type: nearest (default), weighted, trilinear.",
41 "-pad 3 Image padding factor (default 2).",
42 "-edge 15 An edge smoothing width (default 0).",
43 "-fill 127 Fill value for erasing/painting markers (default average).",
44 "-CTF flip Apply CTF correction to images before reconstruction (default not).",
45 "-wiener 0.15 Wiener factor for CTF correction (default 0.2).",
48 "-reconstruction file.ext Reconstruction file name.",
49 "-output file.star Output STAR file name.",
54 int main(
int argc,
char **argv)
56 double marker_radius(0);
58 double nuavg(0), nustd(0);
61 int slab_start(0), slab_end(-1);
78 for ( curropt = option; curropt; curropt = curropt->
next ) {
79 if ( curropt->
tag ==
"removemarkers" )
80 if ( ( marker_radius = curropt->
value.
real() ) < 1 )
81 cerr <<
"-removemarkers: A marker radius must be specified!" << endl;
82 if ( curropt->
tag ==
"rescale" ) {
83 if ( curropt->
values(nuavg, nustd) < 2 )
84 cerr <<
"-rescale: Both average and standard deviation must be specified!" << endl;
86 cerr <<
"-rescale: A positive standard deviation must be specified!" << endl;
88 if ( curropt->
tag ==
"slab" )
89 if ( curropt->
values(slab_start, slab_end) < 1 )
90 cerr <<
"-slab: A slab size must be specified!" << endl;
91 if ( curropt->
tag ==
"transform" ) {
92 if ( curropt->
value[0] ==
'n' ) transform = 0;
93 if ( curropt->
value[0] ==
'f' ) transform = 1;
94 if ( curropt->
value[0] ==
's' ) transform = 2;
96 if ( curropt->
tag ==
"datatype" )
98 if ( curropt->
tag ==
"sampling" )
99 sam = curropt->
scale();
100 if ( curropt->
tag ==
"resolution" )
101 if ( ( resolution = curropt->
value.
real() ) < 0.1 )
102 cerr <<
"-resolution: A resolution limit must be specified!" << endl;
103 if ( curropt->
tag ==
"size" )
104 size = curropt->
size();
105 if ( curropt->
tag ==
"scale" )
106 if ( ( scale = curropt->
value.
real() ) < 0.001 )
107 cerr <<
"-scale: A scale must be specified!" << endl;
108 if ( curropt->
tag ==
"interpolation" ) {
110 if ( curropt->
value[0] ==
'n' ) interp_type = 0;
111 if ( curropt->
value[0] ==
'w' ) interp_type = 1;
112 if ( curropt->
value[0] ==
't' ) interp_type = 2;
114 if ( curropt->
tag ==
"pad" )
116 cerr <<
"-pad: An integer factor must be specified!" << endl;
117 if ( curropt->
tag ==
"edge" )
118 if ( ( edge_width = curropt->
value.
real() ) < 0 )
119 cerr <<
"-edge: An edge smoothing width must be specified!" << endl;
120 if ( curropt->
tag ==
"fill" )
121 fill = curropt->
fill(fill_type);
122 if ( curropt->
tag ==
"CTF" )
124 if ( curropt->
tag ==
"wiener" ) {
125 if ( ( wiener = curropt->
value.
real() ) < 0.000001 )
126 cerr <<
"-wiener: A Wiener factor must be specified!" << endl;
128 if ( wiener < 0.01 ) wiener = 0.01;
132 if ( curropt->
tag ==
"reconstruction" )
134 if ( curropt->
tag ==
"output" )
142 fftwf_init_threads();
151 while ( optind < argc )
string_add(&file_list, argv[optind++]);
153 cerr <<
"Error: No parameter files specified!" << endl;
161 cerr <<
"Error: No input file read!" << endl;
166 if ( sam[0] < 0.1 ) sam[0] = 1;
174 }
else if ( slab_end > 0 ) {
176 scale, size, slab_start, slab_end, marker_radius,
177 fill_type, fill, ctf_action, wiener);
180 scale, size, interp_type, pad_factor,
181 edge_width, marker_radius,
182 fill_type, fill, ctf_action, wiener);
191 cout <<
"Translating markers: " << trans << endl;
193 if ( transform == 1 ) {
195 cout <<
"Full Fourier transform" << endl;
197 }
else if ( transform == 2 ) {
199 cout <<
"Fourier transforming slices" << endl;
203 if ( prec && reconsfile.
length() ) {
207 cout <<
"Writing " << reconsfile << endl;
229 cout <<
"Writing " << outfile << endl;
237 fftwf_cleanup_threads();
A class for a command line input option.
int project_kill(Bproject *project)
Frees a whole project.
Bimage * project_tomo_reconstruct(Bproject *project, double hi_res, double scale, Vector3< long > size, int interp_type, int pad_factor, double edge_width, double marker_radius, int fill_type, double fill, int action, double wiener)
Reciprocal space reconstruction from the images in a multi-image file.
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
int main(int argc, char **argv)
size_t system_processors()
Returns the number of processors.
Vector3< double > voxel_size
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.
int marker_scale(Bmarker *markers, Vector3< double > scale)
Scaling markers.
Header file for option handlers.
Bimage * project_fourier_reconstruction_slab(Bproject *project, double hi_res, double scale, Vector3< long > size, int slab_start, int slab_end, double marker_radius, int fill_type, double fill, int action, double wiener)
Reciprocal space reconstruction from the images in a multi-image file.
long values(T1 &v1, T2 &v2)
Header file for reading and writing micrograph parameters.
void origin(double x, double y, double z)
int project_set_mg_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the micrographs.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
Vector3< double > change_transform_size(Vector3< long > nusize)
Resizes a "standard" transform.
int marker_shift(Bmarker *markers, Vector3< double > shift)
Shifting markers.
General image parameter class.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
double fill(int &fill_type)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Bmicrograph * field_find_zero_tilt_mg(Bfield *field)
Finds the micrograph closest to a zero degree tilt in a series.
void change_type(char letter)
Get the data type indicated by a single letter code.
Functions to do a tomographic reconstruction.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Vector3< double > pixel_size
DataType
Base data type specifier.
Breconstruction * reconstruction_add(Breconstruction **rec, Bstring &rec_id)
Adds a reconstruction parameter structure to a linked list.
Header file for functions to align micrographs or coordinates from micrographs and apply the resultan...
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
int img_backtransform_slices(Bimage *p)
Backtransforms 2D slices in a 3D volume.
Bimage * mg_tomo_reconstruct2D(Bproject *project, long dimg, Vector3< long > size, double scale, double hi_res)
Reconstructs the zero-tilt image of a tilt-series.
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.