1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__Algorithm__h__
7 #define __fpa__Image__Algorithm__h__
10 #include <itkImageToImageFilter.h>
12 #include <fpa/Base/Algorithm.h>
20 template< class _TTraits >
22 : public fpa::Base::Algorithm< _TTraits >
25 typedef _TTraits TTraits;
26 typedef fpa::Base::Algorithm< _TTraits > Superclass;
27 typedef Algorithm Self;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
31 typedef typename TTraits::TFrontId TFrontId;
32 typedef typename TTraits::TInputImage TInputImage;
33 typedef typename TTraits::TInputValue TInputValue;
34 typedef typename TTraits::TNeighborhood TNeighborhood;
35 typedef typename TTraits::TNode TNode;
36 typedef typename TTraits::TNodes TNodes;
37 typedef typename TTraits::TOutputImage TOutputImage;
38 typedef typename TTraits::TOutputValue TOutputValue;
39 typedef typename TTraits::TSeeds TSeeds;
40 typedef typename TTraits::TVertex TVertex;
42 typedef itk::Image< TFrontId, TTraits::Dimension > TMarks;
45 typedef _TMarksInterface TMarksInterface;
46 typedef _TSeedsInterface TSeedsInterface;
48 typedef typename TSeedsInterface::TTraits TTraits;
49 typedef typename TTraits::TInputImage TInputImage;
50 typedef typename TTraits::TOutputImage TOutputImage;
51 typedef typename TTraits::TInputValue TInputValue;
52 typedef typename TTraits::TOutputValue TOutputValue;
53 typedef typename TTraits::TFrontId TFrontId;
54 typedef typename TTraits::TNeighborhood TNeighborhood;
55 typedef typename TTraits::TNode TNode;
56 typedef typename TTraits::TNodes TNodes;
57 typedef typename TTraits::TSeeds TSeeds;
58 typedef typename TTraits::TVertex TVertex;
59 typedef typename TTraits::TPoint TPoint;
61 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > TFilter;
62 typedef fpa::Base::Algorithm< TFilter, TMarksInterface, TSeedsInterface > Superclass;
63 typedef Algorithm Self;
67 itkTypeMacro( fpa::Image::Algorithm, fpa::Base::Algorithm );
69 itkGetConstMacro( NeigborhoodOrder, unsigned int );
70 itkSetMacro( NeigborhoodOrder, unsigned int );
74 const TMarks* GetMarks( ) const;
78 virtual ~Algorithm( );
80 virtual TNodes _UnifySeeds( ) override;
81 virtual void _ConfigureOutput( const TOutputValue& v ) override;
82 virtual TNeighborhood _GetNeighbors( const TVertex& v ) const override;
83 virtual TInputValue _GetInputValue( const TVertex& v ) const override;
84 virtual TOutputValue _GetOutputValue( const TVertex& v ) const override;
85 virtual void _UpdateOutputValue( TNode& n ) override;
86 virtual bool _IsMarked( const TVertex& v ) const override;
87 virtual unsigned long _GetMark( const TVertex& v ) const override;
88 virtual void _Mark( const TVertex& v, unsigned long frontId ) override;
91 // Purposely not implemented.
92 Algorithm( const Self& other );
93 Self& operator=( const Self& other );
96 unsigned long m_MarksIdx;
97 unsigned int m_NeigborhoodOrder;
104 #ifndef ITK_MANUAL_INSTANTIATION
105 # include <fpa/Image/Algorithm.hxx>
106 #endif // ITK_MANUAL_INSTANTIATION
108 #endif // __fpa__Image__Algorithm__h__