X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FFunctors%2FRegionGrowThresholdFunction.h;h=55a5d53b7fc63b53f88b59a8442b5b38e109607e;hb=8fafb83c41ab35dfc25eb637170882a612924433;hp=6da586d2249271f1017dcf78399993d2846d7bb9;hpb=972dd44060dfff40ba3daab899c6365445f6de7e;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h b/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h index 6da586d..55a5d53 100644 --- a/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h +++ b/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h @@ -1,7 +1,7 @@ #ifndef __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__ #define __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__ -#include +#include #include namespace fpa @@ -24,10 +24,9 @@ namespace fpa typedef itk::SmartPointer< const Self > ConstPointer; // Superclass' types - typedef typename Superclass::TInputImage TInputImage; - typedef typename Superclass::TOutputValue TOutputValue; - typedef typename Superclass::TIndex TIndex; - typedef typename I::PixelType TPixel; + typedef I TInputImage; + typedef typename I::IndexType TIndex; + typedef typename I::PixelType TPixel; public: itkNewMacro( Self ); @@ -43,36 +42,28 @@ namespace fpa itkSetMacro( UpperThreshold, TPixel ); public: - virtual TOutputValue Evaluate( const TIndex& idx ) const + virtual bool Evaluate( const TIndex& idx ) const { - const I* img = this->GetInputImage( ); + const I* img = this->GetSpace( ); + if( img != NULL ) { - /* TODO - if( this->IsInsideBuffer( idx ) ) - { - */ TPixel v = img->GetPixel( idx ); - std::cout - << v << " " - << this->m_LowerThreshold << " " - << this->m_UpperThreshold << std::endl; return( - this->m_LowerThreshold <= v && v < this->m_UpperThreshold + !( v < this->m_LowerThreshold || this->m_UpperThreshold < v ) ); - // TODO: } // fi - } // fi return( false ); } protected: RegionGrowThresholdFunction( ) - : Superclass( ), - m_LowerThreshold( std::numeric_limits< TPixel >::min( ) ), - m_UpperThreshold( std::numeric_limits< TPixel >::max( ) ) - { } + : Superclass( ) + { + itk::NumericTraits< TPixel >::min( this->m_LowerThreshold ); + itk::NumericTraits< TPixel >::max( this->m_UpperThreshold ); + } virtual ~RegionGrowThresholdFunction( ) { }