X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FFilters%2FImage%2FAlgorithm.h;fp=lib%2Ffpa%2FFilters%2FImage%2FAlgorithm.h;h=ce20e7a10934361bd9b5b7c26a4eb944d69dcac8;hb=2047276c8f1a02432fbcc7014722d460d6c1e60f;hp=0000000000000000000000000000000000000000;hpb=3c639e5da479c7216a0a302ffa156ac6762caeed;p=FrontAlgorithms.git diff --git a/lib/fpa/Filters/Image/Algorithm.h b/lib/fpa/Filters/Image/Algorithm.h new file mode 100644 index 0000000..ce20e7a --- /dev/null +++ b/lib/fpa/Filters/Image/Algorithm.h @@ -0,0 +1,77 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= +#ifndef __fpa__Filters__Image__Algorithm__h__ +#define __fpa__Filters__Image__Algorithm__h__ + +#include + +namespace fpa +{ + namespace Filters + { + namespace Image + { + /** + */ + template< class _TBaseAlgorithm > + class Algorithm + : public _TBaseAlgorithm + { + public: + typedef _TBaseAlgorithm TBaseAlgorithm; + typedef typename TBaseAlgorithm::TTraits TTraits; + fpaTraitsMacro( typename, TTraits ); + + typedef TBaseAlgorithm Superclass; + typedef Algorithm Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename TTraits::TInputImage TInputImage; + typedef typename TTraits::TOutputImage TOutputImage; + typedef itk::Image< TMark, Self::Dimension > TMarksImage; + + public: + itkTypeMacro( fpa::Filters::Image::Algorithm, TBaseAlgorithm ); + + itkGetConstMacro( NeighborhoodOrder, unsigned int ); + itkSetMacro( NeighborhoodOrder, unsigned int ); + + fpaFilterOutputMacro( Marks, TMarksImage ); + + protected: + Algorithm( ); + virtual ~Algorithm( ); + + virtual void _ConfigureOutputs( ) override; + virtual TInputValue _GetInputValue( const TVertex& v ) const override; + virtual TOutputValue _GetOutputValue( const TVertex& v ) const override; + virtual TNeighborhood _GetNeighbors( const TVertex& v ) const override; + virtual void _UpdateOutputValue( TNode& n ) override; + virtual unsigned long _GetMark( const TVertex& v ) const override; + virtual bool _IsMarked( const TVertex& v ) const override; + virtual void _Mark( const TVertex& v, unsigned long m ) override; + + private: + // Purposely not implemented. + Algorithm( const Self& other ); + Self& operator=( const Self& other ); + + protected: + unsigned int m_MarksIdx; + unsigned int m_NeighborhoodOrder; + }; + + } // ecapseman + + } // ecapseman + +} // ecapseman + +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION +#endif // __fpa__Filters__Image__Algorithm__h__ +// eof - $RCSfile$