aimsalgo  5.0.5
Neuroimaging image processing
primalSketchUtil.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef AIMS_PRIMALSKETCH_PRIMALSKETCHUTIL_H
36 #define AIMS_PRIMALSKETCH_PRIMALSKETCHUTIL_H
37 
38 #include <cstdlib>
41 #include <aims/bucket/bucket.h>
42 #include <aims/graph/graphmanip.h>
43 #include <aims/mesh/surfacegen.h>
45 #include <unistd.h>
46 #include <graph/graph/graph.h>
47 #include <set>
48 #include <map>
49 #include <list>
50 #include <utility>
51 #include <math.h>
52 
53 namespace aims
54 {
55  // Functions that deal with primal sketches
56 
57  //------------------------------------- Declarations ----------------------------------------------------------------
58 
59  template<typename T> AimsData<short> *GetSSBlobImage(PrimalSketch<AimsData<T>, AimsData<T> > *sketch);
60  template<int D, class T> TimeTexture<float> GetSSBlobTexture(PrimalSketch<AimsSurface<D, Void>, Texture<T> > *sketch);
61  template<int D, class T> AimsSurfaceTriangle *GetSSBlobMesh(PrimalSketch<AimsSurface<D, Void>, Texture<T> > *sketch);
62 
63  template<typename T> AimsBucket<Void> *GetSSBlobBucket(PrimalSketch<AimsData<T>, AimsData<T> > *sketch);
64  template<int D, class T> AimsSurfaceTriangle *GetSSBlobTore(PrimalSketch<AimsSurface<D, Void>, Texture<T> > *sketch);
65 
66  template<typename Geom, typename Text> void AddBlobsToPSGraph(PrimalSketch<Geom,Text> *sketch, Graph *graph);
67  template<typename T> void AddBlobsToPSGraph(PrimalSketch<AimsData<T>, AimsData<T> > *sketch, Graph *graph);
68  template<int D, class T> void AddBlobsToPSGraph(PrimalSketch<AimsSurface<D, Void>, Texture<T> > *sketch, Graph *graph);
69 
70  //------------------------------------ Definitions ------------------------------------------------------------------
71 
73  {
74  typedef Point3d Site;
75 
76  AimsData<short> *image;
77  int x,y,z,sx,sy,sz, i;
78  float dx, dy, dz;
79  std::list<ScaleSpaceBlob<Site>*> ssBlobList=sketch->BlobSet();
80  std::list<ScaleSpaceBlob<Site>*>::iterator itBlob=ssBlobList.begin();
81  GreyLevelBlob<Site> *glBlob;
82  std::set<Site,ltstr_p3d<Site> > points;
83  std::set<Site,ltstr_p3d<Site> >::iterator itPoints;
84 
85  sx=sketch->scaleSpace()->GetOriginalImage().dimX();
86  sy=sketch->scaleSpace()->GetOriginalImage().dimY();
87  sz=sketch->scaleSpace()->GetOriginalImage().dimZ();
88  dx=sketch->scaleSpace()->GetOriginalImage().sizeX();
89  dy=sketch->scaleSpace()->GetOriginalImage().sizeY();
90  dz=sketch->scaleSpace()->GetOriginalImage().sizeZ();
91 
92  image=new AimsData<short>(sx, sy, sz);
93  image->setSizeXYZT(dx,dy,dz);
94 
95  for (z=0; z<sz; z++)
96  for (y=0; y<sy; y++)
97  for (x=0; x<sx; x++)
98  (*image)(x,y,z)=0;
99 
100  for (; itBlob!=ssBlobList.end(); ++itBlob)
101  {
102  glBlob=(*itBlob)->GlBlobRep();
103  points=glBlob->GetListePoints();
104  itPoints=points.begin();
105  for (; itPoints!=points.end(); ++itPoints)
106  {
107  x=(*itPoints)[0]; y=(*itPoints)[1]; z=(*itPoints)[2];
108  if ((i=(*image)(x,y,z))==0)
109  (*image)(x,y,z)=100 + ((*itBlob)->Label() * 10);
110  else
111  (*image)(x,y,z)=105 + ((*itBlob)->Label() * 10);
112  }
113  }
114 
115  return image;
116  }
117 
118 
119  //------------------------------------------------------------------------------------------
120 
122  {
123  typedef std::pair<Point3df,uint> Site;
124 
125  //TexturedData<AimsSurface<D, Void>, Texture<T> > *textBlob;
126  std::list<ScaleSpaceBlob<Site>*> ssBlobList=sketch->BlobSet();
127  std::list<ScaleSpaceBlob<Site>*>::iterator itBlob=ssBlobList.begin();
128  GreyLevelBlob<Site> *glBlob;
129  std::set<Site,ltstr_p3d<Site> > points;
130  std::set<Site,ltstr_p3d<Site> >::iterator itPoints;
131  //int label;
132 
133  //textBlob=new TexturedData<AimsSurface<D, Void>, Texture<T> >(sketch->scaleSpace()->Mesh(), &(sketch->scaleSpace()->GetOriginalImage()));
134 
135  std::set<float> scale= sketch->scaleSpace()->GetScaleList();
136 
137 
138  TimeTexture<float> tex(scale.size(),sketch->scaleSpace()->Mesh()->vertex().size());
139  for (uint i=0;i<scale.size();i++)
140  for (uint j=0;j<sketch->scaleSpace()->Mesh()->vertex().size();j++)
141  tex[i].item(j)=0;
142 
143  float sc = 0.0f;
144  std::set<float>::iterator it;
145  uint test=0;
146  uint i=0;
147  for (; itBlob!=ssBlobList.end(); ++itBlob)
148  {
149  //label=(*itBlob)->Label();
150  glBlob=(*itBlob)->GlBlobRep();
151  points=glBlob->GetListePoints();
152  itPoints=points.begin();
153 // if (points.size() == 1){
154  std::list<GreyLevelBlob<Site>*> glBlobs=(*itBlob)->glBlobs;
155  std::list<GreyLevelBlob<Site>*>::iterator glit;
156  for (glit = glBlobs.begin() ; glit != glBlobs.end() ; glit++){
157  points=(*glit)->GetListePoints();
158  itPoints=points.begin();
159  sc = (*glit)->GetScale();
160  for (i=0,it=scale.begin();
161  *it != sc && it!=scale.end();it++,i++) {}
162 
163  for (; itPoints!=points.end(); ++itPoints)
164  {
165  tex[i].item((*itPoints).second)= (*itBlob)->GetMeasurements().t; //100+test*10;
166  }
167  }
168  test++;
169 // }
170 // uint i=0;
171 // float delta=1000.0;
172 // for (it=scale.begin();it!=scale.end();it++){
173 // if (fabs(*it-(*itBlob)->ScaleRep()) < delta)
174 // {
175 // delta=fabs(*it-(*itBlob)->ScaleRep());
176 // sc = *it;
177 // }
178 // }
179 // cout << "sc:" << sc << " ";
180  for (i=0,it=scale.begin();*it != sc && it!=scale.end();
181  it++,i++) {}
182 
183  }
184 
185  return tex;
186 // return textBlob->GetTexture();
187  }
188 
189  //------------------------------------------------------------------------------------------
190 
192  {
193  typedef Point3d Site;
194  AimsBucket<Void> *blobBck;
195  float dx, dy, dz;
196  std::list<ScaleSpaceBlob<Site>*> ssBlobList=sketch->BlobSet();
197  std::list<ScaleSpaceBlob<Site>*>::iterator itBlob=ssBlobList.begin();
198  GreyLevelBlob<Site> *glBlob;
199  std::set<Site,ltstr_p3d<Site> > points;
200  std::set<Site,ltstr_p3d<Site> >::iterator itPoints;
201  AimsBucketItem<Void> bckItem;
202 
203  dx=sketch->scaleSpace()->GetOriginalImage().sizeX();
204  dy=sketch->scaleSpace()->GetOriginalImage().sizeY();
205  dz=sketch->scaleSpace()->GetOriginalImage().sizeZ();
206 
207  blobBck=new AimsBucket<Void>;
208  blobBck->setSizeX(dx);
209  blobBck->setSizeY(dy);
210  blobBck->setSizeZ(dz);
211 
212  for (; itBlob!=ssBlobList.end(); ++itBlob)
213  {
214  glBlob=(*itBlob)->GlBlobRep();
215  points=glBlob->GetListePoints();
216  itPoints=points.begin();
217  for (; itPoints!=points.end(); ++itPoints)
218  {
219  bckItem.location()=(*itPoints);
220  (*blobBck)[(*itBlob)->Label()].push_back(bckItem);
221  }
222  }
223  return blobBck;
224  }
225 
226  //------------------------------------------------------------------------------------------
228  {
229  typedef std::pair<Point3df,uint> Site; // ATTENTION : cette fonction ne marche que pour les surfaces triangulees
230  // et pas pour D quelconque. C'est un peu verole mais bon...
231  // Peut-?tre le primalSketch de surfaces devrait-il ?tre limit? aux triangulations
232  AimsSurfaceTriangle *meshBlob;
233  std::list<ScaleSpaceBlob<Site>*> ssBlobList=sketch->BlobSet();
234  std::list<ScaleSpaceBlob<Site>*>::iterator ssblobit=ssBlobList.begin();
235  std::set<Site,ltstr_p3d<Site> > points;
236 
237  std::map<int,int> tableNodes;
238  int label, index;
239  uint count=0, count2=0;
240  Point3df coord;
241  AimsTimeSurface<3,Void> oneMesh, tempMesh;
242  std::vector<Point3df> nodes;
243  std::vector<Point3dd> pts;
244  std::vector< AimsVector<uint,3> > poly, allPoly;
245  std::vector< AimsVector<uint,3> >::iterator itPoly;
246  AimsVector<uint,3> tri;
247 
248  meshBlob=new AimsSurfaceTriangle();
249  (*mesh)[0].updateNormals();
250 
251  std::cout << "==============================" << std::endl;
252  for (; ssblobit!=ssBlobList.end(); ++ssblobit ) { // ON PARCOURT LES SSBLOBS
253  oneMesh=AimsSurfaceTriangle();
254  label=(*ssblobit)->Label();
255 
256  std::cout << "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bssb n°" << label << "("<< count2++ <<"/" << ssBlobList.size()<<") " << std::flush;
257 
258  std::list<GreyLevelBlob<Site>*>::iterator glblobit=(*ssblobit)->glBlobs.begin();
259  std::map<float,GreyLevelBlob<Site>*> glblobmap;
260  for (;glblobit != (*ssblobit)->glBlobs.end();glblobit++){
261  glblobmap[(*glblobit)->GetScale()] = *glblobit;
262  }
263  std::map<float,GreyLevelBlob<Site>*>::iterator mapit=glblobmap.begin();
264 
265  for (count = 0;count<1 && count <glblobmap.size();count++,mapit++){ // ON PARCOURT LES GLBLOBS DU SSB
266  tempMesh=AimsSurfaceTriangle();
267  tableNodes.clear();
268  points=(*mapit).second->GetListePoints();
269  points=(*ssblobit)->GlBlobRep()->GetListePoints();
270  std::set<Site,ltstr_p3d<Site> >::iterator itPoints=points.begin();
271  std::set<uint> auxpts;
272  for (; itPoints!=points.end(); ++itPoints){
273  index=(*itPoints).second;
274  auxpts.insert(index);
275  }
276  for (uint i=0; i<(*mesh)[0].polygon().size(); i++){
277  if ((auxpts.find((*mesh)[0].polygon()[i][0]) != auxpts.end()) // si le polytgone ne contient que des
278  && (auxpts.find((*mesh)[0].polygon()[i][1]) != auxpts.end()) // points du blob
279  && (auxpts.find((*mesh)[0].polygon()[i][2]) != auxpts.end())){ // on le garde
280  for (uint j=0;j<3;j++){
281  Point3df node((*mesh)[0].vertex()[(*mesh)[0].polygon()[i][j]]);
282  Point3df norm((*mesh)[0].normal()[(*mesh)[0].polygon()[i][j]]);
283  norm *= 0.01;
284  node += norm;
285  tempMesh[0].vertex().push_back(Point3df(node[0],node[1],node[2]));
286  }
287  tempMesh[0].polygon().push_back(AimsVector<uint,3>( tempMesh[0].vertex().size()-3,tempMesh[0].vertex().size()-2,tempMesh[0].vertex().size()-1));
288  }
289  }
290 
291  // JUSTE LES CYLINDRES DE LIAISON
292 // if ((*ssblobit)->TopBifurcation()->Type() != APPEAR){
293 // AimsSurfaceTriangle *msh;
294 // std::list<ScaleSpaceBlob<Site>*> topblobs = (*ssblobit)->TopBifurcation()->TopBlobs();
295 // Point3df v1 = (*mesh).vertex()[(*ssblobit)->GlBlobRep()->GetMaximum()->_node.second];
296 // Point3df n1 = (*mesh).normal()[(*ssblobit)->GlBlobRep()->GetMaximum()->_node.second];
297 // n1 *= (*mapit).second->GetScale()*3;
298 // v1 += n1;
299 // std::list<ScaleSpaceBlob<Site>*>::iterator ittb=topblobs.begin();
300 // for (; ittb !=topblobs.end();++ittb){
301 // Point3df v2 = (*mesh).vertex()[(*ittb)->GlBlobRep()->GetMaximum()->_node.second];
302 // Point3df n2 = (*mesh).normal()[(*ittb)->GlBlobRep()->GetMaximum()->_node.second];
303 // n2 *= (*ittb)->ScaleMin();
304 // v2 += n2;
305 // msh = SurfaceGenerator::cylinder(v1 ,v2 , 0.1, 0.1, 6,true,true );
306 // SurfaceManip::meshMerge( tempMesh, *msh );
307 // }
308 // }
309 //
310  SurfaceManip::meshMerge( oneMesh, tempMesh );
311  }
312 
313 
314  if (oneMesh[0].polygon().size()!=0){
315  (*meshBlob)[label]=AimsSurface<3,Void>();
316  (*meshBlob)[label].polygon()=oneMesh[0].polygon();
317  (*meshBlob)[label].vertex()=oneMesh[0].vertex();
318  (*meshBlob)[label].updateNormals();
319  }
320  else {
321 // if (true){
322  AimsSurfaceTriangle *msh;
323  Point3df auxnode = (*mesh)[0].vertex()[(*ssblobit)->GlBlobRep()->GetMaximum()->_node.second];
324  msh = SurfaceGenerator::sphere(auxnode , 0.5,6 );
325  (*meshBlob)[label]=AimsSurface<3,Void>();
326  (*meshBlob)[label].polygon()=(*msh).polygon();
327  (*meshBlob)[label].vertex()=(*msh).vertex();
328  (*meshBlob)[label].updateNormals();
329  }
330 
331  }
332  std::cout << "END" << std::endl;
333 
334  return meshBlob;
335  }
336 
338  {
339  AimsBucket<Void> *blobBck;
340  AimsBucketItem<Void> bckItem;
341 
342  blobBck=new AimsBucket<Void>;
343  blobBck->setSizeX(1.0);
344  blobBck->setSizeY(1.0);
345  blobBck->setSizeZ(1.0);
346 
347  for (uint i=0; i<(*mesh).size(); i++) {
348  for (uint j=0; j<(*mesh)[i].vertex().size(); j++)
349  {
350  bckItem.location()=static_cast<Point3d>((*mesh)[i].vertex()[j]);
351  (*blobBck)[i].push_back(bckItem);
352  }
353  }
354  return blobBck;
355  }
356 
357 
358  //------------------------------------------------------------------------------------------
359  template<typename Geom, typename Text> void AddBlobsToPSGraph(PrimalSketch<Geom,Text> *sketch, Graph *graph)
360  {
361  }
362 
363 
364  //------------------------------------------------------------------------------------------
365  template<typename T> void AddBlobsToPSGraph(PrimalSketch<AimsData<T>, AimsData<T> > *sketch, Graph *graph) {
366  std::set<Vertex * > vertSet;
367  std::set<Vertex *>::iterator itVert;
368  Vertex *node;
369  BucketMap<Void> *bckMap;
370  int label;
371  aims::GraphManip manip;
373  std::vector<int> bounding_min, bounding_max;
374  std::vector<float> resolution;
375 
376  bounding_min.push_back(0);
377  bounding_min.push_back(0);
378  bounding_min.push_back(0);
379  bounding_max.push_back(sketch->scaleSpace()->GetOriginalImage().dimX());
380  bounding_max.push_back(sketch->scaleSpace()->GetOriginalImage().dimY());
381  bounding_max.push_back(sketch->scaleSpace()->GetOriginalImage().dimZ());
382  resolution.push_back(sketch->scaleSpace()->GetOriginalImage().sizeX());
383  resolution.push_back(sketch->scaleSpace()->GetOriginalImage().sizeY());
384  resolution.push_back(sketch->scaleSpace()->GetOriginalImage().sizeZ());
385 
386  graph->setProperty( "boundingbox_min", bounding_min );
387  graph->setProperty( "boundingbox_max", bounding_max );
388  graph->setProperty( "voxel_size", resolution );
389 
390  bckMap = new BucketMap<Void>( *GetSSBlobBucket(sketch) );
391  bckMap->setSizeX( resolution[0] );
392  bckMap->setSizeY( resolution[1] );
393  bckMap->setSizeZ( resolution[2] );
394  vertSet = graph->vertices();
395  for ( itVert = vertSet.begin() ; itVert != vertSet.end() ; ++itVert ) {
396  node =*itVert;
397  node->getProperty( "index", label );
399  (*ptrBck)[0] = (*bckMap)[label];
400  ptrBck->setSizeX( resolution[0] );
401  ptrBck->setSizeY( resolution[1] );
402  ptrBck->setSizeZ( resolution[2] );
403  manip.storeAims( *graph, node, "ssblob", ptrBck );
404  node->setProperty( "ssblob_label", label );
405  }
406  }
407 
408  //------------------------------------------------------------------------------------------
409  template<int D, class T> void AddBlobsToPSGraph(PrimalSketch<AimsSurface<D, Void>, Texture<T> > *sketch, Graph *graph){
410  std::set<Vertex * > vertSet;
411  std::set<Vertex *>::iterator itVert;
412  Vertex *node;
413  AimsSurfaceTriangle *tore;
414  BucketMap<Void> *bckMap;
415 
416  int label;
417  aims::GraphManip manip;
420 
421  std::vector<int> bounding_min, bounding_max;
422  std::vector<float> bounding_minf, bounding_maxf;
423  std::vector<float> resolution;
424  Point3df mini, maxi;
425 
426  AimsSurfaceTriangle *mesh;
427  mesh = new AimsSurfaceTriangle();
428 
429  if (sketch->scaleSpace()->AuxMesh() != NULL){
430  mesh = sketch->scaleSpace()->AuxMesh();
431  }
432  else {
433  AimsSurface<3,Void> auxsurf(*(sketch->scaleSpace()->Mesh()));
434  (*mesh)[0] = auxsurf;
435  }
436 
437  for (uint z=0;z<3;z++){ mini[z] = 100000000.0; maxi[z] = -100000000.0; }
438 
439  for (uint i=0;i<(*mesh)[0].vertex().size();i++)
440  for (uint z=0;z<3;z++){
441  mini[z] = std::min((*mesh)[0].vertex()[i][z], mini[z]);
442  maxi[z] = std::max((*mesh)[0].vertex()[i][z], maxi[z]);
443  }
444 
445  resolution.push_back(1);
446  resolution.push_back(1);
447  resolution.push_back(1);
448  bounding_min.push_back(-1);
449  bounding_min.push_back(-1);
450  bounding_min.push_back(-1);
451  bounding_max.push_back(1);
452  bounding_max.push_back(1);
453  bounding_max.push_back(1);
454  graph->setProperty("boundingbox_min", bounding_min);
455  graph->setProperty("boundingbox_max", bounding_max);
456  graph->setProperty("voxel_size", resolution);
457 
458  tore=GetSSBlobMesh(sketch, mesh);
459  bckMap=new BucketMap<Void>();
460  bckMap->setSizeX(resolution[0]);
461  bckMap->setSizeY(resolution[1]);
462  bckMap->setSizeZ(resolution[2]);
463  vertSet=graph->vertices();
464 
465  for (itVert=vertSet.begin(); itVert!=vertSet.end(); ++itVert){
466  node=*itVert;
467  node->getProperty("index", label);
468  // Rajouter le bckMap[label] dans les attributs
470  (*ptrTore)[0]=(*tore)[label];
471 // for (uint j=0; j< (*tore)[label].vertex().size(); j++){
472 // pair<Point3d,Void> aux;
473 // aux.first = Point3d((int)(((*tore)[label].vertex()[j][0]+resolution[0]/2.0)/resolution[0]),(int)(((*tore)[label].vertex()[j][1]+resolution[1]/2.0)/resolution[1]),(int)(((*tore)[label].vertex()[j][2]+resolution[2]/2.0)/resolution[2]));
474 // (*bckMap)[label].insert(aux);
475 // }
476 
477  manip.storeAims( *graph, node, "ssblob", ptrTore );
479 
480  (*ptrBck)[0]=(*bckMap)[label];
481  ptrBck->setSizeX(resolution[0]);
482  ptrBck->setSizeY(resolution[1]);
483  ptrBck->setSizeZ(resolution[2]);
484 // manip.storeAims( *graph, node, "ssblobbucket", ptrBck );
485 // node->setProperty("ssblobbucket_label", label);
486  node->setProperty("ssblob_label", label);
487  }
488 
489  }
490 
491  //------------------------------------------------------------------------------------------
493  {
494  AimsSurfaceTriangle *blobMesh, *blobTore;
495 
496 
497  blobMesh=GetSSBlobMesh(sketch);
498 
499  // Code from here is a simple extension from the ScaleSpace::surface2Tore function
500  // by Arnaud Cachia
501 
502  unsigned i, t=0, p, t1, t2, t3;
503  //AimsSurfaceTriangle::iterator itMesh;
504  unsigned nedge = 0;
505  AimsSurfaceTriangle *msh, *tmpMesh;
506 
507  blobTore=new AimsSurfaceTriangle;
508 
509  //for (itMesh==blobMesh->begin();itMesh!=blobMesh->end();++itMesh)
510  for (t=0; t<blobMesh->size(); t++)
511  {
512  const std::vector<Point3df> vert = (*blobMesh)[t].vertex();
513  const std::vector<AimsVector<uint,3> > poly = (*blobMesh)[t].polygon();
514  std::map<std::pair<unsigned, unsigned>, unsigned> edges;
515  std::map<std::pair<unsigned, unsigned>, unsigned>::iterator ie, eie = edges.end();
516  p = poly.size();
517 
518  for( i=0; i<p; ++i )
519  {
520  t1 = poly[i][0];
521  t2 = poly[i][1];
522  t3 = poly[i][2];
523 
524  if( t1 < t2 )
525  ++edges[ std::pair<unsigned, unsigned>( t1, t2 ) ];
526  else
527  ++edges[ std::pair<unsigned, unsigned>( t2, t1 ) ];
528  if( t1 < t3 )
529  ++edges[ std::pair<unsigned, unsigned>( t1, t3 ) ];
530  else
531  ++edges[ std::pair<unsigned, unsigned>( t3, t1 ) ];
532  if( t2 < t3 )
533  ++edges[ std::pair<unsigned, unsigned>( t2, t3 ) ];
534  else
535  ++edges[ std::pair<unsigned, unsigned>( t3, t2 ) ];
536  }
537 
538  tmpMesh=new AimsSurfaceTriangle;
539  for( ie=edges.begin(); ie!=eie; ++ie)
540  if( (*ie).second == 1 )
541  {
542  ++nedge;
543  msh = SurfaceGenerator::cylinder( vert[(*ie).first.first], vert[(*ie).first.second], 0.3, 0.3, 3, false );
544  SurfaceManip::meshMerge( *tmpMesh, *msh );
545  delete msh;
546  }
547  (*blobTore)[t]=(*tmpMesh)[0];
548  delete tmpMesh;
549  }
550 
551  return( blobTore );
552  }
553 
554 }
555 
556 #endif
float min(float x, float y)
Definition: thickness.h:105
const std::set< Vertex *> & vertices() const
void setSizeY(float sizey)
float max(float x, float y)
Definition: thickness.h:97
static AimsSurfaceTriangle * cylinder(const carto::GenericObject &params)
AimsData< short > * GetSSBlobImage(PrimalSketch< AimsData< T >, AimsData< T > > *sketch)
std::set< T, ltstr_p3d< T > > & GetListePoints()
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
void setSizeX(float sizex)
void setSizeY(float sizey)
const AimsVector< short, 3 > & location() const
AimsBucket< Void > * GetSSBlobBucket(PrimalSketch< AimsData< T >, AimsData< T > > *sketch)
void setSizeX(float sizex)
const std::vector< AimsVector< uint, D > > & polygon() const
void AddBlobsToPSGraph(PrimalSketch< Geom, Text > *sketch, Graph *graph)
const std::vector< AimsVector< uint, D > > & polygon() const
AimsSurfaceTriangle * GetSSBlobTore(PrimalSketch< AimsSurface< D, Void >, Texture< T > > *sketch)
void setSizeZ(float sizez)
unsigned int uint
static void meshMerge(AimsTimeSurface< D, T > &dst, const AimsTimeSurface< D, T > &add)
const std::vector< Point3df > & vertex() const
void setSizeXYZT(float sizex=1.0f, float sizey=1.0f, float sizez=1.0f, float sizet=1.0f)
void setSizeZ(float sizez)
AIMSDATA_API float norm(const Tensor &thing)
AimsSurfaceTriangle * GetSSBlobMesh(PrimalSketch< AimsSurface< D, Void >, Texture< T > > *sketch)
T * iterator
AimsBucket< Void > * GetSSBlobMeshBucket(AimsSurfaceTriangle *mesh)
TimeTexture< float > GetSSBlobTexture(PrimalSketch< AimsSurface< D, Void >, Texture< T > > *sketch)
static AimsSurfaceTriangle * sphere(const carto::GenericObject &params)
static void storeAims(Graph &graph, GraphObject *vertex, const std::string &attribute, carto::rc_ptr< T > obj)