Bsoft  2.1.0
Bernard's software package
breconstruct.cpp
Go to the documentation of this file.
1 
9 #include "mg_processing.h"
10 #include "mg_reconstruct.h"
11 #include "rwmg.h"
12 #include "mg_particle_select.h"
13 #include "symmetry.h"
14 #include "Matrix.h"
15 #include "rwimg.h"
16 #include "utilities.h"
17 #include "options.h"
18 #include "timer.h"
19 
20 // Declaration of global variables
21 extern int verbose; // Level of output to the screen
22 
23 // Usage assistance
24 const char* use[] = {
25 " ",
26 "Usage: breconstruct [options] input.star [input.star]",
27 "-----------------------------------------------------",
28 "Reconstructs 2D and 3D maps from single particle images.",
29 "Note: -classes and -bootstrap are mutually exclusive.",
30 " ",
31 "Actions:",
32 "-mode 1 Symmetry mode: 0=during reconstruction (default), 1=after reconstruction,",
33 " 2=pick a random symmetry view for each particle.",
34 "-TwoD Generate a 2D reconstruction (default 3D).",
35 "-CTF flip Apply CTF correction to images before reconstruction (default not).",
36 "-rescale -0.1,5.2 Rescale reconstruction to an average and standard deviation.",
37 " ",
38 "Parameters for configuration:",
39 "-bootstrap Use particle selection numbers to weigh their contributions.",
40 "-filaments Generate one map per filament.",
41 "-classes 1,3-5 Class selection: can be all, selected, or any combination of numbers (default selected).",
42 "-fullmap Output one full map per class (default if -halfmaps not used).",
43 "-halfmaps Output 2 maps from half sets.",
44 "-threads 2 Threads per class (default 1, must be even for -halfmaps).",
45 " ",
46 "Parameters:",
47 "-verbose 7 Verbosity of output.",
48 "-datatype u Force writing of a new data type.",
49 "-size 100,120,90 Size of reconstruction (default from images).",
50 "-sampling 1.5 Reconstruction sampling (A/pixel; default from first particle image).",
51 "-scale 1.2 Scale or magnification of reconstruction compared to original images (default 1).",
52 "-resolution 20 Resolution limit (angstrom, default Nyquist).",
53 "-interpolation weighted Interpolation type: nearest (default), weighted, trilinear.",
54 "-pad 3 Image padding factor (default 2).",
55 "-symmetry D6 Symmetry: Point group identifier",
56 "-wiener 0.15 Wiener factor for CTF correction (default 0.2).",
57 " ",
58 "Output:",
59 "-reconstruction file.ext Reconstruction file name.",
60 "-fom file.ext Figure-of-merit file name.",
61 "-output file.star Output parameter file name.",
62 "-Postscript file.ps Postscript output filename.",
63 " ",
64 NULL
65 };
66 
67 
68 int main(int argc, char** argv)
69 {
70  // Initializing variables
71  int sym_mode(0); // 0=during, 1=after, 2=random
72  int twoD_flag(0); // Flag for 2D reconstruction
73  double nuavg, nustd(0); // Values for rescaling
74  DataType nudatatype(Unknown_Type); // Conversion to new type
75  Vector3<double> sam; // Units for the three axes (A/pixel)
76  Vector3<long> map_size; // Size of reconstruction
77  int interp_type(0); // Interpolation type
78  Vector3<double> scale(1,1,1); // Scale or magnification of reconstruction compared to original images
79  int ctf_action(0); // Default no CTF operation
80  double wiener(0.2); // Wiener for CTF correction
81  int pad_factor(2); // Image padding factor
82  double resolution(0); // Must be set > 0 to limit resolution
83  Bsymmetry* sym = NULL; // No symmetry specified
84  Bstring classes("select"); // Class selection string
85  long nmaps(0); // Number of maps per class
86  long nthreads(1); // Number of threads per map
87  int bootstrap(0); // Flag to indicate a bootstrap reconstruction
88  long imap(0); // Select one of multiple maps to reconstruct
89  int filaments(0); // Flag to generate separate filament reconstructions
90  Bstring outfile; // Output parameter file
91  Bstring reconsfile; // Output reconstruction file
92  Bstring fomfile; // Figure-of-merit file
93  Bstring ps_file; // Output postscript file
94 
95  int i, optind;
96  Boption* option = get_option_list(use, argc, argv, optind);
97  Boption* curropt;
98  for ( curropt = option; curropt; curropt = curropt->next ) {
99  if ( curropt->tag == "mode" ) {
100  sym_mode = curropt->value.integer();
101  if ( sym_mode < 0 || sym_mode > 2 )
102  cerr << "-mode: A symmetry mode of 0, 1 or 2 must be specified!" << endl;
103  }
104  if ( curropt->tag == "TwoD" )
105  twoD_flag = 1;
106  if ( curropt->tag == "CTF" )
107  ctf_action = curropt->ctf_action();
108  if ( curropt->tag == "rescale" ) {
109  if ( curropt->values(nuavg, nustd) < 2 )
110  cerr << "-rescale: Both average and standard deviation must be specified!" << endl;
111  if ( nustd <= 0 )
112  cerr << "-rescale: A positive standard deviation must be specified!" << endl;
113  }
114  if ( curropt->tag == "datatype" )
115  nudatatype = curropt->datatype();
116  if ( curropt->tag == "size" )
117  map_size = curropt->size();
118  if ( curropt->tag == "sampling" )
119  sam = curropt->scale();
120  if ( curropt->tag == "scale" )
121  scale = curropt->scale();
122  if ( curropt->tag == "resolution" )
123  if ( ( resolution = curropt->value.real() ) < 1 )
124  cerr << "-resolution: A resolution limit must be specified!" << endl;
125  if ( curropt->tag == "interpolation" ) {
126  if ( curropt->value[0] == 'n' ) interp_type = 0;
127  if ( curropt->value[0] == 'w' ) interp_type = 1;
128  if ( curropt->value[0] == 't' ) interp_type = 2;
129  }
130  // Configuration
131  if ( curropt->tag == "bootstrap" )
132  bootstrap = 1;
133  if ( curropt->tag == "classes" )
134  classes = curropt->value;
135  if ( curropt->tag == "fullmap" ) nmaps += 1;
136  if ( curropt->tag == "halfmaps" ) nmaps += 2;
137  if ( curropt->tag == "threads" )
138  if ( ( nthreads = curropt->value.integer() ) < 1 )
139  cerr << "-threads: A number of threads must be specified!" << endl;
140  if ( curropt->tag == "filaments" ) filaments = 1;
141  if ( curropt->tag == "wiener" ) {
142  if ( ( wiener = curropt->value.real() ) < 0.000001 )
143  cerr << "-wiener: A Wiener factor must be specified!" << endl;
144  else {
145  if ( wiener < 0.01 ) wiener = 0.01;
146 // if ( wiener > 1 ) wiener = 1;
147  }
148  }
149  if ( curropt->tag == "pad" )
150  if ( ( pad_factor = curropt->value.integer() ) < 0 )
151  cerr << "-pad: A positive factor must be specified!" << endl;
152  if ( curropt->tag == "symmetry" )
153  sym = curropt->symmetry();
154  if ( curropt->tag == "reconstruction" )
155  reconsfile = curropt->filename();
156  if ( curropt->tag == "fom" )
157  fomfile = curropt->filename();
158  if ( curropt->tag == "output" )
159  outfile = curropt->filename();
160  if ( curropt->tag == "Postscript" )
161  ps_file = curropt->filename();
162  }
163  option_kill(option);
164 
165  double ti = timer_start();
166 
167  // Read all the parameter files
168  Bstring* file_list = NULL;
169  while ( optind < argc ) string_add(&file_list, argv[optind++]);
170  if ( !file_list ) {
171  cerr << "Error: No parameter files specified!" << endl;
172  bexit(-1);
173  }
174 
175  Bproject* project = read_project(file_list);
176  string_kill(file_list);
177 
178  if ( project == NULL ) {
179  cerr << "Error: No input file read!" << endl;
180  bexit(-1);
181  }
182 
183  if ( sam[0] > 0 ) {
184  if ( sam[0] < 0.1 ) sam = Vector3<double>(1,1,1);
186  }
187 
188  if ( verbose ) {
189  if ( twoD_flag )
190  cout << "2D reciprocal space reconstruction:" << endl;
191  else
192  cout << "3D reciprocal space reconstruction:" << endl;
193  }
194 
196  if ( npart < 1 ) {
197  cerr << "Error: No particles selected!" << endl;
198  bexit(-1);
199  }
200 
201  if ( nthreads < 2 ) nthreads = 2;
202  if ( nthreads > npart/2 ) nthreads = npart/2;
203 
204  if ( nmaps < 1 ) nmaps = 1;
205  if ( !nmaps%2 ) nmaps = 2;
206  if ( nmaps > 3 ) nmaps = 3;
207 
208  int nclasses(1);
209 
210  if ( filaments ) {
211  nclasses = part_set_filament_maps(project);
212  nmaps = 1;
213  } else {
214  nclasses = project_configure_for_reconstruction(project, classes, nmaps, nthreads);
215  }
216 
217  int ntotal = nclasses*nthreads;
218 
219  if ( nmaps & 2 && nthreads%2 ) nthreads++;
220 // cout << " nthreads = " << nthreads << endl;
221 
222  Bimage** pacc = new Bimage*[ntotal];
223  Bimage** prec = new Bimage*[nclasses*nmaps];
224  View ref_view;
225  Bstring filename = reconsfile;
226  Bstring id;
227  Breconstruction* rec = NULL;
229 
230  if ( map_size.volume() <= 0 )
231  map_size = project_set_reconstruction_size(project, scale[0], twoD_flag);
232 
233  if ( map_size.volume() <= 0 ) {
234  error_show("Error in breconstruct", __FILE__, __LINE__);
235  cerr << "No particles to determine the size from!" << endl << endl;
236  return -1;
237  }
238 
239  long ft_size = part->mg->box_size[0];
240  if ( map_size[0] > ft_size ) ft_size = map_size[0];
241 
242  ft_size = part_ft_size(ft_size, scale[0], pad_factor);
243 
244  if ( !sym ) sym = init_point_group_symmetry("C1");
245 
246  if ( verbose ) {
247  cout << "Map size: " << map_size << endl;
248  cout << "Symmetry: " << sym->label << endl;
249  cout << "Symmetry mode: " << sym_mode << endl;
250  cout << "Resolution limit: " << resolution << " A" << endl;
251  cout << "Scale: " << scale << endl;
252  cout << "Interpolation type: " << interp_type << endl;
253  cout << "CTF application type: " << ctf_action << endl;
254  if ( bootstrap ) cout << "Bootstrapping on" << endl;
255  cout << "Padding factor: " << pad_factor << endl;
256  cout << "Fourier transform size: " << ft_size << " x " << ft_size << endl << endl;
257  }
258 
259  long memreq = (ntotal+nmaps)*5*map_size.volume()*sizeof(float);
260  memory_check(memreq);
261 
262  fft_plan plan = fft_setup_plan(ft_size, ft_size, 1, FFTW_FORWARD, 1);
263 
264 #ifdef HAVE_GCD
265  dispatch_apply(ntotal, dispatch_get_global_queue(0, 0), ^(size_t i){
266  Bparticle* partlist = project_reconstruction_partlist(project, i+1, bootstrap);
267  pacc[i] = particle_reconstruct(partlist, sym, sym_mode,
268  resolution, scale, map_size, ft_size, plan,
269  interp_type, ctf_action, wiener, twoD_flag, bootstrap, (i==0));
270  particle_kill(partlist);
271  });
272 #else
273 #pragma omp parallel for
274  for ( i=0; i<ntotal; i++ ) {
275  Bparticle* partlist = project_reconstruction_partlist(project, i+1, bootstrap);
276  pacc[i] = particle_reconstruct(partlist, sym, sym_mode,
277  resolution, scale, map_size, ft_size, plan,
278  interp_type, ctf_action, wiener, twoD_flag, bootstrap, (i==0));
279  particle_kill(partlist);
280  }
281 #endif
282 
283  fft_destroy_plan(plan);
284 
285  if ( verbose )
286  cout << "Weighing " << nclasses*nmaps << " reconstructions" << endl;
287 
288 #ifdef HAVE_GCD
289  dispatch_apply(nclasses*nmaps, dispatch_get_global_queue(0, 0), ^(size_t i){
290  prec[i] = img_reconstruction_sum_weigh(pacc, i, nmaps, nthreads, resolution);
291  });
292 #else
293 #pragma omp parallel for
294  for ( i=0; i<nclasses*nmaps; i++ )
295  prec[i] = img_reconstruction_sum_weigh(pacc, i, nmaps, nthreads, resolution);
296 #endif
297 
298  for ( i=0; i<ntotal; i++ ) if ( pacc[i] ) delete pacc[i];
299  delete[] pacc;
300 
301  double fsccut[4] = {0.8,0.3,0.143,0}; // FSC cutoff values
302  double dprcut[4] = {0,0,0,0}; // DPR cutoff values
303  if ( nmaps > 1 ) {
304 // for ( i=nmaps-2; i<nclasses*nmaps; i+=nmaps ) {
305  for ( i=nmaps-2; i<nmaps; i+=nmaps ) {
306  Bplot* plot = prec[i]->fsc(prec[i+1], resolution);
307  plot->resolution_display(fsccut, dprcut);
308  if ( ps_file.length() ) ps_plot(ps_file, plot);
309  delete plot;
310  }
311  }
312 
313  if ( verbose )
314  cout << "Transforming " << nclasses*nmaps << " reconstructions to real space" << endl;
315 
316  plan = fft_setup_plan(prec[0]->size(), FFTW_BACKWARD, 1);
317 
318 #ifdef HAVE_GCD
319  dispatch_apply(nclasses*nmaps, dispatch_get_global_queue(0, 0), ^(size_t i){
320  prec[i]->fft_back(plan);
321  prec[i]->statistics();
322  prec[i]->calculate_background();
323  if ( sym_mode == 1 ) prec[i]->symmetrize(sym, 1);
324  if ( nustd > 0 ) prec[i]->rescale_to_avg_std(nuavg, nustd);
325  prec[i]->change_type(nudatatype);
326  });
327 #else
328 #pragma omp parallel for
329  for ( i=0; i<nclasses*nmaps; i++ ) {
330  prec[i]->fft_back(plan);
331  prec[i]->statistics();
332  prec[i]->calculate_background();
333  if ( sym_mode == 1 ) prec[i]->symmetrize(sym, 1);
334  if ( nustd > 0 ) prec[i]->rescale_to_avg_std(nuavg, nustd);
335  prec[i]->change_type(nudatatype);
336  }
337 #endif
338 
339  fft_destroy_plan(plan);
340 
341  // Write an output reconstruction if an output filename is given
342  for ( i=0; i<nclasses*nmaps; i++ ) {
343  imap = 0;
344  if ( nmaps == 2 ) imap = i%2 + 1;
345  else if ( nmaps == 3 ) imap = i%3;
346  if ( prec[i] && reconsfile.length() ) {
347  if ( interp_type == 2 ) prec[i]->filter_sinc();
348  if ( fomfile.length() ) {
349  filename = fomfile.pre_rev('.');
350  if ( nclasses > 1 ) filename += Bstring(i%nmaps + 1, "_%02d");
351  if ( imap ) filename += Bstring(imap, "_%02d");
352  filename += "." + fomfile.post_rev('.');
353  write_img(filename, prec[i]->next, 0);
354  }
355  prec[i]->symmetry(sym->label.str());
356  id = reconsfile.pre_rev('.');
357  if ( nclasses > 1 ) id += Bstring(i/nmaps + 1, "_%02d");
358  if ( imap ) id += Bstring(imap, "_%02d");
359  filename = id + "." + reconsfile.post_rev('.');
360  if ( verbose )
361  cout << "Writing " << filename << endl;
362  write_img(filename, prec[i], 0);
363  rec = reconstruction_add(&project->rec, id);
364  rec->frec = filename;
365  rec->voxel_size = prec[i]->image->sampling();
366  rec->origin = prec[i]->image->origin();
367  rec->symmetry = sym->label;
368  }
369  delete prec[i];
370  }
371 
372  if ( project && outfile.length() ) {
373  if ( verbose )
374  cout << "Writing " << outfile << endl;
375  write_project(outfile, project, 0, 0);
376  }
377 
378  delete[] prec;
379  kill_symmetry(sym);
381 
382  if ( verbose & VERB_TIME )
383  timer_report(ti);
384 
385  bexit(0);
386 }
387 
388 
Boption
A class for a command line input option.
Definition: options.h:26
mg_reconstruct.h
Functions for reconstruction.
project_kill
int project_kill(Bproject *project)
Frees a whole project.
Definition: mg_processing.cpp:429
mg_particle_select.h
Select particles.
Bimage::symmetry
string & symmetry()
Definition: Bimage.h:603
Bimage::symmetrize
double symmetrize(Bstring &symmetry_string, int flag)
Definition: Bimage.h:1188
ps_plot
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Definition: ps_plot.cpp:129
Boption::scale
Vector3< double > scale()
Definition: options.h:190
Bproject::rec
Breconstruction * rec
Definition: mg_processing.h:347
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:768
Bstring
Definition: Bstring.h:29
Breconstruction::voxel_size
Vector3< double > voxel_size
Definition: mg_processing.h:295
Bparticle
Definition: mg_processing.h:90
Bstring::post_rev
Bstring post_rev(char c)
Definition: Bstring.cpp:436
Bstring::integer
long integer()
Definition: Bstring.cpp:547
Boption::datatype
DataType datatype()
Definition: options.h:93
symmetry.h
Header file for general symmetry functions.
Bimage::filter_sinc
int filter_sinc()
Weighs an image with a sinc function.
Definition: Bimage_filter.cpp:365
Boption::next
Boption * next
Definition: options.h:28
Vector3< double >
bexit
int bexit(int value)
Exit function for cleanup and debugging.
Definition: utilities.cpp:280
get_option_list
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Definition: options.cpp:40
error_show
int error_show(string message, string file, int line)
Displays the error with file and line reference.
Definition: utilities.cpp:719
Bparticle::mg
Bmicrograph * mg
Definition: mg_processing.h:105
part_ft_size
int part_ft_size(int xsize, double scale, int pad_factor)
Sets the Fourier transform size for 2D particle images for reconstruction.
Definition: mg_reconstruct.cpp:38
Bplot
Definition: Bplot.h:146
Bstring::real
double real()
Definition: Bstring.cpp:553
options.h
Header file for option handlers.
Bimage::calculate_background
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Definition: Bimage_background.cpp:27
Bimage::fft_back
int fft_back()
Definition: Bimage.h:831
View
Definition: View.h:26
Bimage::image
Bsub_image * image
Definition: Bimage.h:202
Bplot::resolution_display
void resolution_display(double *fsccut=NULL, double *dprcut=NULL)
Definition: Bplot.cpp:114
Bsymmetry
Definition: symmetry.h:38
Boption::symmetry
Bsymmetry * symmetry()
Definition: options.h:240
Breconstruction::origin
Vector3< double > origin
Definition: mg_processing.h:296
memory_check
int memory_check(long mem_required)
Checking if there is enough memory, abort if not.
Definition: utilities.cpp:255
project
Bproject * project
Definition: bshow.cpp:33
Boption::tag
Bstring tag
Definition: options.h:29
Boption::values
long values(T1 &v1, T2 &v2)
Definition: options.h:115
rwmg.h
Header file for reading and writing micrograph parameters.
Bsub_image::origin
void origin(double x, double y, double z)
Definition: Bimage.h:136
project_set_mg_pixel_size
int project_set_mg_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the micrographs.
Definition: mg_processing.cpp:1997
write_img
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
Definition: rwimg.cpp:281
project_configure_for_reconstruction
int project_configure_for_reconstruction(Bproject *project, Bstring classes, long &nmaps, long &nthreads)
Sets up the particle selection for reconstruction.
Definition: mg_reconstruct.cpp:723
Bstring::str
string str()
Definition: Bstring.h:42
project_reconstruction_partlist
Bparticle * project_reconstruction_partlist(Bproject *project, int num_select, int bootstrap)
List of particle images for reciprocal space reconstruction.
Definition: mg_reconstruct.cpp:246
fft_destroy_plan
int fft_destroy_plan(fft_plan plan)
Deallocates a plan for fast Fourier transforms.
Definition: fft.cpp:87
particle_reconstruct
Bimage * particle_reconstruct(Bparticle *partlist, Bsymmetry *sym, int sym_mode, double hi_res, Vector3< double > scale, Vector3< long > size, int ft_size, fft_plan plan, int interp_type=0, int ctf_action=0, double wiener=0.2, int twoD_flag=0, int bootstrap=0, int first=0)
Reciprocal space reconstruction from 2D particle images.
Definition: mg_reconstruct.cpp:100
img_reconstruction_sum_weigh
Bimage * img_reconstruction_sum_weigh(Bimage **pacc, int imap, int nmaps, int nthreads, double hi_res)
Combines and weighs a map from several partial maps and weight sets.
Definition: mg_reconstruct.cpp:331
Boption::ctf_action
int ctf_action()
Definition: options.h:291
Boption::value
Bstring value
Definition: options.h:30
Bstring::pre_rev
Bstring pre_rev(char c)
Definition: Bstring.cpp:421
project_count_mg_part_selected
long project_count_mg_part_selected(Bproject *project)
Counts the number of particles in a project.
Definition: mg_select.cpp:437
Bimage
General image parameter class.
Definition: Bimage.h:177
timer.h
Utilities for timing functions.
part_find_first
Bparticle * part_find_first(Bproject *project)
Finds the first particle in a project.
Definition: mg_processing.cpp:283
Bproject
Definition: mg_processing.h:336
Unknown_Type
@ Unknown_Type
Definition: utilities.h:151
use
const char * use[]
Definition: breconstruct.cpp:24
VERB_TIME
#define VERB_TIME
Definition: utilities.h:114
timer_start
double timer_start()
Starts timer and prints the time.
Definition: timer.cpp:61
read_project
Bproject * read_project(const char *filename, int flags=0)
Reading micrograph parameters from files.
Definition: rwmg.cpp:141
utilities.h
Header file for general utilities.
Breconstruction::symmetry
Bstring symmetry
Definition: mg_processing.h:289
Boption::size
Vector3< long > size()
Definition: options.h:163
verbose
int verbose
Bmicrograph::box_size
Vector3< long > box_size
Definition: mg_processing.h:233
main
int main(int argc, char **argv)
Definition: breconstruct.cpp:68
Breconstruction
Definition: mg_processing.h:283
fft_setup_plan
fft_plan fft_setup_plan(long x, long y, long z, fft_direction dir, int opt)
Sets up a plan for fast Fourier transforms.
Definition: fft.cpp:31
Bstring::length
long length() const
Definition: Bstring.cpp:263
init_point_group_symmetry
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
Definition: symmetry.cpp:39
timer_report
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Definition: timer.cpp:76
Bimage::fsc
Bplot * fsc(double hi_res, double sampling_ratio=1)
Definition: Bimage_resolution.cpp:245
Bimage::change_type
void change_type(char letter)
Get the data type indicated by a single letter code.
Definition: Bimage.cpp:1765
Vector3::volume
double volume()
Definition: Vector3.h:237
rwimg.h
Header file for 2D and 3D image I/O.
write_project
int write_project(const char *filename, Bproject *project)
Writing micrograph parameters to a file.
Definition: rwmg.cpp:321
Matrix.h
Generalized matrix class.
mg_processing.h
Header file for micrograph processing.
fft_plan
fftwf_plan fft_plan
Definition: fft.h:20
Bsub_image::sampling
void sampling(double x, double y, double z)
Definition: Bimage.h:127
kill_symmetry
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Definition: symmetry.cpp:207
Boption::filename
Bstring filename()
Definition: options.h:85
option_kill
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Definition: options.cpp:111
Breconstruction::frec
Bstring frec
Definition: mg_processing.h:290
DataType
DataType
Base data type specifier.
Definition: utilities.h:150
Bsymmetry::label
Bstring label
Definition: symmetry.h:41
particle_kill
int particle_kill(Bparticle *part)
Frees a list of particles.
Definition: mg_processing.cpp:528
reconstruction_add
Breconstruction * reconstruction_add(Breconstruction **rec, Bstring &rec_id)
Adds a reconstruction parameter structure to a linked list.
Definition: mg_processing.cpp:398
project_set_reconstruction_size
Vector3< long > project_set_reconstruction_size(Bproject *project, double scale, int twoD_flag)
Sets the reconstruction size for reconstruction from 2D particle images.
Definition: mg_reconstruct.cpp:658
string_add
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Definition: Bstring.cpp:713
Bimage::statistics
long statistics()
Calculates the statistics for an image.
Definition: Bimage_stats.cpp:22
part_set_filament_maps
long part_set_filament_maps(Bproject *project)
Generates a selection number from the group number for each filament.
Definition: mg_particle_select.cpp:645
Bimage::rescale_to_avg_std
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.
Definition: Bimage_rescale.cpp:163