 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
28 "Usage: borient [options] input.star [input.star]",
29 "------------------------------------------------",
30 "Determines the orientations and origins of single particles with respect to a reference.",
31 "Options -resolution and -bands are mutually exclusive.",
34 "-mode scc Mode: 0,pps: polar power spectrum only (fast, default),",
35 " 1,scc: polar power spectrum with selected cross correlation.",
36 " 2,ccc: polar power spectrum with all cross correlation (slow).",
37 " 3,ori: origin determination by cross correlation.",
38 "-CTF Apply CTF to projections (default not).",
39 "-all Reset selection to all particles before other selections (default not).",
40 "-side 15 Generate side view projections within the given angle from the equator.",
41 "-bin 2 Binning by given kernel size (default 1).",
42 "-prepare 45,12 Prepare a set of particle images as 2D references (number and first image).",
45 "-verbose 1 Verbosity of output.",
46 "-select 14 Selection number of particles to process (default all selected).",
47 "-symmetry C5 Point group symmetry.",
48 "-angles 2.5,5.2 Step size for theta and phi, one value sets both (default 45 degrees).",
49 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given.)",
50 "-resolution 20,360 High and low resolution limits (angstrom).",
51 "-polarresolution 23.5 Resolution limit for in-plane angular alignment (angstrom).",
52 "-bands 250,-1,150,1,30,0 Bands for analysis in reciprocal space (pairs of numbers: angstrom,flag).",
53 " Band with 0: Not used - end flag.",
54 " Band with 1: Use for orientation determination.",
55 " Band with -1: Use for cross-validation.",
56 "-annuli 2,95 Real space annular limits (default 0,inf pixels).",
57 "-shiftlimit 3.5 Limit on origin shift relative to nominal center (default 10% of box edge size).",
58 "-rotationlimit 16.7 Limit on in-plane rotation change from input orientation (default not applied).",
59 "-edge 125 Edge mask radius using previous particle origins (default not used).",
60 "-fom 0.3 Set FOM threshold for selection (default 0).",
62 "-nothreads Do not use threads (default parallel processing).",
66 "-reference file.ext Input 3D reference map or projection file.",
67 "-mask mask.mrc Real space 2D mask to be applied to projections and particles.",
70 "-output file.star Output parameter file.",
71 "-log Write particle log files to directory \"log\".",
72 "-ppx Write temporary particle parameter files to directory \"ppx\".",
73 "-TwoD file.ext File name for 2D real space reconstruction.",
74 "-oriented Output oriented images with file names ending with \"_proj.spi\".",
75 " (must be used with the -TwoD option).",
81 int main(
int argc,
char** argv)
91 long fref(0), nref(0);
99 double shift_limit(-1);
100 double angle_limit(0);
101 double edge_radius(0);
104 int transform_output(0);
118 for ( curropt = option; curropt; curropt = curropt->
next ) {
119 if ( curropt->
tag ==
"all" )
121 if ( curropt->
tag ==
"select" )
123 cerr <<
"-select: A selection number must be specified!" << endl;
124 if ( curropt->
tag ==
"symmetry" )
126 if ( curropt->
tag ==
"angles" ) {
127 if ( ( i = curropt->
values(theta_step, phi_step) ) < 1 )
128 cerr <<
"-angles: An angle step size must be specified" << endl;
130 theta_step *=
M_PI/180.0;
131 if ( i < 2 ) phi_step = theta_step;
132 else phi_step *=
M_PI/180.0;
135 if ( curropt->
tag ==
"side" ) {
136 if ( ( side_ang = curropt->
value.
real() ) < 0.001 )
137 cerr <<
"-side: One angle must be specified!" << endl;
139 side_ang *=
M_PI/180.0;
141 if ( curropt->
tag ==
"bin" ) {
143 cerr <<
"-bin: An integer must be specified!" << endl;
145 if ( bin < 2 ) bin = 0;
146 if ( bin > 4 ) bin = 4;
149 if ( curropt->
tag ==
"prepare" )
150 if ( curropt->
values(nref, fref) < 1 )
151 cerr <<
"-prepare: A number of particle images must be specified!" << endl;
152 if ( curropt->
tag ==
"sampling" )
153 sam = curropt->
scale();
154 if ( curropt->
tag ==
"resolution" ) {
155 if ( curropt->
values(res_hi, res_lo) < 1 )
156 cerr <<
"-resolution: At least one resolution limit must be specified!" << endl;
158 if ( res_lo < res_hi ) swap(res_hi, res_lo);
160 if ( curropt->
tag ==
"polarresolution" )
161 if ( ( res_polar = curropt->
value.
real() ) < 0.1 )
162 cerr <<
"-polarresolution: A resolution limit must be specified!" << endl;
163 if ( curropt->
tag ==
"bands" ) {
165 if ( band.size() < 2 )
166 cerr <<
"-bands: At least two pairs of numbers must be specified!" << endl;
167 band[band.size()] = 0;
169 if ( curropt->
tag ==
"annuli" )
170 if ( curropt->
values(ann_min, ann_max) < 1 )
171 cerr <<
"-annuli: At least a minimum annulus must be specified!" << endl;
172 if ( curropt->
tag ==
"shiftlimit" )
173 if ( ( shift_limit = curropt->
value.
real() ) < 0.1 )
174 cerr <<
"-shiftlimit: A maximum shift in pixels must be specified!" << endl;
175 if ( curropt->
tag ==
"rotationlimit" ) {
176 if ( ( angle_limit = curropt->
value.
real() ) < 0.1 )
177 cerr <<
"-rotationlimit: A maximum rotation angle must be specified!" << endl;
179 angle_limit *=
M_PI/180.0;
181 if ( curropt->
tag ==
"edge" )
182 if ( ( edge_radius = curropt->
value.
real() ) < 0 )
183 cerr <<
"-edge: An edge radius must be specified!" << endl;
186 if ( curropt->
tag ==
"fom" )
187 if ( ( FOM_cut = curropt->
value.
real() ) < 0.0001 )
188 cerr <<
"-fom: A FOM threshold must be specified!" << endl;
189 if ( curropt->
tag ==
"threads" ) {
190 if ( curropt->
value[0] ==
'm' ) nthreads = 1000;
192 cerr <<
"-threads: A number of threads must be specified!" << endl;
195 if ( curropt->
tag ==
"nothreads" ) nothreads = 1;
197 if ( curropt->
tag ==
"mode" ) {
198 if ( isdigit(curropt->
value[0]) ) {
206 if ( mode < 0 || mode > 3 ) mode = 0;
209 if ( curropt->
tag ==
"oriented" ) transform_output = 1;
212 if ( curropt->
tag ==
"output" )
214 if ( curropt->
tag ==
"reference" )
216 if ( curropt->
tag ==
"mask" )
217 mask_filename = curropt->
filename();
218 if ( curropt->
tag ==
"TwoD" )
219 twoD_recons_name = curropt->
filename();
227 fftwf_init_threads();
236 if ( res_hi <= 0 ) res_hi = 0.1;
240 while ( optind < argc )
string_add(&file_list, argv[optind++]);
242 cerr <<
"Warning: No parameter files specified!" << endl;
250 cerr <<
"Error: No input file read!" << endl;
255 if ( ref_filename.
length() )
257 bin, sym, theta_step, phi_step, side_ang);
276 if ( sam[0] > 0 && sam[1] > 0 && sam[2] > 0 ) {
281 if ( proj && outfile.
length() ) {
284 part_select, res_lo, res_hi, shift_limit, flags) < 0 ) {
285 cerr <<
"Error: Alignment failed!" << endl;
290 bin, sym,
part_select, band, res_lo, res_hi, res_polar,
291 ann_min, ann_max, shift_limit, angle_limit, edge_radius, flags) < 0 ) {
292 cerr <<
"Error: Alignment failed!" << endl;
304 if ( twoD_recons_name.
length() ) {
305 if ( transform_output )
314 part->fpart = twoD_recons_name;
315 twoD_recons_name = 0;
320 time_t t = time(NULL);
335 if ( !nothreads ) fftwf_cleanup_threads();
A class for a command line input option.
Functions for reconstruction.
int project_kill(Bproject *project)
Frees a whole project.
Bimage * project_reconstruct_2D(Bproject *project, int transform_output)
Creates a 2D reconstruction from the images in a multi-image file.
long project_count_mg_particles(Bproject *project)
Counts all the particles in the project structure.
Vector3< double > scale()
int string_kill(Bstring *list)
Kills a string linked list.
size_t system_processors()
Returns the number of processors.
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.
long project_show_class_averages(Bproject *project)
Shows the class averages in a project.
Library routines for single particle analysis.
int project_determine_origins(Bproject *project, Bimage *proj, int bin, Bsymmetry *sym, int part_select, double res_lo, double res_hi, double shift_limit, int flags)
Find the origin of every image in a project.
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.
long part_reset_selection(Bproject *project, int flag=0)
Resets selection to all particles.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
long part_deselect(Bproject *project, int fom_index, double fommin, double fommax=1e30)
Deselects particles below a given FOM cutoff.
Bimage * project_reconstruct_2D_fast(Bproject *project)
General image parameter class.
Utilities for timing functions.
Bimage * project_prepare_2D_references(Bproject *project, long first, long number, int bin=1, int ctf_action=0, double wiener=0.2)
Prepare reference images from particles.
Tcl_Obj * part_select(Bparticle *part, int objc, Tcl_Obj *CONST objv[])
vector< double > split_into_doubles(const Bstring &delim)
Bstring symmetry_string()
Header file for image processing from micrograph structures.
int project_determine_orientations2(Bproject *project, Bimage *proj, Bstring &mask_file, int bin, Bsymmetry *sym, int part_select, vector< double > &band, double res_lo, double res_hi, double res_polar, int ann_min, int ann_max, double shift_limit, double angle_limit, double edge_radius, int flags)
Find the orientation and origin of every image in a project.
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.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int main(int argc, char **argv)
int project_set_views_from_images(Bproject *project)
Gets views from particle images.
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
Header file for micrograph processing.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
bool contains(const Bstring &s)
Bimage * img_prepare_projections(Bstring &filename, Bstring &mask_file, int bin, Bsymmetry *sym, double theta_step, double phi_step, double side_ang)
Generate projections if a 3D file, otherwise clean projections.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.