Bsoft  2.1.0
Bernard's software package
model_mask.cpp
Go to the documentation of this file.
1 
9 #include "rwmodel.h"
10 #include "model_mask.h"
11 #include "model_shell.h"
12 #include "model_util.h"
13 #include "matrix_linear.h"
14 #include "Vector3.h"
15 #include "linked_list.h"
16 #include "utilities.h"
17 
18 // Declaration of global variables
19 extern int verbose; // Level of output to the screen
20 
21 
36  Vector3<double> ori, Vector3<double> sam, double edge)
37 {
38  if ( sam[0] <= 0) sam = sam.max(1);
39 
40  long i, nv;
41  double width = edge/sam[0];
42  Vector3<double> loc, start, end;
43  Bcomponent* comp;
44  Blink* link;
45 
46  Bimage* p = new Bimage(Float, TSimple, size, 1);
47  if ( ori[0] == 0 && ori[1] == 0 && ori[2] == 0 )
48  p->origin(p->default_origin());
49  else
50  p->origin(ori);
51  ori = p->image->origin();
52  p->sampling(sam);
53 
54  long datasize = p->data_size();
55 
56  if ( verbose ) {
57  cout << "Generating a model mask:" << endl;
58  cout << "Size: " << p->size() << endl;
59  cout << "Origin: " << p->image->origin() << endl;
60  cout << "Sampling: " << p->sampling(0) << " A/voxel" << endl;
61  }
62 
63  for ( comp = model->comp; comp; comp = comp->next ) {
64  loc[0] = (long) (comp->loc[0]/p->sampling(0)[0] + p->image->origin()[0] + 0.5);
65  loc[1] = (long) (comp->loc[1]/p->sampling(0)[1] + p->image->origin()[1] + 0.5);
66  loc[2] = (long) (comp->loc[2]/p->sampling(0)[2] + p->image->origin()[2] + 0.5);
67  p->sphere(loc, comp->radius/p->sampling(0)[0], width, FILL_USER, 1);
68  }
69 
70  for ( link = model->link; link; link = link->next ) {
71  start[0] = (long) (link->comp[0]->loc[0]/p->sampling(0)[0] + p->image->origin()[0] + 0.5);
72  start[1] = (long) (link->comp[0]->loc[1]/p->sampling(0)[1] + p->image->origin()[1] + 0.5);
73  start[2] = (long) (link->comp[0]->loc[2]/p->sampling(0)[2] + p->image->origin()[2] + 0.5);
74  end[0] = (long) (link->comp[1]->loc[0]/p->sampling(0)[0] + p->image->origin()[0] + 0.5);
75  end[1] = (long) (link->comp[1]->loc[1]/p->sampling(0)[1] + p->image->origin()[1] + 0.5);
76  end[2] = (long) (link->comp[1]->loc[2]/p->sampling(0)[2] + p->image->origin()[2] + 0.5);
77  p->bar(start, end, 2*link->radius/p->sampling(0)[0], width, FILL_USER, 1);
78  }
79 
80  // Calculate the mask volume
81  for ( i=nv=0; i<datasize; i++ ) if ( (*p)[i] > 0.5 ) nv++;
82 
83  if ( verbose )
84  cout << "Mask volume: " << nv * sam.volume() << " A3" << endl << endl;
85 
86  return p;
87 }
88 
105  Vector3<double> ori, Vector3<double> sam, int curv_flag, int fast)
106 {
107  if ( sam[0] <= 0) sam = sam.max(1);
108 
109  long i, nv, x, y, z;
110  double d, min = 1e30, max = 0;
111  Vector3<double> vec;
112  Bcomponent* comp;
113 
114  Bimage* p = new Bimage(Float, TSimple, size, 1);
115  if ( ori[0] == 0 && ori[1] == 0 && ori[2] == 0 )
116  p->origin(p->default_origin());
117  else
118  p->origin(ori);
119  ori = p->image->origin();
120  p->sampling(sam);
121 
122  if ( verbose ) {
123  cout << "Generating a hull mask:" << endl;
124  cout << "Size: " << p->size() << endl;
125  cout << "Origin: " << p->image->origin() << endl;
126  cout << "Sampling: " << p->sampling(0) << " A/voxel" << endl;
127  cout << "Surface: ";
128  if ( curv_flag ) cout << "Curved" << endl;
129  else cout << "Planar" << endl;
130  }
131 
132  // Calculate the center of the vertices
134  center /= sam;
135 
136 // cout << "center=" << center << endl;
137 
138  // Calculate the minimum and maximum distances from the center
139  for ( comp = model->comp; comp; comp = comp->next ) {
140  comp->vec = (comp->loc/p->sampling(0)) - center;
141  d = comp->vec.length();
142  if ( min > d ) min = d;
143  if ( max < d ) max = d;
144  }
145 
146  if ( curv_flag < 1 ) min = 0;
147 
148  center += ori;
149 
150 // cout << "center=" << center << endl;
151 
152  // Calculate the mask
153  for ( i=z=nv=0; z<p->sizeZ(); z++ ) {
154  if ( verbose & VERB_FULL )
155  cout << "Calculating slice " << z << endl;
156  vec[2] = z - center[2];
157  for ( y=0; y<p->sizeY(); y++ ) {
158  vec[1] = y - center[1];
159  for ( x=0; x<p->sizeX(); x++, i++ ) {
160  vec[0] = x - center[0];
161  d = vec.length();
162  if ( d < min ) p->set(i,1);
163  else if ( d > max ) p->set(i,0);
164  else if ( model_inside_outside(vec, model, curv_flag, fast) > 0 ) p->set(i,1);
165  if ( (*p)[i] ) nv++;
166  }
167  }
168  }
169 
170  if ( verbose )
171  cout << "Mask volume: " << nv * sam.volume() << " A3" << endl << endl;
172 
173  return p;
174 }
175 
193  Vector3<double> ori, Vector3<double> sam, double shell_width, int curv_flag, int fast)
194 {
195  if ( sam[0] <= 0) sam = sam.max(1);
196 
197  long i, x, y, z, nv=0, ni=0, no=0;
198  double d, min = 1e30, max = 0, half_width = shell_width/(2*sam[0]);
199  if ( half_width < 0.5 ) half_width = 0.5;
200  shell_width = 2*sam[0]*half_width;
201 
202  Vector3<double> vec;
203  Bcomponent* comp;
204 
205  Bimage* p = new Bimage(Float, TSimple, size, 1);
206  if ( ori[0] == 0 && ori[1] == 0 && ori[2] == 0 )
207  p->origin(p->default_origin());
208  else
209  p->origin(ori);
210  ori = p->image->origin();
211  p->sampling(sam);
212 
213  if ( verbose ) {
214  cout << "Generating a shell mask:" << endl;
215  cout << "Size: " << p->size() << endl;
216  cout << "Origin: " << p->image->origin() << endl;
217  cout << "Sampling: " << p->sampling(0) << " A/voxel" << endl;
218  cout << "Shell width: " << shell_width << " A" << endl;
219  if ( curv_flag ) cout << "Curved" << endl;
220  else cout << "Planar" << endl;
221  }
222 
223  // Calculate the center of the vertices
225  center /= sam;
226 
227  // Calculate the minimum and maximum distances from the center
228  for ( comp = model->comp; comp; comp = comp->next ) {
229  comp->vec = (comp->loc/p->sampling(0)) - center;
230  d = comp->vec.length();
231  if ( min > d ) min = d;
232  if ( max < d ) max = d;
233  }
234 
235  min -= half_width;
236  max += half_width;
237 
238  if ( curv_flag < 1 ) min = 0;
239 
240  center += ori;
241 
242  // Calculate the mask
243  for ( i=z=0; z<p->sizeZ(); z++ ) {
244  if ( verbose & VERB_FULL )
245  cout << "Calculating slice " << z << endl;
246  vec[2] = z - center[2];
247  for ( y=0; y<p->sizeY(); y++ ) {
248  vec[1] = y - center[1];
249  for ( x=0; x<p->sizeX(); x++, i++ ) {
250  vec[0] = x - center[0];
251  d = vec.length();
252 // data[i] = 0;
253  if ( d < min ) ni++;
254  else if ( d > max ) no++;
255  else {
256  d = model_inside_outside(vec, model, curv_flag, fast);
257  if ( fabs(d) <= half_width ) p->set(i,1);
258  else if ( d > 0 ) ni++;
259  else no++;
260  }
261  if ( (*p)[i] ) nv++;
262  }
263  }
264  }
265 
266  if ( verbose ) {
267  cout << "Mask volume: " << nv * sam.volume() << " A3" << endl;
268  cout << "Inner volume: " << ni * sam.volume() << " A3" << endl;
269  cout << "Outer volume: " << no * sam.volume() << " A3" << endl << endl;
270  }
271 
272  return p;
273 }
274 
288 {
289  if ( sam[0] <= 0) sam = sam.max(1);
290 
291  Vector3<double> loc;
292  Bmodel* mp;
293  Bcomponent* comp;
294 
295  Bimage* p = new Bimage(Integer, TSimple, size, 1);
296  if ( ori[0] == 0 && ori[1] == 0 && ori[2] == 0 )
297  p->origin(p->default_origin());
298  else
299  p->origin(ori);
300  ori = p->image->origin();
301  p->sampling(sam);
302 
303  if ( verbose ) {
304  cout << "Generating a level mask:" << endl;
305  cout << "Size: " << p->size() << endl;
306  cout << "Origin: " << p->image->origin() << endl;
307  cout << "Sampling: " << p->sampling(0) << " A/voxel" << endl;
308  }
309 
310  int level;
311 
312  // Calculate the levels
313  for ( level=1, mp = model; mp; mp = mp->next, level++ ) {
314  for ( comp = mp->comp; comp; comp = comp->next ) {
315  loc[0] = (long) (comp->loc[0]/p->sampling(0)[0] + p->image->origin()[0] + 0.5);
316  loc[1] = (long) (comp->loc[1]/p->sampling(0)[1] + p->image->origin()[1] + 0.5);
317  loc[2] = (long) (comp->loc[2]/p->sampling(0)[2] + p->image->origin()[2] + 0.5);
318  p->sphere(loc, comp->radius/p->sampling(0)[0], 0, FILL_USER, level);
319  }
320  }
321 
322  return p;
323 }
324 
336 {
337  if ( !p || !model ) return NULL;
338  if ( !p->data_pointer() ) return NULL;
339  if ( !model->comp ) return NULL;
340 
341  Bmodel* mp;
342  Bcomponent* comp;
343  int ncomp = model_component_count(model);
344 
345  long i, j, k, x, y, z, n;
346 
347  if ( verbose ) {
348  cout << "Extracting segments from a multi-level mask:" << endl;
349  cout << "Model: " << model->id << endl;
350  cout << "Number of components: " << ncomp << endl;
351  if ( multi_level ) cout << "Multi-level" << endl;
352  else cout << "Single level" << endl;
353  cout << endl;
354  }
355 
356  Bimage* pseg = new Bimage(Integer, TSimple, p->sizeX(), p->sizeY(), p->sizeZ(), p->images());
357  pseg->sampling(p->sampling(0));
358  for ( i=0; i<p->images(); i++ ) pseg->image[i] = p->image[i];
359 
360  int level;
361  long max = (long) (p->maximum()+1);
362  long datasize = p->data_size();
363  int* lut = new int[max];
364  for ( i=0; i<max; i++ ) lut[i] = 0;
365 
366  for ( k=1, mp = model; mp; mp = mp->next ) {
367  for ( comp = model->comp; comp; comp = comp->next, k++ ) {
368  n = mp->img_num;
369  x = (long) (comp->loc[0]/p->sampling(0)[0] + p->image[n].origin()[0] + 0.5);
370  y = (long) (comp->loc[1]/p->sampling(0)[1] + p->image[n].origin()[1] + 0.5);
371  z = (long) (comp->loc[2]/p->sampling(0)[2] + p->image[n].origin()[2] + 0.5);
372  if ( x < p->sizeX() && y < p->sizeY() && z < p->sizeZ() ) {
373  i = p->index(0, x, y, z, n);
374  level = (int) ((*p)[i] + 0.5);
375  if ( level > 0 ) lut[level] = k;
376  if ( verbose & VERB_DEBUG )
377  cout << "DEBUG img_extract_segments_using_model: " << x << tab << y << tab << z << tab << n << tab << level << endl;
378  }
379  }
380  }
381 
382  for ( i=j=0; i<datasize; i++ ) {
383  level = (int) ((*p)[i] + 0.5);
384  if ( level > 0 && lut[level] ) {
385  if ( multi_level ) pseg->set(i, lut[level]);
386  else pseg->set(i, 1);
387  }
388  }
389 
390  delete[] lut;
391 
392  pseg->statistics();
393 
394  return pseg;
395 }
396 
407 {
408  if ( !p || !model ) return -1;
409  if ( !p->data_pointer() ) return -1;
410  if ( !model->comp ) return -1;
411 
412  p->change_type(Integer);
413 
414  Bmodel* mp;
415  Bcomponent* comp;
416 
417  long i, x, y, z, n;
418  int new_value, count = (int) p->maximum();
419 
420  if ( verbose )
421  cout << "Adding model " << model->id << " to mask " << p->file_name() << endl << endl;
422 
423  for ( mp = model; mp; mp = mp->next ) if ( mp->sel ) {
424  for ( comp = model->comp; comp; comp = comp->next ) if ( comp->sel ) {
425  n = mp->img_num;
426  x = (long) (comp->loc[0]/p->sampling(0)[0] + p->image[n].origin()[0] + 0.5);
427  y = (long) (comp->loc[1]/p->sampling(0)[1] + p->image[n].origin()[1] + 0.5);
428  z = (long) (comp->loc[2]/p->sampling(0)[2] + p->image[n].origin()[2] + 0.5);
429  if ( x < p->sizeX() && y < p->sizeY() && z < p->sizeZ() ) {
430  i = p->index(0, x, y, z, n);
431  if ( (*p)[i] < 1 ) {
432  new_value = p->check_neighbors(i);
433  if ( new_value > 0 ) p->set(i, new_value);
434  else p->set(i, count++);
435  }
436  }
437  }
438  }
439 
440  p->maximum(count);
441 
442  return 0;
443 }
444 
454 {
455  p->change_type(Integer);
456 
457  if ( verbose ) {
458  cout << "Generating a model from a multi-level mask:" << endl;
459  cout << "Mask file: " << p->file_name() << endl;
460  cout << "Number of levels: " << p->maximum() << endl << endl;
461  }
462 
463  long i, j, x, y, z, n;
464  long nlev = (long)p->maximum() + 1;
465  double u = p->sampling(0).volume();
466  Bmodel* model = NULL;
467  Bmodel* m = NULL;
468  Bstring id, comptype("SEG");
469  Bcomponent* comp = NULL;
470  Bcomptype* ct;
471  Vector3<double> coor;
472 
473  int* num = new int[nlev];
474  Vector3<float>* loc = new Vector3<float>[nlev];
475 
476  int* mask = (int *) p->data_pointer();
477 
478  for ( n=i=0; n<p->images(); n++ ) {
479  id = Bstring(n, "Segments_%d");
480  m = model_add(&m, id);
481  if ( !model ) model = m;
482  m->fmap = p->file_name();
483  m->img_num = n;
484  ct = model_add_type_by_id(m, comptype);
485  for ( j=0; j<=p->maximum(); j++ ) {
486  num[j] = 0;
487  loc[j] = 0;
488  }
489  for ( z=0; z<p->sizeZ(); z++ ) {
490  coor[2] = (z - p->image[n].origin()[2])*p->sampling(0)[2];
491  for ( y=0; y<p->sizeY(); y++ ) {
492  coor[1] = (y - p->image[n].origin()[1])*p->sampling(0)[1];
493  for ( x=0; x<p->sizeX(); x++, i++ ) if ( mask[i] > 0 ) {
494  coor[0] = (x - p->image[n].origin()[0])*p->sampling(0)[0];
495  num[mask[i]]++;
496  loc[mask[i]] += coor;
497  }
498  }
499  }
500  for ( j=1; j<=p->maximum(); j++ ) if ( num[j] ) {
501  id = Bstring(j, "%d");
502  comp = component_add(&comp, id);
503  if ( !m->comp ) m->comp = comp;
504  comp->type = ct;
505  comp->loc = loc[j]/num[j];
506  comp->radius = pow(3*num[j]*u/(4*M_PI), 1.0/3.0);
507  comp->view = View(comp->loc[0], comp->loc[1], comp->loc[2], 0);
508  comp->color[0] = 0;
509  }
510  }
511 
512  delete[] num;
513  delete[] loc;
514 
515  return model;
516 }
517 
533  Vector3<long> size, Vector3<double> ori,
534  Vector3<double> sam, double dang, Bsymmetry* sym)
535 {
536  if ( sam.volume() <= 0) sam = sam.max(1);
537 
538  View* v;
539  View* views = asymmetric_unit_views(sym, dang, dang, 1);
540 
541  long i, j, n, nm;
542  long nv = count_list((char *)views);
543  double f, fa(0);
544 
545  Bmodel* mp = model;
546  Bcomponent* comp;
547  Matrix3 mat;
548  Vector3<double> loc;
549 
550  size[2] = 1;
551  Bimage* p = new Bimage(UCharacter, TSimple, size, nv);
552  if ( ori[0] == 0 && ori[1] == 0 && ori[2] == 0 )
553  p->origin(p->default_origin());
554  else
555  p->origin(ori);
556  ori = p->image->origin();
557  sam[2] = 1;
558  p->sampling(sam);
559 
560  if ( verbose ) {
561  cout << "Generating projection masks:" << endl;
562  cout << "Size: " << p->size() << endl;
563  cout << "Origin: " << p->image->origin() << endl;
564  cout << "Sampling: " << p->sampling(0) << " A/voxel" << endl;
565  cout << "Angular step size: " << dang*180.0/M_PI << endl;
566  cout << "Symmetry: " << sym->label << endl;
567  cout << "Projections: " << nv << endl;
568  }
569 
570  if ( verbose & VERB_PROCESS )
571  cout << "Mask\tView\t\t\t\t\tCount\tFraction" << endl;
572  for ( v = views, n=0; v; v = v->next, ++n ) {
573  mat = v->matrix();
574  for ( mp = model; mp; mp = mp->next ) {
575  for ( comp = mp->comp; comp; comp = comp->next ) {
576  loc = (mat * comp->loc)/p->image->sampling() + ori + 0.5;
577  loc[2] = 0;
578  if ( !p->within_boundaries(loc) )
579  cerr << "Out of bounds! " << loc << endl;
580  i = p->index(loc, n);
581  p->set(i, 1);
582  }
583  }
584  for ( i=n*p->image_size(), j=0, nm=0; j<p->image_size(); ++i, ++j )
585  nm += (*p)[i];
586  f = nm*1.0/p->image_size();
587  fa += f;
588  if ( verbose & VERB_PROCESS )
589  cout << n+1 << setprecision(4) << tab << *v << tab
590  << nm << tab << f << endl;
591  }
592 
593  fa /= n;
594 
595  // Calculate the mask area
596  for ( i=nv=0; i<p->data_size(); i++ ) if ( (*p)[i] > 0.5 ) nv++;
597 
598  if ( verbose ) {
599  cout << "Mask area: " <<
600  nv * sam.volume()/n << " A2" << endl;
601  cout << "Average mask fraction: " <<
602  fa << endl << endl;
603  }
604 
605  return p;
606 }
View::next
View * next
Definition: View.h:28
Bcomponent::next
Bcomponent * next
Definition: rwmodel.h:52
Bimage::sizeZ
void sizeZ(long nz)
Definition: Bimage.h:392
matrix_linear.h
Header file for matrix functions.
Bcomponent
Definition: rwmodel.h:51
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
UCharacter
@ UCharacter
Definition: utilities.h:153
rwmodel.h
Header file for reading and writing atomic model files.
Bcomponent::loc
Vector3< float > loc
Definition: rwmodel.h:58
Bimage::set
void set(long j, double v)
Sets a single value at the given index.
Definition: Bimage.cpp:1118
Bstring
Definition: Bstring.h:29
model_component_count
int model_component_count(Bmodel *model)
Counts the total number of components.
Definition: rwmodel.cpp:638
component_add
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
Definition: rwmodel.cpp:270
model_inside_outside
double model_inside_outside(Vector3< double > vec, Bmodel *model, int curv_flag, int fast)
Definition: model_shell.cpp:401
Bcomptype
Definition: rwmodel.h:25
Vector3< long >
Bimage::sizeX
void sizeX(long nx)
Definition: Bimage.h:390
Bimage::default_origin
Vector3< double > default_origin()
Definition: Bimage.h:592
Bmodel::next
Bmodel * next
Definition: rwmodel.h:120
FILL_USER
#define FILL_USER
Definition: utilities.h:176
Bimage::size
Vector3< long > size() const
Definition: Bimage.h:386
asymmetric_unit_views
View * asymmetric_unit_views(Bsymmetry *sym, double theta_step, double phi_step, int flag)
Initializes a well-distributed set of views in an asymmetric unit.
Definition: symmetry.cpp:564
verbose
int verbose
View
Definition: View.h:26
img_extract_segments_using_model
Bimage * img_extract_segments_using_model(Bimage *p, Bmodel *model, int multi_level)
Extracts segmentss from a multi-level mask around points defined by a model.
Definition: model_mask.cpp:335
model_center_of_mass
Vector3< double > model_center_of_mass(Bmodel *model)
Definition: model_util.cpp:475
Bmodel::link
Blink * link
Definition: rwmodel.h:133
Bimage::image
Bsub_image * image
Definition: Bimage.h:202
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:111
Bsymmetry
Definition: symmetry.h:38
Bimage::maximum
double maximum()
Definition: Bimage.h:542
model_create_level_mask
Bimage * model_create_level_mask(Bmodel *model, Vector3< long > size, Vector3< double > ori, Vector3< double > sam)
Calculates a mask with one level per model.
Definition: model_mask.cpp:286
count_list
long count_list(char *list)
Counts the number of items in a linked list.
Definition: linked_list.cpp:235
Bmodel::fmap
Bstring fmap
Definition: rwmodel.h:125
model_from_multilevel_mask
Bmodel * model_from_multilevel_mask(Bimage *p)
Generates components at the center of mass of each mask level.
Definition: model_mask.cpp:453
Bimage::images
long images()
Definition: Bimage.h:504
Bmodel::comp
Bcomponent * comp
Definition: rwmodel.h:132
Matrix3
Definition: Matrix3.h:18
Bsub_image::origin
void origin(double x, double y, double z)
Definition: Bimage.h:136
Bcomponent::vec
Vector3< float > vec
Definition: rwmodel.h:60
TSimple
@ TSimple
Definition: Bimage.h:59
model_create_projected_mask
Bimage * model_create_projected_mask(Bmodel *model, Vector3< long > size, Vector3< double > ori, Vector3< double > sam, double dang, Bsymmetry *sym)
Calculates a set of 2D masks for the projections of a model structure.
Definition: model_mask.cpp:532
Bimage::sizeY
void sizeY(long ny)
Definition: Bimage.h:391
Bmodel::id
Bstring id
Definition: rwmodel.h:121
Bimage::image_size
long image_size()
Definition: Bimage.h:290
model_create_hull_mask
Bimage * model_create_hull_mask(Bmodel *model, Vector3< long > size, Vector3< double > ori, Vector3< double > sam, int curv_flag, int fast)
Calculates a mask based on the periphery of a model structure.
Definition: model_mask.cpp:104
Bimage::data_size
long data_size()
Definition: Bimage.h:270
model_create_shell_mask
Bimage * model_create_shell_mask(Bmodel *model, Vector3< long > size, Vector3< double > ori, Vector3< double > sam, double shell_width, int curv_flag, int fast)
Calculates a shell mask covering a model structure.
Definition: model_mask.cpp:192
Bimage
General image parameter class.
Definition: Bimage.h:177
Vector3.h
Class for 3-value vectors.
Bmodel::sel
int sel
Definition: rwmodel.h:129
Bimage::check_neighbors
long check_neighbors(long idx)
Check neighbors in region map and assign a value if a neighbor is assigned.
Definition: Bimage_segment.cpp:406
Bmodel
Definition: rwmodel.h:119
Bimage::file_name
void file_name(string s)
Definition: Bimage.h:245
Bcomponent::color
RGBA< float > color
Definition: rwmodel.h:63
M_PI
#define M_PI
Definition: utilities.h:63
utilities.h
Header file for general utilities.
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:22
Integer
@ Integer
Definition: utilities.h:158
model_mask.h
Functions to generate masks from models.
Bmodel::img_num
int img_num
Definition: rwmodel.h:127
Bcomponent::view
View view
Definition: rwmodel.h:59
Bimage::origin
void origin(double ox, double oy, double oz)
Definition: Bimage.h:570
Bcomponent::type
Bcomptype * type
Definition: rwmodel.h:54
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
Vector3::volume
double volume()
Definition: Vector3.h:237
img_add_model_to_mask
int img_add_model_to_mask(Bimage *p, Bmodel *model)
Adds to the mask the component locations.
Definition: model_mask.cpp:406
Bsub_image::sampling
void sampling(double x, double y, double z)
Definition: Bimage.h:127
linked_list.h
Header file for generalized linked list functions.
model_add
Bmodel * model_add(Bmodel **model, Bstring &id)
Adds a model to a linked list.
Definition: rwmodel.cpp:181
VERB_FULL
#define VERB_FULL
Definition: utilities.h:113
Bimage::data_pointer
unsigned char * data_pointer()
Definition: Bimage.h:284
model_util.h
Library routines used for model processing.
model_add_type_by_id
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
Definition: rwmodel.cpp:414
Bimage::sampling
void sampling(long nn, Vector3< double > u)
Definition: Bimage.h:514
model_create_mask
Bimage * model_create_mask(Bmodel *model, Vector3< long > size, Vector3< double > ori, Vector3< double > sam, double edge)
Calculates a mask of the components and links of a model structure.
Definition: model_mask.cpp:35
View::matrix
Matrix3 matrix()
Definition: View.h:153
Bcomponent::radius
float radius
Definition: rwmodel.h:62
Bimage::bar
int bar(Vector3< double > start, Vector3< double > end, double width, double edge_width, int fill_type=0, double fill=0)
Generates a bar between start and end points.
Definition: Bimage_edit.cpp:731
Bsymmetry::label
Bstring label
Definition: symmetry.h:41
Vector3::length
double length()
Definition: Vector3.h:222
Bimage::within_boundaries
bool within_boundaries(Vector3< double > loc)
Definition: Bimage.h:461
level
size_t level(0)
Float
@ Float
Definition: utilities.h:161
model_shell.h
Library routines used for shell model processing.
Bimage::statistics
long statistics()
Calculates the statistics for an image.
Definition: Bimage_stats.cpp:22
Bimage::sphere
int sphere(Vector3< double > center, double radius, double width=0, int fill_type=0, double fill=0)
Fills a sphere within an image with a uniform value.
Definition: Bimage_edit.cpp:440
Bcomponent::sel
int sel
Definition: rwmodel.h:66
Vector3::max
Type max()
Definition: Vector3.h:175