]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrow.h
index 2deff2f637de9001588b0ddbd8bdf1e261188ee1..09631cc93becb731af623c166b7ca2a40fddc04d 100644 (file)
@@ -6,10 +6,12 @@
 #ifndef __fpa__Image__RegionGrow__h__
 #define __fpa__Image__RegionGrow__h__
 
-#include <fpa/Base/RegionGrow.h>
 #include <fpa/Base/MarksInterfaceWithCollisions.h>
+#include <fpa/Base/RegionGrow.h>
 #include <fpa/Base/SeedsInterface.h>
 #include <fpa/Image/Algorithm.h>
+#include <fpa/Image/DefaultTraits.h>
+
 
 namespace fpa
 {
@@ -17,45 +19,32 @@ namespace fpa
   {
     /**
      */
-    template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char >
+    template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char, class _TTraits = fpa::Image::DefaultTraits< _TInputImage, _TOutputImage, _TFrontId > >
     class RegionGrow
-      : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage, fpa::Base::MarksInterfaceWithCollisions< typename _TInputImage::IndexType >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::PointType, typename _TInputImage::PixelType, typename _TOutputImage::PixelType, _TFrontId, typename _TInputImage::IndexType::LexicographicCompare > > >
+      : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterfaceWithCollisions< _TTraits >, fpa::Base::SeedsInterface< _TTraits > > >
     {
     public:
       typedef _TInputImage  TInputImage;
       typedef _TOutputImage TOutputImage;
-      typedef _TFrontId     TFrontId;
-
-      typedef typename TInputImage::IndexType        TVertex;
-      typedef typename TInputImage::PointType        TPoint;
-      typedef typename TVertex::LexicographicCompare TVertexCompare;
-      typedef typename TInputImage::PixelType        TInputValue;
-      typedef typename TOutputImage::PixelType       TOutputValue;
+      typedef _TTraits      TTraits;
+      typedef fpa::Base::MarksInterfaceWithCollisions< TTraits > TMarksInterface;
+      typedef fpa::Base::SeedsInterface< TTraits > TSeedsInterface;
 
-      typedef fpa::Base::MarksInterfaceWithCollisions< TVertex > TMarksInterface;
-      typedef fpa::Base::SeedsInterface< TVertex, TPoint, TInputValue, TOutputValue, TFrontId, TVertexCompare > TSeedsInterface;
-      typedef fpa::Image::Algorithm< TInputImage, TOutputImage, TMarksInterface, TSeedsInterface > TAlgorithm;
-
-      typedef RegionGrow                          Self;
+      typedef fpa::Image::Algorithm< TTraits, TMarksInterface, TSeedsInterface > TAlgorithm;
       typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
+      typedef RegionGrow                          Self;
       typedef itk::SmartPointer< Self >           Pointer;
       typedef itk::SmartPointer< const Self >     ConstPointer;
 
-      typedef typename TSeedsInterface::TNode  TNode;
-      typedef typename TSeedsInterface::TNodes TNodes;
+      fpa_Base_TraitTypes( typename TTraits );
 
     public:
       itkNewMacro( Self );
       itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow );
 
     protected:
-      RegionGrow( )
-        : Superclass( )
-        {
-        }
-      virtual ~RegionGrow( )
-        {
-        }
+      RegionGrow( ) : Superclass( ) { }
+      virtual ~RegionGrow( )        { }
 
     private:
       // Purposely not implemented.