#ifndef __fpa__Image__MoriFilterHelper__h__ #define __fpa__Image__MoriFilterHelper__h__ #include #include #include #include namespace fpa { namespace Image { /** */ template< class _TInputImage, class _TOutputImage > class MoriFilterHelper : public fpa::Image::RegionGrow< _TInputImage, _TOutputImage > { public: typedef MoriFilterHelper 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 typename _TInputImage::PixelType TPixel; typedef fpa::Image::Functors::RegionGrow::BinaryThreshold< _TInputImage, TOutput > TBinThresholdFunction; protected: typedef typename Superclass::_TQueueNode _TQueueNode; typedef typename Superclass::_TQueue _TQueue; typedef std::pair< TPixel, unsigned long > TCurveData; typedef std::vector< TCurveData > TCurve; public: itkNewMacro( Self ); itkTypeMacro( fpa::Image::MoriFilterHelper, fpa::Image::RegionGrow ); itkGetConstMacro( Lower, TPixel ); itkGetConstMacro( Upper, TPixel ); itkGetConstMacro( Step, TPixel ); itkGetConstMacro( OptimumThreshold, typename _TOutputImage::PixelType ); itkSetMacro( Lower, TPixel ); itkSetMacro( Upper, TPixel ); itkSetMacro( Step, TPixel ); protected: MoriFilterHelper( ); virtual ~MoriFilterHelper( ); 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; private: // Purposely not defined MoriFilterHelper( const Self& other ); Self& operator=( const Self& other ); protected: TPixel m_Lower; TPixel m_Upper; TPixel m_Step; typename _TOutputImage::PixelType m_OptimumThreshold; _TQueue m_NextQueue; unsigned long m_ActualCount; TCurve m_Curve; }; } // ecapseman } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __fpa__Image__MoriFilterHelper__h__ // eof - $RCSfile$