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 _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
22 : public fpa::Base::Algorithm< itk::ImageToImageFilter< _TInputImage, _TOutputImage >, _TMarksInterface, _TSeedsInterface >
25 typedef _TInputImage TInputImage;
26 typedef _TOutputImage TOutputImage;
27 typedef _TMarksInterface TMarksInterface;
28 typedef _TSeedsInterface TSeedsInterface;
29 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > TFilter;
31 typedef Algorithm Self;
32 typedef fpa::Base::Algorithm< TFilter, TMarksInterface, TSeedsInterface > Superclass;
33 typedef itk::SmartPointer< Self > Pointer;
34 typedef itk::SmartPointer< const Self > ConstPointer;
36 typedef typename TInputImage::PixelType TInputValue;
37 typedef typename TOutputImage::PixelType TOutputValue;
38 typedef typename Superclass::TFrontId TFrontId;
39 typedef typename Superclass::TNeighborhood TNeighborhood;
40 typedef typename Superclass::TNode TNode;
41 typedef typename Superclass::TVertex TVertex;
43 typedef itk::Image< TFrontId, TInputImage::ImageDimension > TMarks;
46 itkTypeMacro( fpa::Image::Algorithm, fpa::Base::Algorithm );
48 itkGetConstMacro( NeigborhoodOrder, unsigned int );
49 itkSetMacro( NeigborhoodOrder, unsigned int );
53 const TMarks* GetMarks( ) const;
57 virtual ~Algorithm( );
59 virtual void _ConfigureOutput( const TOutputValue& v ) override;
60 virtual TNeighborhood _GetNeighbors( const TVertex& v ) const override;
61 virtual TInputValue _GetInputValue( const TVertex& v ) const override;
62 virtual TOutputValue _GetOutputValue( const TVertex& v ) const override;
63 virtual void _UpdateOutputValue( const TNode& n ) override;
64 virtual bool _IsMarked( const TVertex& v ) const override;
65 virtual unsigned long _GetMark( const TVertex& v ) const override;
66 virtual bool _Mark( const TVertex& v, unsigned long frontId ) override;
69 // Purposely not implemented.
70 Algorithm( const Self& other );
71 Self& operator=( const Self& other );
74 unsigned long m_MarksIdx;
75 unsigned int m_NeigborhoodOrder;
82 #ifndef ITK_MANUAL_INSTANTIATION
83 # include <fpa/Image/Algorithm.hxx>
84 #endif // ITK_MANUAL_INSTANTIATION
86 #endif // __fpa__Image__Algorithm__h__