]> Creatis software - FrontAlgorithms.git/blob - libs/fpa/Image/MoriFilterHelper.h
d9a4a3dc5c25d637e59e5494f87365ea6eae1daf
[FrontAlgorithms.git] / libs / fpa / Image / MoriFilterHelper.h
1 #ifndef __fpa__Image__MoriFilterHelper__h__
2 #define __fpa__Image__MoriFilterHelper__h__
3
4 /* TODO
5    #include <fpa/Image/RegionGrow.h>
6    #include <fpa/Image/Functors/RegionGrow/BinaryThreshold.h>
7 */
8 #include <utility>
9 #include <vector>
10 #include <itkImageToImageFilter.h>
11
12 namespace fpa
13 {
14   namespace Image
15   {
16     /**
17      */
18     template< class _TInputImage, class _TOutputImage >
19     class MoriFilterHelper
20       : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
21     {
22     public:
23       typedef MoriFilterHelper                                       Self;
24       typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
25       typedef itk::SmartPointer< Self >                              Pointer;
26       typedef itk::SmartPointer< const Self >                        ConstPointer;
27
28       typedef _TInputImage  TInputImage;
29       typedef _TOutputImage TOutputImage;
30       typedef typename TInputImage::IndexType  TIndex;
31       typedef typename TInputImage::PixelType  TInputPixel;
32       typedef typename TOutputImage::PixelType TOutputPixel;
33
34       typedef std::pair< TInputPixel, unsigned long > TCurveData;
35       typedef std::vector< TCurveData >               TCurve;
36
37       /* TODO
38          typedef typename Superclass::TOutput       TOutput;
39          typedef typename Superclass::TVertex       TVertex;
40          typedef typename Superclass::TGrowFunction TGrowFunction;
41          typedef typename _TInputImage::PixelType   TPixel;
42          typedef fpa::Image::Functors::RegionGrow::BinaryThreshold< _TInputImage, TOutput > TBinThresholdFunction;
43          protected:
44          typedef typename Superclass::_TQueueNode _TQueueNode;
45          typedef typename Superclass::_TQueue     _TQueue;
46       */
47
48     public:
49       itkNewMacro( Self );
50       itkTypeMacro( fpa::Image::MoriFilterHelper, itk::ImageToImageFilter );
51
52       itkGetConstMacro( Seed, TIndex );
53       itkGetConstMacro( Lower, TInputPixel );
54       itkGetConstMacro( Upper, TInputPixel );
55       itkGetConstMacro( Step, TInputPixel );
56       itkGetConstMacro( OptimumThreshold, typename _TOutputImage::PixelType );
57       itkGetConstMacro( Curve, TCurve );
58
59       itkSetMacro( Seed, TIndex );
60       itkSetMacro( Lower, TInputPixel );
61       itkSetMacro( Upper, TInputPixel );
62       itkSetMacro( Step, TInputPixel );
63
64     protected:
65       MoriFilterHelper( )
66         : Superclass( )
67         {
68         }
69       virtual ~MoriFilterHelper( )
70         {
71         }
72
73       /* TODO
74          virtual bool _ContinueGenerateData( ) override;
75          virtual void _BeforeGenerateData( ) override;
76          virtual void _AfterGenerateData( ) override;
77          virtual void _BeforeLoop( ) override;
78          virtual void _AfterLoop( ) override;
79          virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override;
80          virtual bool _UpdateResult( _TQueueNode& n ) override;
81       */
82
83     private:
84       // Purposely not defined
85       MoriFilterHelper( const Self& other );
86       Self& operator=( const Self& other );
87
88     protected:
89       TIndex m_Seed;
90       TInputPixel m_Lower;
91       TInputPixel m_Upper;
92       TInputPixel m_Step;
93       typename _TOutputImage::PixelType m_OptimumThreshold;
94
95       unsigned long m_ActualCount;
96       TCurve m_Curve;
97     };
98
99   } // ecapseman
100
101 } // ecapseman
102
103 /* TODO
104    #ifndef ITK_MANUAL_INSTANTIATION
105    #  include <fpa/Image/MoriFilterHelper.hxx>
106    #endif // ITK_MANUAL_INSTANTIATION
107 */
108
109 #endif // __fpa__Image__MoriFilterHelper__h__
110
111 // eof - $RCSfile$