]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrow.h
index 14d2f1c41994b216745d3e460e02b0927504346a..4d190dc09e32229afc33dc88da42c55333dbf202 100644 (file)
@@ -1,60 +1,47 @@
-#ifndef __FPA__IMAGE__REGIONGROW__H__
-#define __FPA__IMAGE__REGIONGROW__H__
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
+#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>
+#include <fpa/Image/DefaultTraits.h>
 
 namespace fpa
 {
   namespace Image
   {
     /**
-     * @param I Input image type
-     * @param O Output image type
      */
-    template< class I, class O = I >
+    template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char >
     class RegionGrow
-      : 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 fpa::Base::RegionGrow< fpa::Image::Algorithm< fpa::Image::DefaultTraits< _TInputImage, _TOutputImage, _TFrontId > > >
     {
     public:
-      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 typename Superclass::TSpace           TSpace;
-      typedef typename Superclass::TGrowingFunction TGrowingFunction;
+      typedef _TInputImage  TInputImage;
+      typedef _TOutputImage TOutputImage;
+      typedef _TFrontId     TFrontId;
 
-    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::DefaultTraits< TInputImage, TOutputImage, TFrontId > TTraits;
+      typedef fpa::Image::Algorithm< TTraits >    TAlgorithm;
+      typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
+      typedef RegionGrow                          Self;
+      typedef itk::SmartPointer< Self >           Pointer;
+      typedef itk::SmartPointer< const Self >     ConstPointer;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( RegionGrow, Algorithm );
+      itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow );
 
     protected:
-      RegionGrow( );
-      virtual ~RegionGrow( );
-
-      virtual void _InitResults( );
+      RegionGrow( ) : Superclass( ) { }
+      virtual ~RegionGrow( )        { }
 
     private:
-      // Purposely not implemented
+      // Purposely not implemented.
       RegionGrow( const Self& other );
       Self& operator=( const Self& other );
     };
@@ -63,10 +50,6 @@ namespace fpa
 
 } // ecapseman
 
-#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$