]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Filters/Image/Algorithm.h
ce20e7a10934361bd9b5b7c26a4eb944d69dcac8
[FrontAlgorithms.git] / lib / fpa / Filters / Image / Algorithm.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__Image__Algorithm__h__
6 #define __fpa__Filters__Image__Algorithm__h__
7
8 #include <itkImage.h>
9
10 namespace fpa
11 {
12   namespace Filters
13   {
14     namespace Image
15     {
16       /**
17        */
18       template< class _TBaseAlgorithm >
19       class Algorithm
20         : public _TBaseAlgorithm
21       {
22       public:
23         typedef _TBaseAlgorithm TBaseAlgorithm;
24         typedef typename TBaseAlgorithm::TTraits TTraits;
25         fpaTraitsMacro( typename, TTraits );
26
27         typedef TBaseAlgorithm                  Superclass;
28         typedef Algorithm                       Self;
29         typedef itk::SmartPointer< Self >       Pointer;
30         typedef itk::SmartPointer< const Self > ConstPointer;
31
32         typedef typename TTraits::TInputImage  TInputImage;
33         typedef typename TTraits::TOutputImage TOutputImage;
34         typedef itk::Image< TMark, Self::Dimension > TMarksImage;
35
36       public:
37         itkTypeMacro( fpa::Filters::Image::Algorithm, TBaseAlgorithm );
38
39         itkGetConstMacro( NeighborhoodOrder, unsigned int );
40         itkSetMacro( NeighborhoodOrder, unsigned int );
41
42         fpaFilterOutputMacro( Marks, TMarksImage );
43
44       protected:
45         Algorithm( );
46         virtual ~Algorithm( );
47
48         virtual void _ConfigureOutputs( ) override;
49         virtual TInputValue _GetInputValue( const TVertex& v ) const override;
50         virtual TOutputValue _GetOutputValue( const TVertex& v ) const override;
51         virtual TNeighborhood _GetNeighbors( const TVertex& v ) const override;
52         virtual void _UpdateOutputValue( TNode& n ) override;
53         virtual unsigned long _GetMark( const TVertex& v ) const override;
54         virtual bool _IsMarked( const TVertex& v ) const override;
55         virtual void _Mark( const TVertex& v, unsigned long m ) override;
56
57       private:
58         // Purposely not implemented.
59         Algorithm( const Self& other );
60         Self& operator=( const Self& other );
61
62       protected:
63         unsigned int m_MarksIdx;
64         unsigned int m_NeighborhoodOrder;
65       };
66
67     } // ecapseman
68
69   } // ecapseman
70
71 } // ecapseman
72
73 #ifndef ITK_MANUAL_INSTANTIATION
74 #  include <fpa/Filters/Image/Algorithm.hxx>
75 #endif // ITK_MANUAL_INSTANTIATION
76 #endif // __fpa__Filters__Image__Algorithm__h__
77 // eof - $RCSfile$