]> Creatis software - FrontAlgorithms.git/blobdiff - libs/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / libs / fpa / Image / RegionGrow.h
index 6981f756f124dcc1d997bc423cbbbee1e1664fca..f60847982cff93c6225b3138634e3b22999d6d7c 100644 (file)
@@ -8,7 +8,8 @@
 
 #include <itkImageToImageFilter.h>
 #include <itkFunctionBase.h>
-#include <set>
+#include <fpa/Base/SeedsInterface.h>
+#include <fpa/Image/MarksInterface.h>
 
 namespace fpa
 {
@@ -18,26 +19,28 @@ 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 fpa::Image::MarksInterface< _TInputImage::ImageDimension >
     {
     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 fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface;
       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 +54,6 @@ namespace fpa
     public:
       void SetPredicate( TIntensityFunctor* functor );
 
-      void AddSeed( const TIndex& seed );
-
     protected:
       RegionGrow( );
       virtual ~RegionGrow( );
@@ -70,7 +71,6 @@ namespace fpa
 
     protected:
       typename TIntensityFunctor::Pointer m_IntensityFunctor;
-      TSeeds m_Seeds;
       TOutputPixel m_InsideValue;
       TOutputPixel m_OutsideValue;
     };