X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FFunctors%2FRegionGrowThresholdFunction.h;h=4ec4bbfb520ccacaa9cc83a38fee270173125e98;hb=ee47805904ac406cd2433cd9a9a9eeec68d1fc6e;hp=3d7d5ac8b167ff413ead2f2ac13d18b6057d1e4c;hpb=015105c2f44abb80923a59adfb1a01713506744f;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h b/lib/fpa/Image/Functors/RegionGrowThresholdFunction.h index 3d7d5ac..4ec4bbf 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 @@ -42,9 +42,10 @@ namespace fpa itkSetMacro( UpperThreshold, TPixel ); public: - virtual bool Evaluate( const TIndex& idx ) const + virtual bool Evaluate( const TIndex& idx ) const ITK_OVERRIDE { const I* img = this->GetSpace( ); + if( img != NULL ) { TPixel v = img->GetPixel( idx ); @@ -58,10 +59,11 @@ namespace fpa 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( ) { }