]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrow.h
index e20f062e07cf6c2563da1533437ed969bb2f4207..b8147985d53f1fb60c6e99bcd5f28a80d6dc8792 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <itkFunctionBase.h>
 #include <itkImageToImageFilter.h>
+#include <itkIndex.h>
 #include <fpa/Base/RegionGrow.h>
 #include <fpa/Image/Algorithm.h>
 
@@ -14,25 +15,25 @@ namespace fpa
      * @param I Input image type
      * @param O Output image type
      */
-    template< class I, class O >
+    template< class I, class O = I >
     class RegionGrow
-      : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > >
+      : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
     {
     public:
-      typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
+      typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
 
       typedef RegionGrow                        Self;
       typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
       typedef itk::SmartPointer< Self >         Pointer;
       typedef itk::SmartPointer< const Self >   ConstPointer;
 
-      typedef typename Superclass::TInputImage  TInputImage;
-      typedef typename Superclass::TOutputImage TOutputImage;
-      typedef typename Superclass::TVertex      TVertex;
-      typedef typename Superclass::TValue       TValue;
-      typedef typename Superclass::TResult      TResult;
-
-      typedef itk::FunctionBase< TValue, bool > TMembershipFunction;
+      typedef typename Superclass::TInputImage      TInputImage;
+      typedef typename Superclass::TOutputImage     TOutputImage;
+      typedef typename Superclass::TVertex          TVertex;
+      typedef typename Superclass::TValue           TValue;
+      typedef typename Superclass::TResult          TResult;
+      typedef typename Superclass::TSpace           TSpace;
+      typedef typename Superclass::TGrowingFunction TGrowingFunction;
 
     protected:
       typedef typename Superclass::_TVertices      _TVertices;
@@ -46,24 +47,16 @@ namespace fpa
       itkNewMacro( Self );
       itkTypeMacro( RegionGrow, Algorithm );
 
-      itkGetObjectMacro( MembershipFunction, TMembershipFunction );
-      itkGetConstObjectMacro( MembershipFunction, TMembershipFunction );
-      itkSetObjectMacro( MembershipFunction, TMembershipFunction );
-
     protected:
       RegionGrow( );
       virtual ~RegionGrow( );
 
-      virtual bool _CheckMembership( const TVertex& v ) const;
       virtual void _InitResults( );
 
     private:
       // Purposely not implemented
       RegionGrow( const Self& other );
       Self& operator=( const Self& other );
-
-    protected:
-      typename TMembershipFunction::Pointer m_MembershipFunction;
     };
 
   } // ecapseman