]> Creatis software - FrontAlgorithms.git/blobdiff - libs/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / libs / fpa / Image / RegionGrow.h
index 6981f756f124dcc1d997bc423cbbbee1e1664fca..e21bbb91ce6e0015abe84fb5e57a453725455f81 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <itkImageToImageFilter.h>
 #include <itkFunctionBase.h>
-#include <set>
+#include <fpa/Base/SeedsInterface.h>
 
 namespace fpa
 {
@@ -18,26 +18,26 @@ namespace fpa
      */
     template< class _TInputImage, class _TOutputImage >
     class RegionGrow
-      : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
+      : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >,
+        public fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >
     {
     public:
       typedef _TInputImage  TInputImage;
       typedef _TOutputImage TOutputImage;
+      typedef typename TInputImage::IndexType  TIndex;
+      typedef typename TInputImage::RegionType TRegion;
+      typedef typename TInputImage::PixelType  TInputPixel;
+      typedef typename TOutputImage::PixelType TOutputPixel;
+      typedef typename TIndex::LexicographicCompare TIndexCompare;
 
       typedef RegionGrow                                                 Self;
       typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
       typedef itk::SmartPointer< Self >                               Pointer;
       typedef itk::SmartPointer< const Self >                    ConstPointer;
 
-      typedef typename TInputImage::IndexType  TIndex;
-      typedef typename TInputImage::RegionType TRegion;
-      typedef typename TInputImage::PixelType  TInputPixel;
-      typedef typename TOutputImage::PixelType TOutputPixel;
-
+      typedef fpa::Base::SeedsInterface< TIndex, TIndexCompare > TSeedsInterface;
       typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor;
 
-      typedef std::set< TIndex, typename TIndex::LexicographicCompare > TSeeds;
-
     public:
       itkNewMacro( Self );
       itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter );
@@ -51,8 +51,6 @@ namespace fpa
     public:
       void SetPredicate( TIntensityFunctor* functor );
 
-      void AddSeed( const TIndex& seed );
-
     protected:
       RegionGrow( );
       virtual ~RegionGrow( );
@@ -70,7 +68,9 @@ namespace fpa
 
     protected:
       typename TIntensityFunctor::Pointer m_IntensityFunctor;
-      TSeeds m_Seeds;
+      /* TODO
+         TSeeds m_Seeds;
+      */
       TOutputPixel m_InsideValue;
       TOutputPixel m_OutsideValue;
     };