]> 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
11 namespace fpa
12 {
13   namespace Base
14   {
15     /**
16      */
17     template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
18     class Algorithm
19       : public _TFilter,
20         public _TMarksInterface,
21         public _TSeedsInterface
22     {
23     public:
24       typedef Algorithm                       Self;
25       typedef _TFilter                        Superclass;
26       typedef _TMarksInterface                TMarksInterface;
27       typedef _TSeedsInterface                TSeedsInterface;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30
31       typedef typename _TMarksInterface::TNode        TNode;
32       typedef typename _TMarksInterface::TOutputValue TOutputValue;
33       typedef typename _TSeedsInterface::TSeeds       TSeeds;
34
35       typedef std::vector< TNode > TNeighborhood;
36
37     public:
38       itkTypeMacro( Algorithm, TFilter );
39
40       itkGetConstMacro( InitValue, TOutputValue );
41       itkSetMacro( InitValue, TOutputValue );
42
43     protected:
44       Algorithm( );
45       virtual ~Algorithm( );
46
47       virtual void GenerateData( ) override;
48
49       virtual void _ConfigureOutput( const TOutputValue& v ) = 0;
50       virtual void _QueueInit( ) = 0;
51       virtual void _QueuePush( const TNode& node ) = 0;
52       virtual unsigned long _QueueSize( ) const = 0;
53       virtual TNode _QueuePop( ) = 0;
54
55     private:
56       // Purposely not implemented
57       Algorithm( const Self& other );
58       Self& operator=( const Self& other );
59
60     protected:
61       TOutputValue m_InitValue;
62     };
63
64   } // ecapseman
65
66 } // ecapseman
67
68 #ifndef ITK_MANUAL_INSTANTIATION
69 #  include <fpa/Base/Algorithm.hxx>
70 #endif // ITK_MANUAL_INSTANTIATION
71
72 #endif // __fpa__Base__Algorithm__h__
73
74 // eof - $RCSfile$