]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MoriRegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Image / MoriRegionGrow.h
index 57085825705893cf0cfd7c710d157d888a9b518a..41c122e32d9caf0c5d5cc89cdcb0e493ff23fb12 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef __fpa__Image__MoriRegionGrow__h__
 #define __fpa__Image__MoriRegionGrow__h__
 
-#include <fpa/Base/MoriRegionGrow.h>
-#include <fpa/Image/Algorithm.h>
+#include <itkImageToImageFilter.h>
+#include <itkBinaryThresholdImageFilter.h>
+#include <fpa/Image/MoriRegionGrowHelper.h>
 
 namespace fpa
 {
@@ -10,36 +11,74 @@ namespace fpa
   {
     /**
      */
-    template< class _TInputImage, class _TOutputImage >
+    template< class _TInputImage, class _TOutputImage, class _TAuxPixel = unsigned short >
     class MoriRegionGrow
-      : public fpa::Base::MoriRegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage > >
+      : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
     {
     public:
-      typedef fpa::Image::Algorithm< _TInputImage, _TOutputImage > TAlgorithm;
-      typedef MoriRegionGrow                          Self;
-      typedef fpa::Base::MoriRegionGrow< TAlgorithm > Superclass;
-      typedef itk::SmartPointer< Self >           Pointer;
-      typedef itk::SmartPointer< const Self >     ConstPointer;
+      typedef MoriRegionGrow                                         Self;
+      typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
+      typedef itk::SmartPointer< Self >                              Pointer;
+      typedef itk::SmartPointer< const Self >                        ConstPointer;
 
-      typedef typename Superclass::TOutput TOutput;
-      typedef typename Superclass::TVertex TVertex;
+      typedef itk::Image< _TAuxPixel, _TInputImage::ImageDimension >      TAuxImage;
+      typedef fpa::Image::MoriRegionGrowHelper< _TInputImage, TAuxImage > THelper;
+      typedef itk::BinaryThresholdImageFilter< TAuxImage, _TOutputImage > TThreshold;
 
-      typedef fpa::Image::Functors::Base< _TInputImage, typename Superclass::TGrowFunction > TGrowFunction;
+      typedef typename _TInputImage::IndexType  TIndex;
+      typedef typename _TInputImage::PixelType  TInputPixel;
+      typedef typename _TOutputImage::PixelType TOutputPixel;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( fpa::Image::MoriRegionGrow, fpa::Base::MoriRegionGrow );
+      itkTypeMacro( fpa::Image::MoriRegionGrow, itk::ImageToImageFilter );
+
+      itkGetConstMacro( Seed, TIndex );
+      itkSetMacro( Seed, TIndex );
+
+    public:
+      TAuxImage* GetAuxiliaryImage( );
+      const TAuxImage* GetAuxiliaryImage( ) const;
+
+      TInputPixel GetLower( ) const;
+      TInputPixel GetUpper( ) const;
+      TInputPixel GetStep( ) const;
+      TOutputPixel GetInsideValue( ) const;
+      TOutputPixel GetOutsideValue( ) const;
+
+      void SetLower( const TInputPixel& v );
+      void SetUpper( const TInputPixel& v );
+      void SetStep( const TInputPixel& v );
+      void SetInsideValue( const TOutputPixel& v );
+      void SetOutsideValue( const TOutputPixel& v );
+
+
+      /* TODO
+         itkGetConstMacro( Lower, TPixel );
+         itkGetConstMacro( Upper, TPixel );
+         itkGetConstMacro( Step, TPixel );
+         itkGetConstMacro( Sensitivity, double );
+         itkSetMacro( Lower, TPixel );
+         itkSetMacro( Upper, TPixel );
+         itkSetMacro( Step, TPixel );
+         itkSetMacro( Sensitivity, double );
+      */
 
     protected:
       MoriRegionGrow( );
       virtual ~MoriRegionGrow( );
 
-      virtual void _BeforeGenerateData( ) fpa_OVERRIDE;
+      virtual void GenerateData( ) override;
 
     private:
       // Purposely not defined
       MoriRegionGrow( const Self& other );
       Self& operator=( const Self& other );
+
+    protected:
+      typename THelper::Pointer m_Helper;
+      typename TThreshold::Pointer m_Threshold;
+      TIndex m_Seed;
     };
 
   } // ecapseman