1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Algorithm__h__
7 #define __fpa__Base__Algorithm__h__
9 #include <fpa/Config.h>
10 #include <itkConceptChecking.h>
11 #include <itkObject.h>
19 template< class _TFilter, class _TMarks, class _TSeeds >
21 : public _TFilter, public _TMarks, public _TSeeds
24 typedef _TMarks TMarksInterface;
25 typedef _TSeeds TSeedsInterface;
26 typedef _TFilter Superclass;
27 typedef Algorithm Self;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
31 typedef typename _TMarks::TTraits TTraits;
32 fpa_Base_TraitTypes( typename TTraits );
36 Marks_and_Seeds_SameTraits,
37 ( itk::Concept::SameType< typename _TSeeds::TTraits, TTraits > )
41 itkTypeMacro( fpa::Base::Algorithm, _TFilter );
43 itkBooleanMacro( VisualDebug );
44 itkGetConstMacro( VisualDebug, bool );
45 itkSetMacro( VisualDebug, bool );
47 itkGetConstMacro( InitValue, TOutputValue );
48 itkSetMacro( InitValue, TOutputValue );
51 virtual void InvokeEvent( const itk::EventObject& e );
52 virtual void InvokeEvent( const itk::EventObject& e ) const;
56 virtual ~Algorithm( );
58 virtual void GenerateData( ) override;
59 virtual void _BeforeGenerateData( );
60 virtual void _AfterGenerateData( );
61 virtual void _FinishOneLoop( );
63 virtual void _QueueInit( );
65 virtual void _ConfigureOutput( const TOutputValue& v ) = 0;
66 virtual TNeighborhood _GetNeighbors( const TVertex& v ) const = 0;
67 virtual TInputValue _GetInputValue( const TVertex& v ) const = 0;
68 virtual TOutputValue _GetOutputValue( const TVertex& v ) const = 0;
70 virtual void _ComputeOutputValue( TNode& n ) = 0;
71 virtual void _UpdateOutputValue( TNode& n ) = 0;
72 virtual void _QueueClear( ) = 0;
73 virtual void _QueuePush( const TNode& node ) = 0;
74 virtual unsigned long _QueueSize( ) const = 0;
75 virtual TNode _QueuePop( ) = 0;
78 // Purposely not implemented
79 Algorithm( const Self& other );
80 Self& operator=( const Self& other );
84 TOutputValue m_InitValue;
91 #ifndef ITK_MANUAL_INSTANTIATION
92 # include <fpa/Base/Algorithm.hxx>
93 #endif // ITK_MANUAL_INSTANTIATION
95 #endif // __fpa__Base__Algorithm__h__