 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: dmerge [options] input1.star [input2.star...]",
21 "----------------------------------------------------",
22 "Merges corresponding single particle images in a series.",
23 "The images can be aligned according to their origin values and",
24 "the in-plane rotational angle (of the micrograph).",
26 "You may use the index number of a micrograph in a series, a relative focus",
27 "level, or an in-plane rotation angle of the micrograph to select a reference",
28 "micrograph--the one to which the others are aligned. The default is to use",
29 "the closest-to-focus micrograph in each field-of-view.",
31 "The default is to use origins from parameter file(s), while origins may also",
32 "be determined by cross-correlation or obtained from particle image files.",
34 "Default image output is to one file for every field named",
35 "'[reference_particle_file_prefix]_merged.img'.",
38 "-unmerge merged.star Un-merge, corresponding particles in field get orientations,",
39 " figure-of-merit (FOM), and selection from 'merged.star',",
40 " micrograph rotation angle is accounted for",
43 "-verbose 7 Verbosity of screen output, default = 0 (none)",
44 "-sampling 1.5 Global sampling (angstrom/pixel)",
46 "Parameters for merging:",
47 "-origins cross Get particle origins from parameter files (param, default),",
48 " by cross-correlation (cross), from image files (image),",
49 " or no alignment (none)",
50 "-reference near Reference micrograph: near, nearest-to-focus; far, farthest-from-focus;",
51 " index,1, micrograph index; or angle,0, micrograph rotation angle",
52 " Note: the index option assumes micrographs were entered",
53 " into the parameter file(s) in consistent order",
55 "Parameters for unmerging:",
56 "-keeporient 0.1 Keep orientation, FOM, & selection if FOM difference >= this value",
59 "-output file.star Output parameter file",
60 "-summed output.img Write summed images to output*.img (* = _micrograph_ids), but only",
61 " if micrograph_ids are <= 6 characters, if not default name is used ",
68 int main(
int argc,
char** argv)
72 double fom_diff(-1.0);
84 for ( curropt = option; curropt; curropt = curropt->
next ) {
85 if ( curropt->
tag ==
"origins" ) {
91 if ( curropt->
tag ==
"keeporient" ) {
92 if ( ( fom_diff = curropt->
value.
real() ) < 0.0001 )
93 cerr <<
"-keeporient: A FOM-difference threshold must be specified." << endl;
95 cerr <<
"-keeporient: The FOM-difference threshold (" << fom_diff <<
") must be greater than zero." << endl;
97 if ( curropt->
tag ==
"sampling" )
98 sam = curropt->
scale();
99 if ( curropt->
tag ==
"reference" ) {
101 else if ( curropt->
value.
contains(
"far") ) mg_ref_select = 1;
108 mg_rot_ang *=
M_PI/180.0;
111 if ( curropt->
tag ==
"summed" )
113 if ( curropt->
tag ==
"unmerge" )
115 if ( curropt->
tag ==
"output" )
122 if ( orientfile.
length() && (fom_diff > 0) ) {
123 cerr <<
"ERROR: You selected the 'unchange' option. It only works if the unmerge option also is used." << endl;
129 while ( optind < argc )
string_add(&file_list, argv[optind++]);
131 cerr <<
"Error: No parameter files specified!" << endl;
139 cerr <<
"Error: No input file read!" << endl;
148 if ( orientfile.
length() ) {
A class for a command line input option.
int project_kill(Bproject *project)
Frees a whole project.
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
int mg_particle_merge_series(Bproject *project, int mg_ref_select, int mg_index, float mg_rot_ang, int mg_ori_select, Bstring outimg)
Aligns and merges (sums) 2D particle images from a focal, or other, series and writes to new image fi...
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 main(int argc, char **argv)
Header file for option handlers.
Header file for reading and writing micrograph parameters.
int project_set_mg_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the micrographs.
Utilities for timing functions.
int mg_particle_unmerge(Bproject *project, Bproject *orientations, float fom_diff)
Gives corresponding particles in a field-of-view the same orientation, figure-of-merit (FOM),...
Header file for functions to merge images.
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.
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.
bool contains(const Bstring &s)
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.