 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
33 "Usage: bmod2part [options] input.star",
34 "-------------------------------------",
35 "Converting between model components and reconstruction particle parameters.",
38 "-reconstructions Operate on reconstruction parameters rather than micrographs.",
39 "-all Reset selection to all components before other selections.",
40 "-type comp Type of conversion: part->models or part->components.",
43 "-verbose 7 Verbose output.",
44 "-origin 0,0,0 Origin placement within image (default 0,0,0).",
45 "-sampling 2.3,2.3,1 Sampling (angstrom/voxel, one value sets all).",
46 "-box 100,83,120 Particle box size (default 50,50,50; one sets all).",
49 "-map image.spi Input 3D map file.",
50 "-parameters param.star Input atomic parameter file.",
53 "-output part.star Output particle parameter or model file.",
58 int main(
int argc,
char **argv)
75 for ( curropt = option; curropt; curropt = curropt->
next ) {
76 if ( curropt->
tag ==
"reconstructions" ) use_rec = 1;
77 if ( curropt->
tag ==
"all" ) reset = 1;
79 if ( curropt->
tag ==
"origin" ) {
80 if ( curropt->
value[0] ==
'c' ) {
83 origin = curropt->
origin();
87 if ( curropt->
tag ==
"sampling" )
88 sam = curropt->
scale();
89 if ( curropt->
tag ==
"box" )
90 box_size = curropt->
size();
91 if ( curropt->
tag ==
"map" )
93 if ( curropt->
tag ==
"parameters" )
95 if ( curropt->
tag ==
"output" )
104 while ( optind < argc )
string_add(&file_list, argv[optind++]);
106 cerr <<
"Error: No model files specified!" << endl;
119 cerr <<
"Error: Input file not read!" << endl;
193 for ( i=0; i<3; i++ )
if ( sampling[i] <= 0 ) sampling[i] = 1;
207 cout <<
"Generating particles from model components" << endl << endl;
212 for ( i=0, mp =
model; mp; mp = mp->
next )
if ( mp->
sel ) {
213 for ( comp = mp->
comp; comp; comp = comp->
next )
if ( comp->
sel ) {
216 part->
ori = box_size/2;
217 part->
loc = comp->
loc/sampling + origin;
242 cout <<
"Generating models from particles" << endl;
244 for ( part = rec->
part; part; part = part->
next ) {
263 cout <<
"Models generated: " << nmod << endl << endl;
286 cout <<
"Generating model components from 2D particles" << endl;
289 for ( mg = field->
mg; mg; mg = mg->
next ) {
290 for ( part = mg->
part; part; part = part->
next ) {
304 cout <<
"Components generated: " << i << endl << endl;
328 cout <<
"Generating model components from 3D particles" << endl;
330 for ( part = rec->
part; part; part = part->
next ) {
343 cout <<
"Components generated: " << ncomp << endl << 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.
Header file for file checking functions.
Vector3< double > voxel_size
string base(string &filename)
int main(int argc, char **argv)
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
int bexit(int value)
Exit function for cleanup and debugging.
Vector3< double > default_origin()
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Bproject * project_init()
Initializes a micrograph processing project parameter structure.
Header file for option handlers.
int project_set_micrograph_origins(Bproject *project, Vector3< double > origin)
Sets micrograph origins to the given origin.
Vector3< double > origin()
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
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.
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.
Bmodel * components_from_2D_particles(Bproject *project)
Converts particle coordinates from micrographs into model component coordinates.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
General image parameter class.
Header file for reading and writing atomic model files.
Utilities for timing functions.
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
Bproject * project_part_from_model(Bmodel *model, Vector3< double > origin, Vector3< double > sampling, Vector3< long > box_size)
Converts component coordinates in a model to reconstruction particle coordinates.
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.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Bmodel * components_from_3D_particles(Bproject *project)
Converts particle coordinates for a reconstruction into model component coordinates.
Bparticle * particle_add(Bparticle **part, int pid)
Adds a particle parameter structure to a linked list.
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.
Bmodel * models_from_particles(Bproject *project)
Converts particle coordinates for a reconstruction into model component coordinates.
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.
Library routines used for model processing.
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
Vector3< double > pixel_size
Bmodel * read_model(Bstring &filename)
void sampling(long nn, Vector3< double > u)
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.
FileType file_type(const char *filename)
Checks the file type using the extension and contents.