X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrowWithMultipleThresholds.h;h=b4c3e4e536480c084c1ba040fa3120c3918e99fc;hb=972dd44060dfff40ba3daab899c6365445f6de7e;hp=11066fe6027eab286e91848eaa7476cb5aa4deb6;hpb=9622bd5b833a8845881003228207e0caca59b081;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrowWithMultipleThresholds.h b/lib/fpa/Image/RegionGrowWithMultipleThresholds.h index 11066fe..b4c3e4e 100644 --- a/lib/fpa/Image/RegionGrowWithMultipleThresholds.h +++ b/lib/fpa/Image/RegionGrowWithMultipleThresholds.h @@ -2,7 +2,9 @@ #define __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__ #include -#include +#include +#include +#include namespace fpa { @@ -13,18 +15,23 @@ namespace fpa */ template< class I > class RegionGrowWithMultipleThresholds - : public RegionGrow< I > + : public RegionGrowWithMultipleCriteria< I > { public: - typedef RegionGrowWithMultipleThresholds Self; - typedef RegionGrow< I > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + typedef RegionGrowWithMultipleThresholds Self; + typedef RegionGrowWithMultipleCriteria< I > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; typedef typename I::PixelType TPixel; - typedef std::map< TPixel, unsigned long > THistogram; - typedef typename Superclass::TBaseAlgorithm TBaseAlgorithm; + typedef std::map< TPixel, unsigned long > THistogram; + typedef typename Superclass::TBaseAlgorithm TBaseAlgorithm; + typedef typename Superclass::TMembershipFunction TMembershipFunction; + typedef typename Superclass::TFunctions TFunctions; + + typedef std::set< TPixel > TThresholds; + typedef fpa::Image::Functors::RegionGrowThresholdFunction< I > TFunction; protected: typedef typename TBaseAlgorithm::_TNode _TNode; @@ -39,8 +46,9 @@ namespace fpa public: void AddThreshold( const TPixel& v ); void AddThresholds( - const TPixel& t0, const TPixel& t1, - const unsigned int& samples + const TPixel& t0, + const TPixel& t1, + const unsigned int& s ); protected: @@ -48,6 +56,7 @@ namespace fpa virtual ~RegionGrowWithMultipleThresholds( ); virtual bool _UpdateResult( _TNode& n ); + virtual void _BeforeLoop( ); virtual void _AfterLoop( ); private: @@ -55,6 +64,7 @@ namespace fpa void operator=( const Self& ); // Not impl. protected: + TThresholds m_Thresholds; double m_DerivativeThreshold; THistogram m_Histogram; };