]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/Functors/GaussianCost.h
d5c860c367f793c68de6ea806346210604adca33
[FrontAlgorithms.git] / lib / fpa / Base / Functors / GaussianCost.h
1 #ifndef __FPA__BASE__FUNCTORS__GAUSSIANCOST__H__
2 #define __FPA__BASE__FUNCTORS__GAUSSIANCOST__H__
3
4 #include <fpa/Config.h>
5 #include <itkFunctionBase.h>
6 #include <cpExtensions/Algorithms/IterativeGaussianModelEstimator.h>
7
8 namespace fpa
9 {
10   namespace Base
11   {
12     namespace Functors
13     {
14       /**
15        */
16       template< class _TResult >
17       class GaussianCost
18         : public itk::FunctionBase< _TResult, _TResult >
19       {
20       public:
21         typedef GaussianCost                            Self;
22         typedef itk::FunctionBase< _TResult, _TResult > Superclass;
23         typedef itk::SmartPointer< Self >               Pointer;
24         typedef itk::SmartPointer< const Self >         ConstPointer;
25
26         // Template arguments
27         typedef _TResult TResult;
28         typedef
29         cpExtensions::Algorithms::IterativeGaussianModelEstimator< TResult, 1 >
30         TModel;
31
32       public:
33         itkNewMacro( Self );
34         itkTypeMacro( GaussianCost, Algorithm );
35
36         itkGetConstMacro( SupportSize, unsigned int );
37         itkGetConstMacro( MinimumCost, _TResult );
38         itkGetObjectMacro( Model, TModel );
39         itkGetConstObjectMacro( Model, TModel );
40         itkSetMacro( SupportSize, unsigned int );
41         itkSetMacro( MinimumCost, _TResult );
42
43       public:
44         virtual _TResult Evaluate( const _TResult& x ) const fpa_OVERRIDE;
45
46       protected:
47         // Methods to extend itk-based architecture
48         GaussianCost( );
49         virtual ~GaussianCost( );
50
51       private:
52         // Purposely not implemented
53         GaussianCost( const Self& other );
54         Self& operator=( const Self& other );
55
56       protected:
57         unsigned int m_SupportSize;
58         _TResult m_MinimumCost;
59         typename TModel::Pointer m_Model;
60       };
61
62     } // ecapseman
63
64   } // ecapseman
65
66 } // ecapseman
67
68 #ifndef ITK_MANUAL_INSTANTIATION
69 #  include <fpa/Base/Functors/GaussianCost.hxx>
70 #endif // ITK_MANUAL_INSTANTIATION
71
72 #endif // __FPA__BASE__FUNCTORS__GAUSSIANCOST__H__
73
74 // eof - $RCSfile$