X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrowWithMultipleThresholds.h;h=3bcc7db7abe21be0dd71ff75f491b0cf396c47da;hb=79df4abfecefc36c0dfca7d9f6f2978882de95dc;hp=41fba37baae72af994d8b7881600a8e30f0f504c;hpb=2479b55370fe1bec58d94faa3cc268bac419f6d6;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrowWithMultipleThresholds.h b/lib/fpa/Image/RegionGrowWithMultipleThresholds.h index 41fba37..3bcc7db 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 namespace fpa { @@ -28,6 +30,9 @@ namespace fpa 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; @@ -35,8 +40,13 @@ namespace fpa itkNewMacro( Self ); itkTypeMacro( RegionGrowWithMultipleThresholds, RegionGrow ); - itkGetConstMacro( DerivativeThreshold, double ); - itkSetMacro( DerivativeThreshold, double ); + itkGetConstMacro( InsideValue, TPixel ); + itkGetConstMacro( OutsideValue, TPixel ); + itkGetConstMacro( DifferenceThreshold, double ); + + itkSetMacro( InsideValue, TPixel ); + itkSetMacro( OutsideValue, TPixel ); + itkSetMacro( DifferenceThreshold, double ); public: void AddThreshold( const TPixel& v ); @@ -50,17 +60,27 @@ namespace fpa RegionGrowWithMultipleThresholds( ); virtual ~RegionGrowWithMultipleThresholds( ); - virtual bool _UpdateResult( _TNode& n ); - virtual void _BeforeLoop( ); + virtual void _BeforeMainLoop( ); + virtual void _AfterMainLoop( ); virtual void _AfterLoop( ); + virtual bool _UpdateResult( _TNode& n ); + virtual void _Mark( const _TNode& n ); + virtual bool _CheckStopCondition( ); private: RegionGrowWithMultipleThresholds( const Self& ); // Not impl. void operator=( const Self& ); // Not impl. protected: - double m_DerivativeThreshold; + TThresholds m_Thresholds; + TPixel m_InsideValue; + TPixel m_OutsideValue; + double m_DifferenceThreshold; THistogram m_Histogram; + unsigned long m_TotalCount; + double m_LastDiff; + bool m_StopForced; + TPixel m_StopThreshold; }; } // ecapseman