 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: brecadd [options] input.star [input.star]",
27 "------------------------------------------------",
28 "Averages reconstructions or subvolumes of reconstructions based on",
29 "the selection in parameter files.",
32 "-all Reset selection to all particles before other selections.",
33 "-group 3022 Select particles belonging to this group.",
34 "-setnumber 3 Select given selection number and set others to zero.",
35 "-multiple 2 Generate a number of maps from alternating particle images (default 1).",
36 "-size 50,50,70 Specify a size to extract new particles from a map.",
37 "-resolution 15 Specify a resolution to do a reciprocal space summation.",
38 "-std Output standard deviation image rather than variance image.",
39 "-symmetry C5 Apply point group symmetry after reconstruction.",
40 "-rescale -0.1,5.2 Rescale output images to average and standard deviation.",
43 "-verbose 7 Verbosity of output.",
44 "-datatype u Force writing of a new data type.",
45 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; default from input file; a single value can be given).",
48 "-output file.star Output parameter file.",
49 "-average output.img Output image (default avg.map).",
50 "-fom fom.img Output variance/standard deviation image (default fom.map).",
55 int main(
int argc,
char **argv)
63 double nuavg(0), nustd(0);
76 for ( curropt = option; curropt; curropt = curropt->
next ) {
77 if ( curropt->
tag ==
"all" ) reset = 1;
78 if ( curropt->
tag ==
"group" )
80 cerr <<
"-group: A group must be specified!" << endl;
81 if ( curropt->
tag ==
"setnumber" )
83 cerr <<
"-setnumber: A selection number must be specified!" << endl;
84 if ( curropt->
tag ==
"multiple" )
86 cerr <<
"-multiple: The number of maps must be specified!" << endl;
87 if ( curropt->
tag ==
"datatype" )
89 if ( curropt->
tag ==
"rescale" )
90 if ( curropt->
values(nuavg, nustd) < 2 )
91 cerr <<
"-rescale: Both average and standard deviation must be specified" << endl;
92 if ( curropt->
tag ==
"size" )
93 size = curropt->
size();
94 if ( curropt->
tag ==
"resolution" )
95 if ( ( resolution = curropt->
value.
real() ) < 0.1 )
96 cerr <<
"-resolution: The resolution must be specified!" << endl;
97 if ( curropt->
tag ==
"std" ) calcfom += 1;
98 if ( curropt->
tag ==
"sampling" )
99 sam = curropt->
scale();
100 if ( curropt->
tag ==
"symmetry" )
102 if ( curropt->
tag ==
"average" )
104 if ( curropt->
tag ==
"output" )
106 if ( curropt->
tag ==
"fom" ) {
113 if ( avgfile.
length() < 3 ) {
114 cerr <<
"Error: No output map file name specified!" << endl;
122 while ( optind < argc )
string_add(&file_list, argv[optind++]);
124 cerr <<
"Error: No parameter files specified!" << endl;
132 cerr <<
"Error: No input file read!" << endl;
152 for ( n=1; n<=nmaps; n++ ) {
153 if ( nmaps > 1 ) set_number = n;
154 if ( resolution > 0 )
159 cerr <<
"Error: No average calculated!" << endl;
163 if ( sym && sym->
point > 101 ) {
165 cout <<
"Applying symmetry " << sym->
label << endl;
172 if ( nmaps > 1 )
id +=
Bstring(n,
"_%03d");
173 filename =
id +
"." + avgfile.
post_rev(
'.');
177 cout <<
"Adding " <<
id <<
" to the reconstruction list" << endl;
179 rec->
frec = filename;
185 if ( calcfom && psum->
next ) {
A class for a command line input option.
Functions for reconstruction.
int project_kill(Bproject *project)
Frees a whole project.
long part_set_selection(Bproject *project, int number)
Selects one selection number and sets all others to zero.
double symmetrize(Bstring &symmetry_string, int flag)
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
Vector3< double > voxel_size
Header file for general symmetry functions.
int bexit(int value)
Exit function for cleanup and debugging.
long part_select_group(Bproject *project, int group)
Selects particles with a given group identifier.
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.
long part_set_multi_maps(Bproject *project, int part_select, int nmaps)
Sets selection for generating multiple maps.
long values(T1 &v1, T2 &v2)
Header file for reading and writing micrograph parameters.
void origin(double x, double y, double z)
long part_reset_selection(Bproject *project, int flag=0)
Resets selection to all particles.
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.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
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 write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
Header file for micrograph processing.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Bimage * project_reconstruct_3D(Bproject *project, long selnum, int calcfom, Vector3< long > size)
Transforms 3D maps and calculates an average.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
Breconstruction * reconstruction_add(Breconstruction **rec, Bstring &rec_id)
Adds a reconstruction parameter structure to a linked list.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
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.