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>
11 #include <fpa/Base/Algorithm.h>
19 template< class _TTraits, class _TMarks, class _TSeeds >
21 : public fpa::Base::Algorithm< itk::ImageToImageFilter< typename _TTraits::TInputImage, typename _TTraits::TOutputImage >, _TMarks, _TSeeds >
24 typedef _TTraits TTraits;
25 typedef _TMarks TMarksInterface;
26 typedef _TSeeds TSeedsInterface;
27 typedef typename TTraits::TInputImage TInputImage;
28 typedef typename TTraits::TOutputImage TOutputImage;
29 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > TFilter;
31 typedef fpa::Base::Algorithm< TFilter, TMarksInterface, TSeedsInterface > Superclass;
32 typedef Algorithm Self;
33 typedef itk::SmartPointer< Self > Pointer;
34 typedef itk::SmartPointer< const Self > ConstPointer;
36 fpa_Base_TraitTypes( typename TTraits );
39 typedef typename TTraits::TFrontId TFrontId;
40 typedef typename TTraits::TInputImage TInputImage;
41 typedef typename TTraits::TInputValue TInputValue;
42 typedef typename TTraits::TNeighborhood TNeighborhood;
43 typedef typename TTraits::TNode TNode;
44 typedef typename TTraits::TNodes TNodes;
45 typedef typename TTraits::TOutputImage TOutputImage;
46 typedef typename TTraits::TOutputValue TOutputValue;
47 typedef typename TTraits::TSeeds TSeeds;
48 typedef typename TTraits::TVertex TVertex;
51 typedef itk::Image< TFrontId, TTraits::Dimension > TMarks;
54 typedef _TMarksInterface TMarksInterface;
55 typedef _TSeedsInterface TSeedsInterface;
57 typedef typename TSeedsInterface::TTraits TTraits;
58 typedef typename TTraits::TInputImage TInputImage;
59 typedef typename TTraits::TOutputImage TOutputImage;
60 typedef typename TTraits::TInputValue TInputValue;
61 typedef typename TTraits::TOutputValue TOutputValue;
62 typedef typename TTraits::TFrontId TFrontId;
63 typedef typename TTraits::TNeighborhood TNeighborhood;
64 typedef typename TTraits::TNode TNode;
65 typedef typename TTraits::TNodes TNodes;
66 typedef typename TTraits::TSeeds TSeeds;
67 typedef typename TTraits::TVertex TVertex;
68 typedef typename TTraits::TPoint TPoint;
70 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > TFilter;
71 typedef fpa::Base::Algorithm< TFilter, TMarksInterface, TSeedsInterface > Superclass;
72 typedef Algorithm Self;
78 ( itk::Concept::SameType< typename _TMarks::TTraits, TTraits > )
82 itkTypeMacro( fpa::Image::Algorithm, fpa::Base::Algorithm );
84 itkGetConstMacro( NeigborhoodOrder, unsigned int );
85 itkSetMacro( NeigborhoodOrder, unsigned int );
89 const TMarks* GetMarks( ) const;
93 virtual ~Algorithm( );
95 virtual TNodes _UnifySeeds( ) override;
96 virtual void _ConfigureOutput( const TOutputValue& v ) override;
97 virtual TNeighborhood _GetNeighbors( const TVertex& v ) const override;
98 virtual TInputValue _GetInputValue( const TVertex& v ) const override;
99 virtual TOutputValue _GetOutputValue( const TVertex& v ) const override;
100 virtual void _UpdateOutputValue( TNode& n ) override;
101 virtual bool _IsMarked( const TVertex& v ) const override;
102 virtual unsigned long _GetMark( const TVertex& v ) const override;
103 virtual void _Mark( const TVertex& v, unsigned long frontId ) override;
106 // Purposely not implemented.
107 Algorithm( const Self& other );
108 Self& operator=( const Self& other );
111 unsigned long m_MarksIdx;
112 unsigned int m_NeigborhoodOrder;
119 #ifndef ITK_MANUAL_INSTANTIATION
120 # include <fpa/Image/Algorithm.hxx>
121 #endif // ITK_MANUAL_INSTANTIATION
123 #endif // __fpa__Image__Algorithm__h__