]> Creatis software - FrontAlgorithms.git/blobdiff - appli/CTBronchi/Process.h
...
[FrontAlgorithms.git] / appli / CTBronchi / Process.h
index 7d5e2dd70121cb8cbaf90d294d2d036fd7472842..b14db2b39c3b2e4a3181d2da1ce5e0402b515f3d 100644 (file)
@@ -5,6 +5,7 @@
 #define __CTBronchi__Process__h__
 
 #include <map>
+#include <set>
 #include <tuple>
 #include <fpa_ctbronchi_export.h>
 #include "Image.h"
@@ -15,6 +16,8 @@ namespace CTBronchi
   class FPA_CTBRONCHI_EXPORT Process
   {
   public:
+    typedef Process Self;
+
     // Some types and values
     static const unsigned int Dim = 3;
     typedef short         TPixel;
@@ -37,9 +40,19 @@ namespace CTBronchi
     typedef CTBronchi::Skeleton< Dim > TSkeleton;
 
     // Seed
-    typedef TPixelImage::TImage::PointType TPoint;
-    typedef TPixelImage::TImage::IndexType TIndex;
-    typedef std::pair< TIndex, TPoint >    TSeed;
+    typedef TPixelImage::TImage::PointType    TPoint;
+    typedef TPixelImage::TImage::IndexType    TIndex;
+    typedef std::pair< TIndex, TPoint >       TSeed;
+    typedef std::pair< TIndex, unsigned int > TEndPoint;
+    struct TEndPointCompare
+    {
+      bool operator()( const TEndPoint& a, const TEndPoint& b ) const
+        {
+          return( cmp( a.first, b.first ) );
+        }
+      TIndex::LexicographicCompare cmp;
+    };
+    typedef std::set< TEndPoint, TEndPointCompare > TEndPoints;
 
   public:
     Process( );
@@ -74,11 +87,19 @@ namespace CTBronchi
     template< class _TInput >
     void _AndImages( _TInput& a, _TInput& b, _TInput& c );
 
-    template< class _TInput, class _TSkeleton >
+    template< class _TInput, class _TSkeleton, class _TIndices >
     void _Skeleton(
       _TInput& a, _TSkeleton& s,
-      const TString& fname,
-      const TString& pname
+      _TIndices& e, unsigned int id,
+      const TString& fname
+      );
+
+    template< class _TIndices >
+    void _Points(
+      _TIndices& a, unsigned int ca,
+      _TIndices& b, unsigned int cb,
+      _TIndices& c, unsigned int cc,
+      _TIndices& d
       );
 
   protected:
@@ -101,6 +122,10 @@ namespace CTBronchi
     TSkeleton m_FastRWSkeleton;
     TSkeleton m_SliceRWSkeleton;
     TSkeleton m_AndRWSkeleton;
+
+    TEndPoints m_FastRWPoints;
+    TEndPoints m_SliceRWPoints;
+    TEndPoints m_AndRWPoints;
   };
 
 } // ecapseman