aimsalgo  5.1.2
Neuroimaging image processing
greyLevelBlob.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 #ifndef AIMS_PRIMALSKETCH_GREYLEVELBLOB_H
35 #define AIMS_PRIMALSKETCH_GREYLEVELBLOB_H
36 
37 #include <cstdlib>
39 #include <iostream>
40 #include <set>
41 #include <map>
42 #include <list>
43 #include <vector>
44 
45 namespace aims {
46  const int BACKGROUND = 0;
47 
48  template<typename T> struct ltstr_p3d
49  { // comparaison de Sites pour conteneurs tri�s (set, map)
50  bool operator()(const T p1, const T p2) const { return false;}
51  };
52 
53  template <> struct ltstr_p3d<Point3d>
54  {
55  bool operator ()( const Point3d p1, const Point3d p2 ) const
56  {
57  if ( p1[2] < p2[2] )
58  return true;
59  else if ( p1[2] > p2[2] )
60  return false;
61  else {
62  if ( p1[1] < p2[1] )
63  return true;
64  else if ( p1[1] > p2[1] )
65  return false;
66  else
67  {
68  if ( p1[0] < p2[0] )
69  return true;
70  else return false;
71  }
72  }
73  }
74  };
75 
76  template <> struct ltstr_p3d<std::pair<Point3df, uint> >
77  {
78  bool operator () ( const std::pair<Point3df, uint> p1,
79  const std::pair<Point3df, uint> p2 ) const
80  {
81  if ( p1.second < p2.second )
82  return true;
83  else
84  return false;
85  }
86  };
87 
88  template<class T> class MaximumPoint;
89  template<class T> class SaddlePoint;
90  template<class T> class GreyLevelBlob;
91 
93  {
94 
95  public:
98  BlobMeasurements(float maxInt, float meanInt, float maxCont, float meanCont, float a, float tv=0.0, float tvalue=0.0):
99  maxIntensity(maxInt), meanIntensity(meanInt), maxContrast(maxCont), meanContrast(meanCont), area(a), t(tv), tValue(tvalue) {}
100 
103  float maxContrast;
105  float area;
106  float t;
107  float tValue;
108 
110  };
111 
118  template<class T> class GreyLevelBlob
119  {
120 
121  protected:
122 
123  int _label;
124  std::set<T,ltstr_p3d<T> > listePoints;
127  float scale;
128  bool grow;
129 
130  public:
131 
132  GreyLevelBlob ( MaximumPoint<T> *node, int label )
133  {
134  saddle = 0;
135  maximum = node;
136  node->blob = this;
137  grow = true;
138  _label = label;
139  AddPoint (maximum->_node);
140  }
142  saddle = 0;
143  maximum = 0;
144  grow = true;
145  _label = BACKGROUND;
146  }
147 
149 
150  void AddPoint( T node ) { listePoints.insert(node); }
151  void StopGrowth() { grow = false; }
152  bool CanGrow() { return grow; }
153  int Label() { return _label; }
154 
155  std::set<T, ltstr_p3d<T> > & GetListePoints () { return listePoints; }
156 
158  {
159  saddle = node;
160  node->AddBlob (this);
161  StopGrowth();
162  }
163 
166  float GetScale () { return scale; }
167  void SetScale (float t) { scale = t; }
168 
170 
171  };
172 
174 
175  template<class T> class SaddlePoint
176  {
177 
178  public:
179  T _node;
180  std::list<GreyLevelBlob<T>* > blobList;
181 
182  SaddlePoint () { }
183  SaddlePoint (T node) : _node(node) { }
185 
186  void AddBlob(GreyLevelBlob<T> *blob) { blobList.push_back(blob); }
187  std::list<GreyLevelBlob<T>*> & GetBlobList() { return blobList; }
188 
190 
191  };
192 
194 
195  template<class T> class MaximumPoint
196  {
197 
198  public:
199  T _node;
202 
203  MaximumPoint () : blob(0) { }
204  MaximumPoint ( T node ) : _node(node), blob(0) { }
206 
207  };
208 
210 
211  template<typename Geom, typename Text> class ExtractGreyLevelBlobs
212  {
213 
214  private :
215 
216  typedef typename SiteType<Geom>::type Site;
217  typedef typename TexType<Text>::type Val;
218 
219  TexturedData<Geom,Text> *_texdata;
220  TexturedData<Geom,Text> *_rawtexdata;
221  TexturedData<Geom, Text> *_mask; // For convenience, data and mask are same type.
222  // This is the only simple solution to keep type genericity
223  // Mask is 0 outside, >0 inside
224  std::map<int, GreyLevelBlob<Site>* > blobMap; // map label -> blob
225  std::list<SaddlePoint<Site> *> saddleList;
226  std::list<MaximumPoint<Site> *> maximumList;
227  TexturedData<Geom, Text> labelsImage; // mapping site->label (blob, background...)
228 
229  char *_stats; // File name for blob statistics
230 
231  void DoMasking(); // if required, use a mask to remove some blobs
232  void CheckMask(); // basic check : is the geometry of the mask the same than the data ?
233 
234  public :
235 
237  : _texdata(texdata), _rawtexdata(rawtexdata), _mask(mask), _stats(0){ labelsImage=TexturedData<Geom, Text>(*_texdata); CheckMask();}
239  : _texdata(texdata), _rawtexdata(rawtexdata), _mask(mask), _stats(stats) { labelsImage=TexturedData<Geom, Text>(*_texdata); CheckMask();}
240 
241 
243  : _texdata(texdata), _rawtexdata(NULL), _mask(0), _stats(0) { labelsImage=TexturedData<Geom, Text>(*_texdata);}
245  : _texdata(texdata), _rawtexdata(NULL), _mask(mask), _stats(0) { labelsImage=TexturedData<Geom, Text>(*_texdata); CheckMask();}
247  : _texdata(texdata), _rawtexdata(NULL), _mask(mask), _stats(stats) { labelsImage=TexturedData<Geom, Text>(*_texdata); CheckMask();}
248  void Run(); // possibility of masking to exclude an area
249 
251  void SetOriginalTexture ( TexturedData<Geom,Text> *rawtexdata ) { _rawtexdata = rawtexdata; }
252  TexturedData<Geom,Text> *GetOriginalTexture ( ) { return _rawtexdata; }
253  // doit renvoyer une liste de GLB, de maximums et de saddle points
254  std::list<SaddlePoint<Site> *> GetSaddleList() { return saddleList; }
255  std::list<MaximumPoint<Site> *> GetMaxList() { return maximumList; }
256  std::map<int, GreyLevelBlob<Site> *> GetBlobs() { return blobMap; }
257  TexturedData<Geom, Text> GetBlobImage() { return labelsImage; }
258  int nbBlobs() { return blobMap.size(); }
259 
260  };
261 
262 
264 
265  template<typename T> class GreyLevelBlobTools
266  {
267 
268  private :
269  GreyLevelBlob<T> *_blob;
270 
271  public :
272 
273  GreyLevelBlobTools(GreyLevelBlob<T> *blob) : _blob(blob) {}
274  std::vector<float> Boundingbox();
275  std::vector<float> Barycenter();
276 
277  };
278 
279  //---------------------------------------------------------------------------
280  //
281  // Methods
282  //
283  //---------------------------------------------------------------------------
284 
285  inline
287  {
290  maxContrast=other.maxContrast;
292  area=other.area;
293  t=other.t;
294  tValue=other.tValue;
295 
296  return *this;
297  }
298 
299  //----------------------------------------------------------------------------------------------------------
300 
301  template<class T>
302  inline
304  {
305  _node=other.node;
306  return *this;
307  }
308 
309  //----------------------------------------------------------------------------------------------------------
310 
311  template<class T>
312  inline
314  {
315  _node=other.node;
316  blob=other.blob;
317  return *this;
318  }
319 
320  //----------------------------------------------------------------------------------------------------------
321 
322  template<class T>
323  inline
325  {
326  _label=other._label;
327  listePoints=other.listePoints;
328  scale=other.scale;
329  saddle=other.saddle;
330  maximum=other.maximum;
331 
332  return *this;
333  }
334 
335  //----------------------------------------------------------------------------------------------------------
336 
337  template<typename Geom, typename Text> void ExtractGreyLevelBlobs<Geom, Text>::Run()
338  {
339  int currentLabel=0, labelBlob;
340  MaximumPoint<Site> *maximum;
341  SaddlePoint<Site> *saddle;
342  GreyLevelBlob<Site> *greyLevelBlob;
343 
344  // multimap<intensity, data.site> for intensity based sorting of sites/voxels
345  std::multimap<const Val, Site> sortedSites;
346  SiteIterator<Geom> ptSite=(*_texdata).siteBegin();
347 
348  for ( ; ptSite != (*_texdata).siteEnd(); ++ptSite)
349  sortedSites.insert(std::pair<const Val, Site>((*_texdata).intensity(*ptSite), (*ptSite)));
350 
351 
352 
353  // TexturedData that will contains the label associated with each site,
354  // that is: BACKGROUND, or grey-level blob number.
355  // This TexturedData also gives acess to the neighbours of each site
356 
357  // Rem: labels should be (int) but will be same type than Text to handle both surfaces
358  // and images. Not elegant but that's all I found so far.
359 
360  for (ptSite=labelsImage.siteBegin(); ptSite != labelsImage.siteEnd(); ++ptSite)
361  labelsImage.intensity(*ptSite)=BACKGROUND;
362  // GL Blob extraction
363  // This is the core algorithm
364  typename std::multimap<const Val, Site>::reverse_iterator ptSortedSites;
365 
366  //std::cout << "DEBUG: extractor has started detection" << std::endl;
367  for ( ptSortedSites=sortedSites.rbegin(); ptSortedSites != sortedSites.rend(); ++ptSortedSites) {
368  Val intensity=(*_texdata).intensity((*ptSortedSites).second);
369 
370  int nbAbove;
371  int nbAboveLabels;
372 
373  // How many neighbours with higher intensity ?
374 
375  std::vector<Site> neighb=(*_texdata).neighbours((*ptSortedSites).second); //neighbours
376 
377  std::vector<Site> above; //neighbours with higher intensity
378  std::set<int> aboveLabels; // labels of (above)
379  typename std::vector<Site>::iterator ptNeigh=neighb.begin();
380 
381  for ( ; ptNeigh != neighb.end(); ++ptNeigh){
382 
383  if ((*_texdata).intensity(*ptNeigh) > intensity){
384 
385  above.push_back(*ptNeigh);
386  aboveLabels.insert(int(labelsImage.intensity(*ptNeigh)));
387  }
388  }
389 
390  nbAbove=above.size();
391  nbAboveLabels=aboveLabels.size();
392 
393  if (nbAbove==0){ // Case 1: local max, new blob
394  currentLabel++;
395  maximum=new MaximumPoint<Site>((*ptSortedSites).second);
396  greyLevelBlob=new GreyLevelBlob<Site>(maximum, currentLabel);
397  labelsImage.intensity((*ptSortedSites).second)=(Val) currentLabel;
398  maximumList.push_back(maximum);
399  blobMap[currentLabel]=(greyLevelBlob);
400 
401  }
402  else if ( (nbAbove==1) && ((labelsImage.intensity(*(above.begin())))==BACKGROUND) ){
403  // Case 2: point in background
404  labelsImage.intensity((*ptSortedSites).second)=BACKGROUND;
405 
406  }
407 
408  else if ((nbAbove>1) && (nbAboveLabels>1)){
409  // Case 3: one or several blobs to stop -> Saddle point
410 
411  int flagS=0;
412  labelsImage.intensity((*ptSortedSites).second)=BACKGROUND;
413  std::set<int>::iterator ptLabels=aboveLabels.begin();
414  for (; ptLabels != aboveLabels.end(); ++ptLabels)
415  if (*ptLabels!=BACKGROUND)
416  if (blobMap[*ptLabels]->CanGrow())
417  {
418  if (flagS==0)
419  {
420  saddle=new SaddlePoint<Site>((*ptSortedSites).second);
421  saddleList.push_back(saddle);
422  blobMap[*ptLabels]->SetSaddle(saddle);
423  flagS=1;
424  }
425  else
426  blobMap[*ptLabels]->SetSaddle(saddle);
427  }
428  }
429  else // Case 4: point belong to a growing blob
430  {
431  labelBlob=int(labelsImage.intensity(*(above.begin())));
432  if ((labelBlob != BACKGROUND) && (blobMap[labelBlob]->CanGrow() ))
433  {
434  labelsImage.intensity((*ptSortedSites).second)=(Val) labelBlob;
435  blobMap[labelBlob]->AddPoint((*ptSortedSites).second);
436  }
437  else
438  {
439  labelsImage.intensity((*ptSortedSites).second)=BACKGROUND;
440  }
441  }
442  }
443  //std::cout << "DEBUG: found " << blobMap.size() << " blobs" << std::endl;
444  //std::cout << "DEBUG: extractor about to enter masking" << std::endl;
445  if (_mask!=0) { DoMasking();
446  std::cout<<"MASKING" << std::endl;
447  }
448  //std::cout << "DEBUG: masking done, extractor about to enter measurements" << std::endl;
449  ComputeBlobMeasurements();
450  //std::cout << "DEBUG: done" << std::endl;
451  }
452 
453  //----------------------------------------------------------------------------------------------------------
454 
455  template<typename Geom, typename Text> void ExtractGreyLevelBlobs<Geom, Text>::DoMasking() {
456  typename std::list<MaximumPoint<Site> *>::iterator itMax=maximumList.begin(), itPrevious=itMax;
457  SaddlePoint<Site> *saddle;
458  double EPSILON = 0.00001;
459  int del = 0;
460 
461  std::cout << "DEBUG: found " << blobMap.size() << " blobs" << std::endl;
462  std::cout << "DEBUG: saddle list size : " << saddleList.size() << std::endl;
463 
464  for ( ; itMax != maximumList.end() ; ++itMax ) {
465  if ( del == 1 ) {
466  maximumList.erase(itPrevious);
467  }
468  del = 0;
469  if ( fabs ( _mask->intensity((*itMax)->_node)) < EPSILON ) { // this is to test float=0.0
470  blobMap.erase ( (*itMax)->blob->Label() ); // remove the blob from the list.
471 
472  saddle = (*itMax)->blob->GetSaddle(); // check the saddle
473  if ( saddle != 0 ) { // some blobs can have no saddle if they are on the image border
474  if ( saddle->blobList.size() > 1 ) {
475  saddle->blobList.remove( (*itMax)->blob );
476  }
477  else {
478  saddle->blobList.remove((*itMax)->blob);
479  saddleList.remove(saddle);
480  delete saddle;
481  }
482  }
483  delete (*itMax)->blob; // delete the blob
484  del = 1; // maximum has to be deleted
485  }
486  itPrevious=itMax;
487  }
488  if ( del == 1 )
489  maximumList.erase(itPrevious);
490  std::cout << "DEBUG: found " << blobMap.size() << " blobs" << std::endl;
491  }
492 
493  //----------------------------------------------------------------------------------------------------------
494 
495  template<typename Geom, typename Text> void ExtractGreyLevelBlobs<Geom, Text>::CheckMask()
496  {
497  if (_mask != 0)
498  if (_mask->NbSites() != _texdata->NbSites())
499  {
500  std::cerr << "ExtractGreyLevelBlobs : mask and data do not have the same number of sites !!!" << std::endl;
501  exit(EXIT_FAILURE);
502  }
503  }
504 
505  //----------------------------------------------------------------------------------------------------------
506 
507  template<typename Geom, typename Text>
508  void
510  typename std::map<int, GreyLevelBlob<Site>* >::iterator blobIt;
511  GreyLevelBlob<Site> *blob;
512  SaddlePoint<Site> *saddle;
513  MaximumPoint<Site> *maxi;
514  Val saddleInt, maxInt, intensity;
515  float maxIntensity, meanIntensity, maxContrast, meanContrast, area;
516  int nbPoint;
517  FILE *fileStat = 0;
518 
519  if ( _stats != 0 ) {
520  fileStat = fopen ( _stats, "w" );
521  fprintf ( fileStat, "Blob_label max_int mean_int max_cont mean_cont area\n" );
522  }
523 
524  //std::cout << "DEBUG: going through blob list" << std::endl;
525  //std::cout << "DEBUG: Size of list : " << blobMap.size() << std::endl;
526  //std::cout << "DEBUG: saddle list size : " << saddleList.size() << std::endl;
527  for ( blobIt = blobMap.begin() ; blobIt != blobMap.end() ; ++blobIt ) {
528  //std::cout << ((*blobIt).second)->Label(); fflulongsh(stdout);
529  //std::cout << "DEBUG : blob " << (*blobIt).first << std::endl;
530  maxIntensity = 0.0;
531  meanIntensity = 0.0;
532  maxContrast = 0.0;
533  meanContrast = 0.0;
534  nbPoint = 0;
535  area = 0.0; // pour l'instant il s'agit du nombre de points
536  // donc tres mauvais pour les surfaces
537  blob = (*blobIt).second;
538  //std::cout << "DEBUG : getting saddle" << std::endl;
539  saddle = blob->GetSaddle();
540  //std::cout << "DEBUG : getting maxi" << std::endl;
541  maxi=blob->GetMaximum();
542  //std::cout << "DEBUG : sites : " << (*_texdata).NbSites() << std::endl;
543  //std::cout << "DEBUG : getting max intensity" << std::endl;
544  maxInt=(*_texdata).intensity(maxi->_node);
545  //std::cout << "DEBUG : getting saddle intensity" << std::endl;
546  if (saddle != 0) {
547  //std::cout << "DEBUG : saddle : " << (saddle) << std::endl;
548  saddleInt=(*_texdata).intensity(saddle->_node);
549  }
550  else {
551  //std::cout << "DEBUG : blob " << blob->Label() << " has no saddle " << std::endl;
552  //std::cout << " ! " << std::flush;
553  saddleInt=0;
554  }
555  maxContrast=float(maxInt-saddleInt);
556  maxIntensity=float(maxInt);
557 
558  std::set<Site,ltstr_p3d<Site> > listePoints=blob->GetListePoints();
559  typename std::set<Site,ltstr_p3d<Site> >::iterator
560  itPoints=listePoints.begin();
561  Site point;
562 
563  //std::cout << "DEBUG : going through points" << std::endl;
564  for (; itPoints!=listePoints.end(); ++itPoints) {
565  point=(*itPoints);
566  intensity=(*_texdata).intensity(point);
567  nbPoint++;
568  area=area+1.0;
569  meanContrast+=float(intensity - saddleInt);
570  meanIntensity+=float(intensity);
571  }
572  meanContrast/=float(nbPoint);
573  meanIntensity/=float(nbPoint);
574 
575  //std::cout << " + " << std::flush;
576  blob->measurements.maxIntensity=maxIntensity;
577  blob->measurements.meanIntensity=meanIntensity;
578  blob->measurements.maxContrast=maxContrast;
579  blob->measurements.meanContrast=meanContrast;
580  blob->measurements.area=area;
581 
582 
583  if ( GetOriginalTexture() != NULL ) {
584  std::set<Site,ltstr_p3d<Site> > pixels;
585  pixels = blob->GetListePoints();
586 
587  typename std::set<Site, ltstr_p3d<Site> >::iterator itPix;
588  float tvmax = -100.0;
589  for ( itPix = pixels.begin() ; itPix != pixels.end() ; itPix++ ) {
590  if ( float ( GetOriginalTexture()->intensity(*itPix) ) > tvmax )
591  tvmax = float ( GetOriginalTexture()->intensity(*itPix) );
592  }
593  blob->measurements.t = tvmax;
594  }
595  else {
596  std::cout << "BLOBMEASUREMENT = 0.0" << std::endl;
597  blob->measurements.t = 0.0;
598  }
599 
600 
601  //std::cout << " - " << std::flush;
602  if ( fileStat != 0 )
603  fprintf ( fileStat, "%i %.4f %.4f %.4f %.4f %.4f\n", blob->Label(),
604  maxIntensity, meanIntensity, maxContrast, meanContrast, area);
605  //std::cout << " | " << std::flush;
606  }
607  if ( fileStat != 0 )
608  fclose(fileStat);
609  }
610 
611  //----------------------------------------------------------------------------------------
612 
613  // Image specialisation
614 
615  template <>
616  std::vector<float>
618  {
619 
620  std::set<Point3d,ltstr_p3d<Point3d> > listeP=_blob->GetListePoints();
621  std::set<Point3d,ltstr_p3d<Point3d> >::iterator pointIt=listeP.begin();
622 
623  float x1,x2,y1,y2,z1,z2;
624 
625  x1=10000.0; y1=10000.0; z1=10000.0;
626  x2=-10000.0; y2=-10000.0; z2=-10000.0;
627  std::vector<float> vectF(6);
628 
629  for (; pointIt != listeP.end(); ++pointIt)
630  {
631  float x=(float) (*pointIt)[0];
632  float y=(float) (*pointIt)[1];
633  float z=(float) (*pointIt)[2];
634  if (x<x1) x1=x;
635  if (x>x2) x2=x;
636  if (y<y1) y1=y;
637  if (y>y2) y2=y;
638  if (z<z1) z1=z;
639  if (z>z2) z2=z;
640  }
641 
642  vectF[0]=x1; vectF[1]=y1; vectF[2]=z1;
643  vectF[3]=x2; vectF[4]=y2; vectF[5]=z2;
644 
645  return vectF;
646  }
647 
648  template <>
649  std::vector<float>
651  {
652  Point3d max= _blob->GetMaximum()->_node;
653  std::vector<float> triplet;
654  triplet.push_back(max[0]);
655  triplet.push_back(max[1]);
656  triplet.push_back(max[2]);
657  return triplet;
658 
659  }
660 
661  // Surface specialisation
662 
663  template <>
664  std::vector<float>
666  {
667  std::set<std::pair<Point3df,uint> ,ltstr_p3d<std::pair<Point3df,uint> > > listeP=_blob->GetListePoints();
668  std::set<std::pair<Point3df,uint> ,ltstr_p3d<std::pair<Point3df,uint> > >::iterator pointIt=listeP.begin();
669 
670  float x1,x2,y1,y2,z1,z2;
671 
672  x1=10000.0; y1=10000.0; z1=10000.0;
673  x2=-10000.0; y2=-10000.0; z2=-10000.0;
674 
675  std::vector<float> vectF(6);
676 
677  for (; pointIt != listeP.end(); ++pointIt)
678  {
679  float x=(float) (*pointIt).first[0];
680  float y=(float) (*pointIt).first[1];
681  float z=(float) (*pointIt).first[2];
682  if (x<x1) x1=x;
683  if (x>x2) x2=x;
684  if (y<y1) y1=y;
685  if (y>y2) y2=y;
686  if (z<z1) z1=z;
687  if (z>z2) z2=z;
688  }
689 
690  vectF[0]=x1; vectF[1]=y1; vectF[2]=z1;
691  vectF[3]=x2; vectF[4]=y2; vectF[5]=z2;
692 
693  return vectF;
694  }
695 
696 
697 
698 template <>
699  std::vector<float>
701 {
702  Point3df max= _blob->GetMaximum()->_node.first;
703  std::vector<float> triplet;
704  triplet.push_back(max[0]);
705  triplet.push_back(max[1]);
706  triplet.push_back(max[2]);
707  return triplet;
708 
709 }
710 }
711 #endif
BlobMeasurements(float maxInt, float meanInt, float maxCont, float meanCont, float a, float tv=0.0, float tvalue=0.0)
Definition: greyLevelBlob.h:98
BlobMeasurements & operator=(const BlobMeasurements &other)
BlobMeasurements(const BlobMeasurements &other)
Definition: greyLevelBlob.h:97
Class that define grey-level blobs algorithm extraction.
ExtractGreyLevelBlobs(TexturedData< Geom, Text > *texdata, TexturedData< Geom, Text > *rawtexdata, TexturedData< Geom, Text > *mask)
TexturedData< Geom, Text > GetBlobImage()
void SetOriginalTexture(TexturedData< Geom, Text > *rawtexdata)
std::map< int, GreyLevelBlob< Site > * > GetBlobs()
std::list< MaximumPoint< Site > * > GetMaxList()
TexturedData< Geom, Text > * GetOriginalTexture()
ExtractGreyLevelBlobs(TexturedData< Geom, Text > *texdata, TexturedData< Geom, Text > *rawtexdata, TexturedData< Geom, Text > *mask, char *stats)
ExtractGreyLevelBlobs(TexturedData< Geom, Text > *texdata, TexturedData< Geom, Text > *mask)
ExtractGreyLevelBlobs(TexturedData< Geom, Text > *texdata, TexturedData< Geom, Text > *mask, char *stats)
ExtractGreyLevelBlobs(TexturedData< Geom, Text > *texdata)
std::list< SaddlePoint< Site > * > GetSaddleList()
class that provide some tools for blob management
std::vector< float > Barycenter()
std::vector< float > Boundingbox()
GreyLevelBlobTools(GreyLevelBlob< T > *blob)
Class for grey-level blobs Templated with respect to the type of points: TypeSite<carto::VolumeRef<T>...
void SetScale(float t)
void SetSaddle(SaddlePoint< T > *node)
MaximumPoint< T > * maximum
std::set< T, ltstr_p3d< T > > listePoints
std::set< T, ltstr_p3d< T > > & GetListePoints()
GreyLevelBlob< T > & operator=(const GreyLevelBlob< T > &other)
SaddlePoint< T > * GetSaddle()
MaximumPoint< T > * GetMaximum()
SaddlePoint< T > * saddle
GreyLevelBlob(MaximumPoint< T > *node, int label)
BlobMeasurements measurements
void AddPoint(T node)
class for maxima
GreyLevelBlob< T > * blob
MaximumPoint< T > & operator=(const MaximumPoint< T > &other)
class for saddle points
std::list< GreyLevelBlob< T > * > blobList
std::list< GreyLevelBlob< T > * > & GetBlobList()
void AddBlob(GreyLevelBlob< T > *blob)
SaddlePoint< T > & operator=(const SaddlePoint< T > &other)
T * iterator
float max(float x, float y)
Definition: thickness.h:98
const int BACKGROUND
Definition: greyLevelBlob.h:46
BucketMap< Void > * mask(const BucketMap< Void > &src, const BucketMap< Void > &m, bool intersect=true)
#define EPSILON
bool operator()(const T p1, const T p2) const
Definition: greyLevelBlob.h:50