 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: bmgtransfer [options] input.star/input.img [input.star/input.img]",
25 "------------------------------------------------------------------------",
26 "Transfer pieces of information from input micrograph parameter files",
27 "to a master destination parameter file.",
28 "Transfers are linked to field ID's and can occur in one of two ways:",
29 "1. From one source micrograph to all destination micrographs in the field.",
30 "2. From each source micrograph to the corresponding destination micrograph in the field.",
33 "-ctf Replace CTF parameters.",
34 "-particles Replace particle parameters.",
35 "-origins Replace particle origins.",
38 "-verbose 7 Verbosity of output.",
41 "-master destination.star Master parameter file into which to merge information from other input files.",
44 "-output output.star Output parameter file (required any time \"-split\" is used to indicate the type).",
45 "-split 3 Split micrograph or reconstruction data blocks into individual files:",
46 " Argument: 1-6: number of digits inserted before extension",
47 " Argument: \"id\": micrograph ID's are used as file names (no -output required).",
48 " Argument: \"field\": field ID's are used as file names (no -output required).",
49 "-dump file.txt Dump all the particle origins and views.",
54 int main (
int argc,
char **argv)
66 for ( curropt = option; curropt; curropt = curropt->
next ) {
67 if ( curropt->
tag ==
"ctf" ) {
68 if ( which.
length() ) which +=
",";
71 if ( curropt->
tag ==
"particles" ) {
72 if ( which.
length() ) which +=
",";
75 if ( curropt->
tag ==
"origins" ) {
76 if ( which.
length() ) which +=
",";
79 if ( curropt->
tag ==
"master" )
81 if ( curropt->
tag ==
"output" )
83 if ( curropt->
tag ==
"split" ) {
87 cerr <<
"-split: An integer must be specified!" << endl;
91 if ( curropt->
tag ==
"dump" )
101 cerr <<
"Error: A master parameter file must be specified!" << endl;
107 while ( optind < argc )
string_add(&file_list, argv[optind++]);
109 cerr <<
"Error: No parameter files specified!" << endl;
118 cerr <<
"Error: No input parameter files read!" << endl;
154 if ( mg_source->
ctf ) {
165 for ( part = mg->
part; part; part = part->
next )
170 for ( part = mg->
part, part_source = mg_source->
part; part && part_source; part = part->
next, part_source = part_source->
next )
171 part->
ori = part_source->
ori;
185 if ( nmg_source == 1 ) {
186 mg_source = field_source->
mg;
187 for ( nmg=0, mg = field->
mg; mg; mg = mg->
next )
189 }
else if ( nmg_source == nmg ) {
190 for ( nmg=0, mg = field->
mg, mg_source = field_source->
mg; mg && mg_source; mg = mg->
next, mg_source = mg_source->
next )
193 cerr <<
"Error in updating parameters: The numbers of micrographs are unsuitable!" << endl;
194 cerr <<
" Master field " << field->
id <<
" has " << nmg <<
" micrographs" << endl;
195 cerr <<
" Source field " << field_source->
id <<
" has " << nmg_source <<
" micrographs" << endl;
207 if ( rec_source->
ctf ) {
221 for ( part = rec->
part, part_source = rec_source->
part; part && part_source; part = part->
next, part_source = part_source->
next )
222 part->
ori = part_source->
ori;
230 long nmg(0), nrec(0);
231 Bfield *field, *field_source;
235 cout <<
"Replacing parameters: " << which << endl;
238 for ( field_source = proj_source->
field; field_source; field_source = field_source->
next ) {
244 cout <<
"Micrographs updated: " << nmg << endl << endl;
246 for ( rec_source = proj_source->
rec; rec_source; rec_source = rec_source->
next ) {
252 cout <<
"Reconstructions updated: " << nmg << endl << endl;
A class for a command line input option.
int project_kill(Bproject *project)
Frees a whole project.
int project_split_field_write(Bproject *project)
Splits a project into sets of particle selections and write the files.
long field_count_micrographs(Bfield *field)
Counts all the micrographs in the field-of-view structure.
int main(int argc, char **argv)
int string_kill(Bstring *list)
Kills a string linked list.
Header file for file checking functions.
int update(CTFparam *ctf)
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.
Header file for option handlers.
Header file for reading and writing micrograph parameters.
long project_dump(Bproject *project, Bstring &filename)
Dumps particle info in the project hierarchy.
Functions for CTF (contrast transfer function) processing.
long field_replace_parameters(Bfield *field, Bfield *field_source, Bstring &which)
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Header file for general utilities.
vector< string > split(const string &s)
Splits a string on whitespace.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
long rec_replace_parameters(Breconstruction *rec, Breconstruction *rec_source, Bstring &which)
Header file for micrograph processing.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Bparticle * particle_copy(Bparticle **partlist, Bparticle *part)
Adds one particle onto a list of particle parameters.
long mg_replace_parameters(Bmicrograph *mg, Bmicrograph *mg_source, Bstring &which, Vector3< double > origin)
bool contains(const Bstring &s)
int particle_kill(Bparticle *part)
Frees a list of particles.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
long project_replace_parameters(Bproject *project, Bproject *proj_source, Bstring &which)