]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Algorithms/MultiScaleGaussianImageFilter.h
e90651264d1485f4ef462baecc969d7ae09aa6c0
[cpPlugins.git] / lib / cpPlugins / Extensions / Algorithms / MultiScaleGaussianImageFilter.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __CPPLUGINS__EXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
6 #define __CPPLUGINS__EXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
7
8 #include <set>
9 #include <itkImageToImageFilter.h>
10
11 namespace cpPlugins
12 {
13   namespace Extensions
14   {
15     namespace Algorithms
16     {
17       /**
18        */
19       template< class I, class O >
20       class MultiScaleGaussianImageFilter
21         : public itk::ImageToImageFilter< I, O >
22       {
23       public:
24         typedef MultiScaleGaussianImageFilter   Self;
25         typedef itk::ImageToImageFilter< I, O > Superclass;
26         typedef itk::SmartPointer< Self >       Pointer;
27         typedef itk::SmartPointer< const Self > ConstPointer;
28
29         typedef I TInputImage;
30         typedef O TOutputImage;
31
32         typedef std::set< double > TScalesContainer;
33
34         enum FilterId
35         {
36           Gradient = 0,
37           GradientMagnitude,
38           Hessian,
39           None
40         };
41
42       protected:
43         /**
44          */
45         class _Greater
46         {
47         public:
48           typedef typename O::PixelType _T;
49
50         public:
51           _Greater( );
52           virtual ~_Greater( );
53           bool operator!=( const _Greater& b ) const;
54           bool operator==( const _Greater& b ) const;
55           inline _T operator()( const _T& a ) const;
56           inline _T operator()( const _T& a, const _T& b ) const;
57         };
58
59       public:
60         itkNewMacro( Self );
61         itkTypeMacro( MultiScaleGaussianImageFilter, itkImageToImageFilter );
62
63       public:
64         void SetFilterToGradient( );
65         void SetFilterToGradientMagnitude( );
66         void SetFilterToHessian( );
67
68         bool IsGradientFilter( ) const;
69         bool IsGradientMagnitudeFilter( ) const;
70         bool IsHessianFilter( ) const;
71
72         void AddScale( const double& s );
73         unsigned long GetNumberOfScales( ) const;
74
75       protected:
76         MultiScaleGaussianImageFilter( );
77         virtual ~MultiScaleGaussianImageFilter( );
78
79         virtual void GenerateData( );
80
81         template< class F >
82         void _GenerateData( );
83
84       private:
85         // Purposely not implemented.
86         MultiScaleGaussianImageFilter( const Self& );
87         void operator=( const Self& );
88
89       protected:
90         TScalesContainer m_Scales;
91         FilterId m_FilterId;
92       };
93
94     } // ecapseman
95
96   } // ecapseman
97
98 } // ecapseman
99
100 #include <cpPlugins/Extensions/Algorithms/MultiScaleGaussianImageFilter.hxx>
101
102 #endif // __CPPLUGINS__EXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
103
104 // eof - $RCSfile$