]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrow.h
index 71db89cb1eb04e2abb06a5b310ffcfed20512f10..dbc57f00759be5d017c1c49bb0c42f0eba583c71 100644 (file)
@@ -1,9 +1,6 @@
-#ifndef __FPA__IMAGE__REGIONGROW__H__
-#define __FPA__IMAGE__REGIONGROW__H__
+#ifndef __fpa__Image__RegionGrow__h__
+#define __fpa__Image__RegionGrow__h__
 
-#include <itkFunctionBase.h>
-#include <itkImageToImageFilter.h>
-#include <itkIndex.h>
 #include <fpa/Base/RegionGrow.h>
 #include <fpa/Image/Algorithm.h>
 
@@ -12,67 +9,47 @@ namespace fpa
   namespace Image
   {
     /**
-     * @param I Input image type
-     * @param O Output image type
      */
-    template< class I, class O >
+    template< class _TInputImage, class _TOutputImage >
     class RegionGrow
-      : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
+      : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage > >
     {
     public:
-      typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
+      typedef fpa::Image::Algorithm< _TInputImage, _TOutputImage > TAlgorithm;
+      typedef RegionGrow                          Self;
+      typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
+      typedef itk::SmartPointer< Self >           Pointer;
+      typedef itk::SmartPointer< const Self >     ConstPointer;
 
-      typedef RegionGrow                        Self;
-      typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
-      typedef itk::SmartPointer< Self >         Pointer;
-      typedef itk::SmartPointer< const Self >   ConstPointer;
+      typedef typename Superclass::TOutput TOutput;
+      typedef typename Superclass::TVertex TVertex;
 
-      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;
-
-    protected:
-      typedef typename Superclass::_TVertices      _TVertices;
-      typedef typename Superclass::_TCollision     _TCollision;
-      typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
-      typedef typename Superclass::_TCollisions    _TCollisions;
-      typedef typename Superclass::_TNode          _TNode;
-      typedef typename Superclass::_TNodes         _TNodes;
+      typedef fpa::Image::Functors::Base< _TInputImage, typename Superclass::TGrowFunction > TGrowFunction;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( RegionGrow, Algorithm );
-
-      itkGetObjectMacro( MembershipFunction, TMembershipFunction );
-      itkGetConstObjectMacro( MembershipFunction, TMembershipFunction );
-      itkSetObjectMacro( MembershipFunction, TMembershipFunction );
+      itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow );
 
     protected:
       RegionGrow( );
       virtual ~RegionGrow( );
 
-      virtual bool _CheckMembership( const TVertex& v ) const;
-      virtual void _InitResults( );
+      virtual void _BeforeGenerateData( ) override;
 
     private:
-      // Purposely not implemented
+      // Purposely not defined
       RegionGrow( const Self& other );
       Self& operator=( const Self& other );
-
-    protected:
-      typename TMembershipFunction::Pointer m_MembershipFunction;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-#include <fpa/Image/RegionGrow.hxx>
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <fpa/Image/RegionGrow.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
-#endif // __FPA__IMAGE__REGIONGROW__H__
+#endif // __fpa__Image__RegionGrow__h__
 
 // eof - $RCSfile$