]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/Algorithm.h
...
[FrontAlgorithms.git] / lib / fpa / Base / Algorithm.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__Algorithm__h__
7 #define __fpa__Base__Algorithm__h__
8
9 #include <vector>
10 #include <itkObject.h>
11 /* TODO
12    #include <itkMacro.h>
13    #include <itkSmartPointer.h>
14 */
15 namespace fpa
16 {
17   namespace Base
18   {
19     /**
20      */
21     template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
22     class Algorithm
23       : public _TFilter,
24         public _TMarksInterface,
25         public _TSeedsInterface
26     {
27     public:
28       typedef Algorithm                       Self;
29       typedef _TFilter                        Superclass;
30       typedef _TMarksInterface                TMarksInterface;
31       typedef _TSeedsInterface                TSeedsInterface;
32       typedef itk::SmartPointer< Self >       Pointer;
33       typedef itk::SmartPointer< const Self > ConstPointer;
34
35       typedef typename _TMarksInterface::TOutputValue TOutputValue;
36       typedef typename _TSeedsInterface::TNode        TNode;
37       typedef typename _TSeedsInterface::TSeeds       TSeeds;
38
39       typedef std::vector< TNode > TNeighborhood;
40
41     public:
42       itkTypeMacro( fpa::Base::Algorithm, _TFilter );
43       
44       itkGetConstMacro( InitValue, TOutputValue );
45       itkSetMacro( InitValue, TOutputValue );
46
47     protected:
48       Algorithm( );
49       virtual ~Algorithm( );
50
51       virtual void GenerateData( ) override;
52
53       virtual void _ConfigureOutput( const TOutputValue& v ) = 0;
54       virtual void _QueueInit( ) = 0;
55       virtual void _QueuePush( const TNode& node ) = 0;
56       virtual unsigned long _QueueSize( ) const = 0;
57       virtual TNode _QueuePop( ) = 0;
58
59     private:
60       // Purposely not implemented
61       Algorithm( const Self& other );
62       Self& operator=( const Self& other );
63
64     protected:
65       TOutputValue m_InitValue;
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #ifndef ITK_MANUAL_INSTANTIATION
73 #  include <fpa/Base/Algorithm.hxx>
74 #endif // ITK_MANUAL_INSTANTIATION
75
76 #endif // __fpa__Base__Algorithm__h__
77
78 // eof - $RCSfile$