X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffpa%2FImage%2FMoriRegionGrow.h;h=182e004ba04e7cdc35ea34417a8dfc087ea338f2;hb=cd6b3f8433deaf2ba7c6bb0ece8e5912c760db17;hp=7a509ec9ac9339fb27f1f44d52aef2cc247a4b52;hpb=29fc5ba2975e744511939c60c53c90a0481207ee;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/MoriRegionGrow.h b/lib/fpa/Image/MoriRegionGrow.h index 7a509ec..182e004 100644 --- a/lib/fpa/Image/MoriRegionGrow.h +++ b/lib/fpa/Image/MoriRegionGrow.h @@ -1,8 +1,15 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + #ifndef __fpa__Image__MoriRegionGrow__h__ #define __fpa__Image__MoriRegionGrow__h__ -#include -#include +#include +#include +#include +#include namespace fpa { @@ -12,82 +19,37 @@ namespace fpa */ template< class _TInputImage, class _TOutputImage > class MoriRegionGrow - : public fpa::Image::RegionGrow< _TInputImage, _TOutputImage > + : public fpa::Base::MoriRegionGrow< fpa::Image::Filter< _TInputImage, _TOutputImage >, fpa::Image::MarksInterface< _TInputImage::ImageDimension >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > > { public: - typedef MoriRegionGrow Self; - typedef fpa::Image::RegionGrow< _TInputImage, _TOutputImage > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef typename Superclass::TOutput TOutput; - typedef typename Superclass::TVertex TVertex; - typedef typename Superclass::TGrowFunction TGrowFunction; - typedef - fpa::Image::Functors::RegionGrow::BinaryThreshold< _TInputImage > - TBinThresholdFunction; - typedef typename _TInputImage::PixelType TPixel; + // Interfaces + typedef fpa::Image::Filter< _TInputImage, _TOutputImage > TFilter; + typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface; + typedef fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > TSeedsInterface; - protected: - typedef typename Superclass::_TQueueNode _TQueueNode; - typedef typename Superclass::_TQueue _TQueue; + // Smart pointers + typedef MoriRegionGrow Self; + typedef fpa::Base::MoriRegionGrow< TFilter, TMarksInterface, TSeedsInterface > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; public: itkNewMacro( Self ); - itkTypeMacro( fpa::Image::MoriRegionGrow, fpa::Image::RegionGrow ); - - itkGetConstMacro( Lower, TPixel ); - itkGetConstMacro( Upper, TPixel ); - itkGetConstMacro( Step, TPixel ); - itkGetConstMacro( Sensitivity, double ); - - itkSetMacro( Lower, TPixel ); - itkSetMacro( Upper, TPixel ); - itkSetMacro( Step, TPixel ); - itkSetMacro( Sensitivity, double ); + itkTypeMacro( fpa::Image::MoriRegionGrow, fpa::Base::MoriRegionGrow ); protected: - MoriRegionGrow( ); - virtual ~MoriRegionGrow( ); - - virtual bool _ContinueGenerateData( ) override; - virtual void _BeforeGenerateData( ) override; - virtual void _AfterGenerateData( ) override; - virtual void _BeforeLoop( ) override; - virtual void _AfterLoop( ) override; - virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override; - virtual void _UpdateResult( const _TQueueNode& n ) override; + MoriRegionGrow( ) : Superclass( ) { } + virtual ~MoriRegionGrow( ) { } private: - // Purposely not defined MoriRegionGrow( const Self& other ); Self& operator=( const Self& other ); - - protected: - TPixel m_Lower; - TPixel m_Upper; - TPixel m_Step; - double m_Sensitivity; - - _TQueue m_NextQueue; - unsigned long m_ActualCount; - unsigned long m_PrevCount; - - // Standard deviation - double m_N; - double m_S1; - double m_S2; - double m_STD; }; } // ecapseman } // ecapseman -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - #endif // __fpa__Image__MoriRegionGrow__h__ // eof - $RCSfile$