Bsoft  2.1.0
Bernard's software package
model_occupancy.cpp
Go to the documentation of this file.
1 
9 #include "model_occupancy.h"
10 #include "binomial.h"
11 #include "ps_plot.h"
12 #include "img_combine.h"
13 #include "model_extract_build.h"
14 #include "model_compare.h"
15 #include "model_util.h"
16 #include "math_util.h"
17 #include "utilities.h"
18 #include "linked_list.h"
19 
20 // Declaration of global variables
21 extern int verbose; // Level of output to the screen
22 
23 //Internal function prototypes
24 double component_coverage(Bimage* p, int img_num, Bcomponent* comp, double threshold);
25 
45 int model_occupancy(Bmodel* model, Bimage* pmask, double mol_weight, double rho, double cutoff, int invert_flag)
46 {
47  double threshold;
48  double f, sigma;
49  Vector3<double> shift, loc;
50  Bmodel* mp;
51  Bcomponent* comp;
52  Bimage* p = NULL;
53 
54  if ( verbose & VERB_PROCESS ) {
55  cout << "Model component occupancy:" << endl;
56  cout << "Molecular weight: " << mol_weight << " Da (rho = " << rho << " Da/Å)" << endl;
57  cout << "Component coverage cutoff: " << cutoff << endl << endl;
58  }
59 
60  for ( mp = model; mp; mp = mp->next ) {
61  p = read_img(mp->fmap, 1, mp->img_num);
62 
63  if ( invert_flag ) p->invert();
64 
65  //Determine an intensity treshold for the subimage
66  if ( mol_weight > 0 )
67  threshold = p->mass_threshold(0, mol_weight, rho);
68  else
69  threshold = p->average() + p->standard_deviation();
70 
71  if ( verbose & VERB_PROCESS )
72  cout << "Intensity Threshold for MW = " << mol_weight << " is " << threshold << endl;
73 
74  //Mask the shell or other region in the subimage
75 // if ( pmask ) img_multiply(p, pmask, 1, 0);
76  if ( pmask ) p->multiply(pmask);
77 // write_img("masked_img.pif", p);
78 
79  //Evaluate intensity of voxels for each component and decide its occupancy
80  if ( verbose & VERB_PROCESS )
81  cout << "Model\tComponent\tdx\tdy\tdz\tDensity\tCoverage\tOccupancy" << endl;
82  for ( comp = mp->comp; comp; comp = comp->next ) {
83  loc = comp->loc/p->sampling(0) + p->image->origin(); // location of the component in the map (Å->vox)
84 // comp->density = img_density_in_marker(p, loc, comp->radius/p->sampling(0)[0], sigma); // weighted average of intensity
85  comp->density = p->density(0, loc, comp->radius/p->sampling(0)[0], sigma); // weighted average of intensity
86  f = component_coverage(p, 0, comp, threshold);
87  if ( f >= cutoff ) comp->sel = 1;
88  else comp->sel = 0;
89  comp->fom = f;
90  shift = comp->loc - comp->vec;
91  if ( verbose & VERB_PROCESS )
92  cout << mp->id << tab << comp->id << tab << fixed <<
93  setprecision(2) << shift[0] << tab << shift[1] << tab << shift[2] << tab <<
94  setprecision(4) << comp->density << tab << comp->fom << tab << comp->sel << endl;
95  }
96  if ( verbose & VERB_PROCESS )
97  cout << endl;
98 
99  delete p;
100  }
101 
102  return 0;
103 }
104 
126 vector<double> model_occupancy_distribution(Bmodel* model, double cutoff, int nfit,
127  long& ncomp, vector<double>& prob, double& R)
128 {
129  long i, j, k, h, occ, bins, nsets(3+nfit);
130  double c, s;
131  Bmodel* mp;
132  Bcomponent* comp;
133 
135  bins = ncomp + 1;
136 
137  vector<double> dist(bins);
138  vector<double> disterrfit(bins*nsets);
139  vector<double> sum(bins);
140  vector<double> sum2(bins);
141 
142  for ( i=k=0; i<bins; i++ ) {
143  dist[i] = sum[i] = sum2[i] = 0;
144  for ( j=0; j<nsets; j++, k++ ) disterrfit[k] = 0;
145  }
146 
147  for ( mp = model; mp; mp = mp->next ) {
148  for ( occ=0, comp = mp->comp; comp; comp = comp->next )
149  if ( comp->fom >= cutoff ) occ++;
150  disterrfit[occ]++;
151  }
152  for ( s=0, i=0; i<bins; i++ ) s += disterrfit[i];
153  for ( i=0; i<bins; i++ ) disterrfit[i] /= s;
154 
155 
156  for ( c = cutoff - 0.2; c <= cutoff + 0.2; c += 0.1 ) {
157  for ( i=0; i<bins; i++ ) dist[i] = 0;
158  for ( mp = model; mp; mp = mp->next ) {
159  for ( occ=0, comp = mp->comp; comp; comp = comp->next )
160  if ( comp->fom >= c ) occ++;
161  dist[occ]++;
162  }
163  for ( s=0, i=0; i<bins; i++ ) s += dist[i];
164  for ( i=0; i<bins; i++ ) {
165  dist[i] /= s;
166  sum[i] += dist[i];
167  sum2[i] += dist[i]*dist[i];
168  }
169  }
170 
171  for ( i=0, j=bins; i<bins; i++, j++ ) {
172  s = sum2[i]/5 - sum[i]*sum[i]/25;
173  if ( s > 0 ) disterrfit[j] = sqrt(s);
174  }
175 
176  R = binomial_fit(disterrfit, ncomp, nfit, prob);
177 
178  // Order distribution fits in ascending probability order
179  for ( i=0, k=nfit; i<nfit-1; i++, k++ ) {
180  for ( j=i+1, h=j+nfit; j<nfit; j++, h++ ) {
181  if ( prob[k] > prob[h] ) {
182  swap(prob[i], prob[j]);
183  swap(prob[k], prob[h]);
184  }
185  }
186  }
187 
188  for ( i=0, j=3; i<nfit; i++, j++ ) {
189  for ( k=0, h=j*bins; k<bins; k++, h++ )
190  disterrfit[h] = Bnpk(ncomp, prob[nfit+i], k, prob[i]);
191  for ( k=0, h=2*bins; k<bins; k++, h++ )
192  disterrfit[h] += disterrfit[j*bins+k];
193  }
194 
195  // Print results
196  if ( verbose ) {
197  cout << endl << "Binomial distributions:" << endl;
198  cout << "#\tWeight\tProbability" << endl;
199  for ( i=0; i<nfit; i++)
200  cout << i+1 << tab << prob[i] << tab << prob[nfit+i] << endl;
201  cout << "Residual: " << R << endl;
202  cout << endl << "Occup\t Models\t Std\t Fit";
203  for ( j=0; j<nfit; j++) cout << "\tB" << j+1;
204  cout << endl;
205 
206  for ( i=0; i<bins; i++ ) {
207  cout << i << tab << disterrfit[i] << tab << disterrfit[bins+i] << tab << disterrfit[2*bins+i];
208  for ( j=0; j<nfit; j++)
209  cout << "\t " << disterrfit[(3+j)*bins+i];
210  cout << endl;
211  }
212  cout << endl;
213  }
214 
215  return disterrfit;
216 }
217 
238  double hires, double lores, double max_shift)
239 {
240  if ( max_shift <= 0 ) max_shift = 1e37;
241 
242  Bimage* p = read_img(model->fmap, 1, model->img_num); // reads only the appropriate subimage from the image file for the given model
243  if ( p == NULL ) {
244  cerr << "Error: No model map file read! (" << model->fmap << ")" << endl;
245  bexit(-1);
246  }
247  else if ( pmask2 )
248 // img_multiply(p, pmask2, 1, 0);
249  p->multiply(pmask2);
250 
251 
252  p->change_type(Float);
253  ptemp->change_type(Float);
254 
255  if ( hires > lores ) swap(hires, lores);
256 
257  double searchradius = model->comp->radius*2/ptemp->sampling(0)[0]; // radius for cross-correlation (max. shift about 2r)
258  double radius = model->comp->radius/ptemp->sampling(0)[0]; // radius for determination of intensity [avg,std] within a given component
259 
260 
261  if ( verbose ) {
262  cout << "Refinement of component locations for model " << model->id << ":" << endl;
263  cout << "Radius for determination of average intensity: " << radius << " voxels" << endl;
264  cout << "Radius for cross-correlation search: " << searchradius << " voxels" << endl << endl;
265  cout << "Refining component positions:" << endl;
266  cout << "Resolution limits: " << hires << " " << lores << " A" << endl;
267  cout << "Maximum shift: " << max_shift << " A" << endl;
268  cout << "Search radius: " << searchradius << endl;
269  cout << "Density radius: " << radius << endl << endl;
270  }
271 
272  int ncomp(0);
273  long n, imax(0);
274  double cc, dist12, dist10, dist20;
275  double sigma1, sigma2;
276  double ccmax, s, d, ccavg(0), d1avg(0), d2avg(0);
277  Vector3<double> zero_origin;
278  Vector3<int> size(ptemp->size());
279  Vector3<double> origin(ptemp->image->origin());
280  Vector3<double> map_origin(p->image->origin());
281  Vector3<double> scale(ptemp->sampling(0));
282  Vector3<double> r, loc, comp_shift, shift_avg;
283  Vector3<double> shift;
284  Bimage* pcomp = NULL;
285  Bimage* pone = NULL;
286  Bimage* pmaskrot = NULL;
287 
288  Bcomponent* comp;
289  Bcomponent* comp2;
290  Matrix3 mat;
291  int* num = new int[ptemp->images()];
292  for ( n=0; n<ptemp->images(); n++ ) num[n] = 0;
293 
294  double diameter; // in angstroms
295 
296  for ( ncomp=0, comp = model->comp; comp; comp = comp->next, ncomp++ ) {
297  ccmax = -1;
298  loc = comp->loc/scale + map_origin; // location of the component in the map (Å->vox)
299  comp->density = p->density(0, loc, radius, sigma1); // weighted average of intensity
300  d1avg += comp->density;
301  sigma2 = sigma1;
302  comp->vec = comp->loc;
303  comp_shift = 0;
304  mat = comp->view.matrix(); // transformation matrix (local->global?)
305  // Extracts a density associated with a set of coordinates in a model. (size from the density template, only one component)
306  pcomp = p->extract(0, loc, size, origin, mat);
307  // Transform of the image mask
308  if ( pmask ) pmaskrot = pmask->extract_wrap(0, size, mat);
309  for ( n=0; n<ptemp->images(); n++ ) { // cycle over subimages in the template
310  pone = ptemp->extract(n); //extracts image of the template
311  pone->origin(origin);
312  // find a shift to match the extracted image density and the template
313  shift = pcomp->find_shift(pone, pmaskrot, hires, lores, searchradius, 0, 0, cc);
314  if ( verbose & VERB_FULL )
315  cout << "Shift = " << shift << endl;
316  if ( ccmax < cc ) { // if the cross-correlation coef is higher than before
317  ccmax = cc;
318  imax = n;
319  comp_shift = mat * shift; // component shift in global coordinates
320  }
321  delete pone;
322  }
323  delete pcomp;
324  delete pmaskrot;
325 
326  loc += comp_shift; // new location of the component (in voxels)
327  comp->loc = scale * (loc - map_origin);
328  comp_shift = comp->loc - comp->vec; // shift of the component in Å
329  num[imax]++; // stores number of copies of each subimage of the template
330  p->density(0, loc, radius, sigma2); // weighted average of intensity
331  if ( verbose & VERB_FULL )
332  cout << "Sigma1=" << sigma1 << "\t Sigma2=" << sigma2 << endl;
333  s = comp_shift.length();
334 
335  // Test for overlapping components
336  for ( comp2 = model->comp; comp2 && comp2 != comp; comp2 = comp2->next ) {
337  dist12 = comp->loc.distance(comp2->loc);
338  diameter = comp->radius + comp2->radius;
339  if ( dist12 < diameter ) {
340  dist10 = comp->loc.distance(comp->vec);
341  dist20 = comp2->loc.distance(comp2->vec);
342  if ( dist10 < dist20 ) { // zero the longer shift
343  comp2->loc = comp2->vec;
344  } else {
345  comp->loc = comp->vec;
346  s = 0;
347  }
348  }
349  }
350 
351  // shift only when within the maximal allowed radius and sigma of intensity is smaller
352  if ( s > 0 && s < max_shift && sigma1 > sigma2 ) {
353  comp->sel = imax; // select alignment to the best template subimage
354  comp->fom = ccmax; // update fom to the highest cc
355  } else {
356  comp->loc = comp->vec;
357  if ( verbose & VERB_FULL )
358  cout << "Component " << ncomp+1 << " was not shifted!" << endl;
359  }
360 
361  }
362 
363  if ( verbose )
364  cout << "Comp\tdx\tdy\tdz\tShift\tCC\tDens1\tDens2\tdDens" << endl;
365 
366  for ( ncomp=0, comp = model->comp; comp; comp = comp->next, ncomp++ ) {
367  d = comp->density;
368 // comp->density = img_density_in_marker(p, comp->loc/scale + map_origin, radius, sigma2);
369  comp->density = p->density(0, comp->loc/scale + map_origin, radius, sigma2); // weighted average of intensity
370  d2avg += comp->density;
371  comp_shift = comp->loc - comp->vec;
372  shift_avg += comp_shift;
373  ccavg += comp->fom;
374  if ( verbose )
375  cout << ncomp+1 << tab << comp_shift[0] << tab << comp_shift[1]
376  << tab << comp_shift[2] << tab << comp_shift.length() << tab
377  << comp->fom << tab << d << tab << comp->density << tab << comp->density - d << endl;
378  }
379 
380  shift_avg /= ncomp; // average shift (vector)
381  s = shift_avg.length(); // average length of the shift
382  ccavg /= ncomp; // average cc
383  d1avg /= ncomp; // average density in the original components
384  d2avg /= ncomp; // average density in the shifted components
385 
386  if ( verbose ) {
387  cout << "Average\t" << shift_avg[0] << tab << shift_avg[1] << tab
388  << shift_avg[2] << tab << s << tab << ccavg << tab << d1avg
389  << tab << d2avg << tab << d2avg - d1avg << endl << endl;
390  cout << "Component type distribution:\n#\tCount" << endl;
391  for ( n=0; n<ptemp->images(); n++ ) cout << n+1 << tab << num[n] << endl;
392  cout << endl;
393  }
394 
395  delete[] num;
396  delete p;
397 
398  return 0;
399 }
400 
401 /*
402 @author Daniel Nemecek and Bernard Heymann
403 @brief Calculates the coverage of the component in a map.
404 @param *p image.
405 @param img_num sub-image number.
406 @param comp component.
407 @param threshold threshold to count covered voxels.
408 @return double fraction of examined sphere covered.
409 
410  The map must have positive density (higher values are considered density).
411  The coverage for a component is defined as the fraction of voxels within
412  a sphere around the component location that is above the threshold.
413  The radius of the sphere is taken from the component radius.
414 **/
415 double component_coverage(Bimage* p, int img_num, Bcomponent* comp, double threshold)
416 {
417  int n(0), np(0);
418  long i, x, y, z;
419  double a(1), b(1), c(1), fx, fy, fz;
420  double value, fraction(0);
421  Vector3<int> start;
422  Vector3<int> end;
423 
424  start[0] = (int) (p->image->origin()[0] + (comp->loc[0] - comp->radius)/p->sampling(0)[0]);
425  start[1] = (int) (p->image->origin()[1] + (comp->loc[1] - comp->radius)/p->sampling(0)[1]);
426  start[2] = (int) (p->image->origin()[2] + (comp->loc[2] - comp->radius)/p->sampling(0)[2]);
427  end[0] = (int) (p->image->origin()[0] + (comp->loc[0] + comp->radius)/p->sampling(0)[0]);
428  end[1] = (int) (p->image->origin()[1] + (comp->loc[1] + comp->radius)/p->sampling(0)[1]);
429  end[2] = (int) (p->image->origin()[2] + (comp->loc[2] + comp->radius)/p->sampling(0)[2]);
430 
431  if ( verbose & VERB_DEBUG ) {
432  cout << "DEBUG component_coverage: start=" << start << endl;
433  cout << "DEBUG component_coverage: end=" << end << endl;
434  }
435 
436  if ( ( start[0] < 0 ) && ( end[0] < 0 ) ) return 0;
437  if ( ( start[1] < 0 ) && ( end[1] < 0 ) ) return 0;
438  if ( ( start[2] < 0 ) && ( end[2] < 0 ) ) return 0;
439  if ( ( start[0] >= p->sizeX() ) && ( end[0] >= p->sizeX() ) ) return 0;
440  if ( ( start[1] >= p->sizeY() ) && ( end[1] >= p->sizeY() ) ) return 0;
441  if ( ( start[2] >= p->sizeZ() ) && ( end[2] >= p->sizeZ() ) ) return 0;
442  start = start.max(0);
443  end = end.max(0);
444  if ( start[0] >= p->sizeX() ) start[0] = p->sizeX() - 1;
445  if ( start[1] >= p->sizeY() ) start[1] = p->sizeY() - 1;
446  if ( start[2] >= p->sizeZ() ) start[2] = p->sizeZ() - 1;
447  if ( end[0] >= p->sizeX() ) end[0] = p->sizeX() - 1;
448  if ( end[1] >= p->sizeY() ) end[1] = p->sizeY() - 1;
449  if ( end[2] >= p->sizeZ() ) end[2] = p->sizeZ() - 1;
450  if ( start[0] > end[0] ) swap(start[0], end[0]);
451  if ( start[1] > end[1] ) swap(start[1], end[1]);
452  if ( start[2] > end[2] ) swap(start[2], end[2]);
453 
454  Vector3<int> size = end - start;
455  Vector3<double> center;
456  center[0] = start[0] + size[0]/2.0;
457  center[1] = start[1] + size[1]/2.0;
458  center[2] = start[2] + size[2]/2.0;
459  if ( size[0] ) a = 2.0/size[0];
460  if ( size[1] ) b = 2.0/size[1];
461  if ( size[2] ) c = 2.0/size[2];
462  a *= a;
463  b *= b;
464  c *= c;
465 
466  if ( verbose & VERB_DEBUG ) {
467  cout << "DEBUG component_coverage: start=" << start << endl;
468  cout << "DEBUG component_coverage: end=" << end << endl;
469  cout << "DEBUG component_coverage: center=" << center << endl;
470  }
471 
472  for ( n=0, z=start[2]; z<=end[2]; z++ ) {
473  fz = z - center[2];
474  fz = c*fz*fz;
475  for ( y=start[1]; y<=end[1]; y++ ) {
476  fy = y - center[1];
477  fy = b*fy*fy;
478  for ( x=start[0]; x<=end[0]; x++ ) {
479  fx = x - center[0];
480  fx = a*fx*fx;
481  if ( fx + fy + fz <= 1 ) {
482  i = p->index(0, x, y, z, img_num);
483  value = (*p)[i];
484  if ( value > threshold ) np++;
485  n++;
486  }
487  }
488  }
489  }
490 
491  if ( n ) fraction = np*1.0L/n;
492 
493  return fraction;
494 }
495 
496 
497 
Bcomponent::next
Bcomponent * next
Definition: rwmodel.h:52
Bimage::sizeZ
void sizeZ(long nz)
Definition: Bimage.h:392
Bcomponent
Definition: rwmodel.h:51
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
Bcomponent::loc
Vector3< float > loc
Definition: rwmodel.h:58
model_extract_build.h
Functions to extract subvolumes and build new maps.
Bcomponent::id
Bstring id
Definition: rwmodel.h:53
Bimage::extract_wrap
Bimage * extract_wrap(long nn, Vector3< double > loc, Vector3< long > size, Vector3< double > origin, Matrix3 mat)
Extracts a region of one sub-image into new image structure with wrapping.
Definition: Bimage_extract.cpp:151
component_coverage
double component_coverage(Bimage *p, int img_num, Bcomponent *comp, double threshold)
Definition: model_occupancy.cpp:415
Vector3< double >
Bimage::sizeX
void sizeX(long nx)
Definition: Bimage.h:390
bexit
int bexit(int value)
Exit function for cleanup and debugging.
Definition: utilities.cpp:280
Bmodel::next
Bmodel * next
Definition: rwmodel.h:120
Bimage::size
Vector3< long > size() const
Definition: Bimage.h:386
model_occupancy.h
Library routines to count components in maps.
model_occupancy_distribution
vector< double > model_occupancy_distribution(Bmodel *model, double cutoff, int nfit, long &ncomp, vector< double > &prob, double &R)
Calculates the occupancy distribution of models.
Definition: model_occupancy.cpp:126
Bimage::find_shift
int find_shift(Bimage *pref, Bimage *pmask, double hires, double lores, double radius, double sigma, int refine_flag)
Calculates a cross-correlation map to find the shift for the pair of images.
Definition: Bimage_correlate.cpp:929
Bimage::image
Bsub_image * image
Definition: Bimage.h:202
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:111
Bnpk
double Bnpk(int n, double p, int k, double w)
Calculates the probability of k occurrences in n cases.
Definition: binomial.cpp:28
model_compare.h
Functions to compare models and components.
Bimage::standard_deviation
double standard_deviation()
Definition: Bimage.h:544
ps_plot.h
Header file for postscript output functions.
Bmodel::fmap
Bstring fmap
Definition: rwmodel.h:125
Vector3::distance
double distance(const Vector3 &v)
Definition: Vector3.h:227
Bimage::density
double density(long nn, Vector3< double > coord, double radius, double &sigma)
Calculates the density in a sphere around a coordinate in an image.
Definition: Bimage.cpp:3012
Bimage::images
long images()
Definition: Bimage.h:504
Bimage::mass_threshold
double mass_threshold(long img_num, double mol_weight, double rho)
Finds the density threshold associated with a particular molecular weight.
Definition: Bimage_segment.cpp:820
Bmodel::comp
Bcomponent * comp
Definition: rwmodel.h:132
Matrix3
Definition: Matrix3.h:18
read_img
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Definition: rwimg.cpp:77
Bsub_image::origin
void origin(double x, double y, double z)
Definition: Bimage.h:136
Bcomponent::vec
Vector3< float > vec
Definition: rwmodel.h:60
Bimage::multiply
void multiply(long j, Complex< double > cv)
Definition: Bimage.h:325
Bimage::sizeY
void sizeY(long ny)
Definition: Bimage.h:391
Bmodel::id
Bstring id
Definition: rwmodel.h:121
model_occupancy
int model_occupancy(Bmodel *model, Bimage *pmask, double mol_weight, double rho, double cutoff, int invert_flag)
Calculates the occupancy of components in a map.
Definition: model_occupancy.cpp:45
model_maxnum_components
long model_maxnum_components(Bmodel *model)
Calculates the largest number of components in a model.
Definition: model_compare.cpp:43
Bimage
General image parameter class.
Definition: Bimage.h:177
Bimage::average
double average(long cc, double xf, double yf, double zf, long nn, double iscale)
Averages in 3D when scaling is less than 1.
Definition: Bimage.cpp:1371
model_refine_comp_for_occupancy
int model_refine_comp_for_occupancy(Bmodel *model, Bimage *pmask2, Bimage *ptemp, Bimage *pmask, double hires, double lores, double max_shift)
Refines component views and positions by cross-correlation.
Definition: model_occupancy.cpp:237
Bmodel
Definition: rwmodel.h:119
utilities.h
Header file for general utilities.
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:22
Bmodel::img_num
int img_num
Definition: rwmodel.h:127
Bcomponent::view
View view
Definition: rwmodel.h:59
Bcomponent::fom
float fom
Definition: rwmodel.h:65
Bimage::origin
void origin(double ox, double oy, double oz)
Definition: Bimage.h:570
Bimage::change_type
void change_type(char letter)
Get the data type indicated by a single letter code.
Definition: Bimage.cpp:1765
model
Bmodel * model
Definition: bshow.cpp:34
Bimage::index
long index(long nx, long ny) const
Definition: Bimage.h:396
binomial_fit
double binomial_fit(vector< double > &distrib, int n, int nfit, vector< double > &coeff)
Fits a distribution to one or more binomial distributions.
Definition: binomial.cpp:89
Bimage::extract
Bimage * extract(long nn)
Extracts one sub-image into new image structure.
Definition: Bimage_extract.cpp:21
linked_list.h
Header file for generalized linked list functions.
math_util.h
Header file for general utilities.
VERB_FULL
#define VERB_FULL
Definition: utilities.h:113
Bimage::invert
void invert()
Inverts the data in the image.
Definition: Bimage.cpp:3111
model_util.h
Library routines used for model processing.
img_combine.h
Header file for combining two images in various ways.
Bimage::sampling
void sampling(long nn, Vector3< double > u)
Definition: Bimage.h:514
binomial.h
Functions to generate and fit binomials.
View::matrix
Matrix3 matrix()
Definition: View.h:153
Bcomponent::radius
float radius
Definition: rwmodel.h:62
Vector3::length
double length()
Definition: Vector3.h:222
verbose
int verbose
Float
@ Float
Definition: utilities.h:161
Bcomponent::density
float density
Definition: rwmodel.h:64
Bcomponent::sel
int sel
Definition: rwmodel.h:66
Vector3::max
Type max()
Definition: Vector3.h:175