]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/DijkstraWithEndPointDetection.h
Some more tests
[FrontAlgorithms.git] / lib / fpa / Image / DijkstraWithEndPointDetection.h
index 881b8f8e56fb4bfd8824fa9e02a96fd4cea828a4..c63f4f11ecf6073d3ae7fd9bba319ce7156a9ec8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
 #define __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
 
+#include <map>
 #include <itkImage.h>
 #include <fpa/Image/Dijkstra.h>
 
@@ -40,13 +41,20 @@ namespace fpa
       typedef typename Superclass::TFrontEvent     TFrontEvent;
       typedef typename Superclass::TFreezeEvent    TFreezeEvent;
 
-      typedef typename Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
-      typedef typename Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
-      typedef typename Superclass::TBacktrackingEvent TBacktrackingEvent;
+      typedef typename
+      Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
+      typedef typename
+      Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
+      typedef typename
+      Superclass::TBacktrackingEvent TBacktrackingEvent;
 
       typedef unsigned short                          TLabel;
       typedef itk::Image< TLabel, I::ImageDimension > TLabelImage;
 
+      typedef std::set< TVertex, TVertexCompare > TUniqueVertices;
+      typedef std::map< TVertex, TLabel, TVertexCompare >  TBranch;
+      typedef std::map< TVertex, TBranch, TVertexCompare > TBranches;
+
     protected:
       typedef typename Superclass::_TVertices      _TVertices;
       typedef typename Superclass::_TCollision     _TCollision;
@@ -66,9 +74,10 @@ namespace fpa
       itkNewMacro( Self );
       itkTypeMacro( DijkstraWithEndPointDetection, Dijkstra );
 
-      itkGetConstMacro( EndPoints, TVertices );
-      itkGetConstMacro( BifurcationPoints, TVertices );
+      itkGetConstMacro( EndPoints, TUniqueVertices );
+      itkGetConstMacro( BifurcationPoints, TUniqueVertices );
       itkGetConstMacro( NumberOfBranches, unsigned long );
+      itkGetConstMacro( Branches, TBranches );
 
     public:
       TLabelImage* GetLabelImage( );
@@ -85,6 +94,13 @@ namespace fpa
 
       _TRegion _Region( const TVertex& c, const double& r );
 
+      template< class _T >
+      TVertex _MaxInRegion(
+        const _T* image, const TVertex& v, const double& r
+        );
+
+      void _Label( const TVertex& v, const TLabel& l );
+
     private:
       // Purposely not implemented
       DijkstraWithEndPointDetection( const Self& other );
@@ -93,10 +109,11 @@ namespace fpa
     protected:
       unsigned int m_LabelImageIndex;
 
-      _TCandidates  m_Candidates;
-      TVertices     m_BifurcationPoints;
-      TVertices     m_EndPoints;
-      unsigned long m_NumberOfBranches;
+      _TCandidates    m_Candidates;
+      TUniqueVertices m_BifurcationPoints;
+      TUniqueVertices m_EndPoints;
+      unsigned long   m_NumberOfBranches;
+      TBranches       m_Branches;
     };
 
   } // ecapseman