 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 "Usage: brecmod [options] in.star",
30 "--------------------------------",
31 "Merges data from micrograph and model files.",
34 "-consolidate mod.star Consolidate project and model parameters.",
35 "-images Convert particle images (use with -outmodel).",
36 "-submodels Generate particle models (use with -outmodel).",
39 "-verbose 7 Verbosity of output.",
40 "-sampling 1.5,1.5,1.5 Sampling of images (A/pixel; a single value can be given).",
43 "-template model.star Template to associate with each particle.",
46 "-output newmg.star New micrograph parameter file.",
47 "-outmodel partmod.star New model file from particles.",
48 "-outmark markmod.star New model file from markers.",
53 int main(
int argc,
char **argv)
68 for ( curropt = option; curropt; curropt = curropt->
next ) {
69 if ( curropt->
tag ==
"consolidate" )
71 if ( curropt->
tag ==
"images" ) flags |= 1;
72 if ( curropt->
tag ==
"submodels" ) flags |= 2;
73 if ( curropt->
tag ==
"sampling" )
74 sam = curropt->
scale();
75 if ( curropt->
tag ==
"template" )
77 if ( curropt->
tag ==
"output" )
79 if ( curropt->
tag ==
"outmodel" )
81 if ( curropt->
tag ==
"outmark" )
90 while ( optind < argc )
string_add(&file_list, argv[optind++]);
92 cerr <<
"Error: No parameter or image files specified!" << endl;
100 cerr <<
"Error: Input micrograph file not read!" << endl;
105 cerr <<
"Error: No reconstruction found!" << endl;
119 if ( tempfile.
length() ) {
122 cerr <<
"Error: Input template file " << tempfile <<
" not read!" << endl;
127 if ( consolidate.
length() ) {
130 cerr <<
"Error: No model read!" << endl;
134 }
else if ( partmodfile.
length() ) {
136 }
else if ( markmodfile.
length() ) {
146 if ( partmodfile.
length() ) {
150 if ( markmodfile.
length() ) {
194 Bstring partfile, newpartfile, modfile;
199 cout <<
"Generating models from particles:" << endl <<
"Reconstruction\tParticle\tModel" << endl;
208 for ( part = rec->
part; part; part = part->
next ) {
217 partfile = part->
fpart;
218 modfile = partfile.
pre_rev(
'.') +
".star";
219 newpartfile = partfile.
pre_rev(
'.') +
"_std." + partfile.
post_rev(
'.');
221 partfile = rec->
fpart;
224 ct->
num = part->
id - 1;
228 if ( partfile.
length() ) {
229 ct->
fmod = newpartfile;
231 if ( ( p =
read_img(partfile, 1, ct->
num) ) == NULL ) {
232 error_show(
"project_model_generate", __FILE__, __LINE__);
238 origin = p->
size()/2;
239 shift = origin - part->
ori;
253 partmod->
id = comp->
id;
259 partmod->
fom = part->
fom[0];
261 partmod->
fmap = partfile;
262 if ( flags & 1 ) partmod->
fmap = newpartfile;
268 cout << rec->
id <<
tab << part->
id <<
tab << comp->
id << endl;
298 cout <<
"Consolidating particles with models:" << endl <<
"Reconstruction\tParticle\tModel" << endl;
300 for ( part = rec->
part; part && mp; part = part->
next, mp = mp->
next ) {
302 cout << rec->
id <<
tab << part->
id <<
tab << mp->
id << endl;
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.
Header file for reading and writing atomic model files.
Vector3< double > voxel_size
int main(int argc, char **argv)
Matrix3 transpose() const
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
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 error_show(string message, string file, int line)
Displays the error with file and line reference.
double background(long nn)
Vector3< long > size() const
Bmodel * model_copy(Bmodel *model)
Copies a model.
Header file for option handlers.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Bmodel * project_model_generate(Bproject *project, Bmodel *temp, int flags)
Generates a model from each particle defined in a reconstruction.
Header file for image parameter functions.
Bmodel * model_init(Bstring &id)
Initializes a model structure.
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
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.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int rotate()
Rotates an image using parameters defined in the image in place.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
int project_model_consolidate(Bproject *project, Bmodel *model)
Exchanges information between reconstruction and model structures.
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.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
ostream & tab(ostream &out)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
void origin(double ox, double oy, double oz)
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.
Header file for generalized linked list functions.
Bmodel * model_add(Bmodel **model, Bstring &id)
Adds a model to a linked list.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
Bmodel * read_model(Bstring &filename)
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Bmodel * model_from_markers(Bmarker *markers, Vector3< double > origin, Vector3< double > sam)
Convert markers to a model.