 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
34 "Usage: btomo [options] input.star/input.img [input.star/input.img]",
35 "------------------------------------------------------------------",
36 "Manipulates parameter files for tilt series and aligns them by cross-correlation.",
39 "-all Select all markers.",
40 "-updatematrix Update micrograph matrices from tilt and axis angles.",
41 "-resetmodel Reset the x and y coordinates to that of the zero-degree tilt image.",
42 "-checkmarkers Determine if markers all fall within micrograph boundaries.",
43 "-deselect 5-9,33 Deselect markers by id from all micrographs and models.",
44 "-deletemarkers 5-9,33 Delete markers by id from all micrographs and models.",
45 "-rotationaxis Determine the best rotation axis from refined markers.",
46 "-clear 240,7.5 Clear extraneous areas on micrographs with this intended reconstruction thickness",
47 " and smoothing edge width (default 5).",
48 "-removemarkers 14 Mask out markers with this radius (pixels) before transformation.",
49 "-thickness 234 Calculate mean free path from a given thickness (in angstrom).",
50 "-lambda 2650 Calculate thickness from proportionality coefficient (in angstrom).",
51 "-catenate Concatenate separate micrograph image files into one file.",
54 "-verbose 7 Verbosity of output.",
55 "-datatype u Force writing of a new data type.",
56 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
57 "-origin 110,50,44 Origin for tilt axis (default 0,0,0).",
58 "-axis 74.7 Tilt axis angle relative to x-axis (default 0 or from parameter file).",
59 "-tilt -65,1.5 Tilt series start and step size (default from parameter file).",
60 "-reference 48 Reference image for alignment (default closest to zero tilt).",
61 "-goldradius 12 Gold particle radius (default from parameter file).",
64 "-rawtlt series.rawtlt Text file with tilt angles.",
67 "-output file.star Output parameter file.",
68 "-image file.pif Output multi-image file with aligned images.",
69 "-Postscript inten.ps Postscript file with fit of tilt series intensities.",
75 int main(
int argc,
char** argv)
91 double marker_erase_radius(0);
92 double marker_radius(0);
111 for ( curropt = option; curropt; curropt = curropt->
next ) {
112 if ( curropt->
tag ==
"all" ) select_all = 1;
113 if ( curropt->
tag ==
"resetmodel" ) reset_model = 1;
114 if ( curropt->
tag ==
"updatematrix" ) update_matrix = 1;
115 if ( curropt->
tag ==
"checkmarkers" ) checkmarkers = 1;
116 if ( curropt->
tag ==
"deselect" ) deselect = curropt->
value;
117 if ( curropt->
tag ==
"deletemarkers" ) deletemarkers = curropt->
value;
118 if ( curropt->
tag ==
"rotationaxis" ) rotation_axis = 1;
120 if ( curropt->
tag ==
"thickness" )
121 if ( ( thickness = curropt->
value.
real() ) < 1 )
122 cerr <<
"-thickness: A thickness must be specified!" << endl;
123 if ( curropt->
tag ==
"lambda" )
124 if ( ( lambda = curropt->
value.
real() ) < 1 )
125 cerr <<
"-lambda: A mean free path must be specified!" << endl;
126 if ( curropt->
tag ==
"catenate" ) catenate = 1;
127 if ( curropt->
tag ==
"clear" )
128 if ( curropt->
values(clearareas, edge_width) < 1 )
129 cerr <<
"-clear: A thickness must be specified." << endl;
130 if ( curropt->
tag ==
"removemarkers" )
131 if ( ( marker_erase_radius = curropt->
value.
real() ) < 1 )
132 cerr <<
"-removemarkers: A marker radius must be specified!" << endl;
133 if ( curropt->
tag ==
"datatype" )
135 if ( curropt->
tag ==
"sampling" )
136 sam = curropt->
scale();
137 if ( curropt->
tag ==
"reference" )
139 cerr <<
"-reference: An image number must be specified." << endl;
140 if ( curropt->
tag ==
"origin" )
141 origin = curropt->
origin();
142 if ( curropt->
tag ==
"axis" ) {
146 if ( curropt->
tag ==
"tilt" ) {
147 if ( curropt->
values(tilt_start, tilt_step) < 2 )
148 cerr <<
"-tilt: Two angles must be specified." << endl;
155 if ( curropt->
tag ==
"goldradius" )
156 if ( ( marker_radius = curropt->
value.
real() ) < 1 )
157 cerr <<
"-goldradius: A gold marker radius must be specified." << endl;
160 if ( curropt->
tag ==
"rawtlt" )
162 if ( curropt->
tag ==
"Mask" )
164 if ( curropt->
tag ==
"output" )
166 if ( curropt->
tag ==
"image" )
168 if ( curropt->
tag ==
"Postscript" )
179 while ( optind < argc )
string_add(&file_list, argv[optind++]);
181 cerr <<
"Error: No parameter or image files specified!" << endl;
193 cerr <<
"Error: Input file not read!" << endl;
214 else if ( tilt_step )
231 if ( thickness || lambda ) {
234 if ( plot && psfile.
length() )
236 if ( thickness ) lambda = thickness/tlr;
237 if ( lambda ) thickness = lambda*tlr;
238 if ( thickness && lambda ) {
240 cout <<
"Thickness: " << thickness <<
" A" << endl;
241 cout <<
"Proportionality parameter: " << lambda <<
" A" << endl << endl;
253 for ( i=0, mg_ref=
project->
field->
mg; mg_ref && ( i<ref_img ); mg_ref=mg_ref->
next, i++ ) ;
267 if ( deletemarkers.
length() )
279 if ( marker_erase_radius )
A class for a command line input option.
Header file for utility functions for use in qsort calls.
int project_kill(Bproject *project)
Frees a whole project.
int project_mg_tilt_to_matrix(Bproject *project)
Sets the matrix from the tilt and axis angles for each micrograph.
long project_delete_markers(Bproject *project, Bstring &delete_list)
Deletes selected markers in a project hierarchy.
int project_mg_marker_select(Bproject *project, double fom)
Selects markers.
Header file for matrix functions.
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Vector3< double > scale()
int project_check_markers(Bproject *project, int flags)
Checks if the markers in a project parameter structure fall within micrographs.
int string_kill(Bstring *list)
Kills a string linked list.
Header file for file checking functions.
int project_set_nominal_mg_origins(Bproject *project)
Sets micrograph origins to the centers of the micrographs.
Header file for functions for creating random images.
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.
int read_imod_tlt(Bstring &filename, Bproject *project)
int project_set_micrograph_origins(Bproject *project, Vector3< double > origin)
Sets micrograph origins to the given origin.
Vector3< double > origin()
int project_set_marker_radius(Bproject *project, double mark_radius)
Sets the marker radius in a project parameter structure.
double angle_set_negPI_to_PI(double angle)
Returns an angle between -PI and PI.
Converts between IMOD files and a micrograph parameter file.
long values(T1 &v1, T2 &v2)
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 project_erase_markers(Bproject *project, double marker_radius)
Erases or paints markers in micrographs.
double project_marker_rotation_axis(Bproject *project)
Determines the most likely rotation axis location for a tilt series.
int main(int argc, char **argv)
double project_tomo_residuals(Bproject *project, int show)
Calculates the residuals for an alignment solution.
double project_fit_intensities(Bproject *project, Bplot *plot=NULL, int flag=0)
Determines the thickness to mean free path ratio from a tilt series.
int project_clear_extraneous_areas(Bproject *project, long thickness, double width)
Clears areas from a tilt series not used in a reconstruction.
Bproject * project_create_from_images(Bstring *file_list, Bstring type)
Creates a project structure using image file names.
Utilities for timing functions.
double project_write_aligned_images(Bproject *project, Bimage *pgr, Bstring &imgfile, DataType datatype)
Calculates aligned micrograph images and write them to a file.
Bplot * project_intensity_plot(Bproject *project)
Transfers the micrograph intensities for a field into a plot.
Header file for image processing from micrograph structures.
double timer_start()
Starts timer and prints the time.
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
int project_catenate_micrographs(Bproject *project)
Concatenates all micrograph image files into one file.
Header file for general utilities.
int project_set_tilt_axis(Bproject *project, double tilt_axis)
Sets the tilt axis angle in a project parameter structure.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Bmicrograph * field_find_zero_tilt_mg(Bfield *field)
Finds the micrograph closest to a zero degree tilt in a series.
long project_show_markers(Bproject *project)
Shows the markers in a project hierarchy.
int project_set_tilt_angles(Bproject *project, double tilt_start, double tilt_step)
Sets the tilt and tilt axis angles in a project parameter structure.
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.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int mg_reset_model(Bmicrograph *mg, Bmarker *model)
Resets the model x and y coordinates from the zero-tilt micrograph.
DataType
Base data type specifier.
Header file for functions to align micrographs or coordinates from micrographs and apply the resultan...
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Header file for single particle image processing in Bsoft.
long project_deselect_markers(Bproject *project, Bstring &deselect_list)
Deletes selected markers in a project hierarchy.
FileType file_type(const char *filename)
Checks the file type using the extension and contents.