#ifndef __fpa__Image__MoriFilter__hxx__ #define __fpa__Image__MoriFilter__hxx__ // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TAuxImage* fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetAuxiliaryImage( ) { return( this->m_Helper->GetOutput( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > const typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TAuxImage* fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetAuxiliaryImage( ) const { return( this->m_Helper->GetOutput( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetLower( ) const { return( this->m_Helper->GetLower( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetUpper( ) const { return( this->m_Helper->GetUpper( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetStep( ) const { return( this->m_Helper->GetStep( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TOutputPixel fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetInsideValue( ) const { return( this->m_Threshold->GetInsideValue( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TOutputPixel fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetOutsideValue( ) const { return( this->m_Threshold->GetInsideValue( ) ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetLower( const TInputPixel& v ) { this->m_Helper->SetLower( v ); this->Modified( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetUpper( const TInputPixel& v ) { this->m_Helper->SetUpper( v ); this->Modified( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetStep( const TInputPixel& v ) { this->m_Helper->SetStep( v ); this->Modified( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetThresholdRange( const TInputPixel& l, const TInputPixel& u, const TInputPixel& s ) { this->SetLower( l ); this->SetUpper( u ); this->SetStep( s ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetInsideValue( const TOutputPixel& v ) { this->m_Threshold->SetInsideValue( v ); this->Modified( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetOutsideValue( const TOutputPixel& v ) { this->m_Threshold->SetOutsideValue( v ); this->Modified( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: MoriFilter( ) : Superclass( ) { this->m_Helper = THelper::New( ); this->m_Threshold = TThreshold::New( ); } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: ~MoriFilter( ) { } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GenerateData( ) { this->m_Helper->ClearSeeds( ); this->m_Helper->AddSeed( this->m_Seed, this->GetOutsideValue( ) ); this->m_Helper->SetInput( this->GetInput( ) ); this->m_Helper->Update( ); this->m_Threshold->SetInput( this->m_Helper->GetOutput( ) ); this->m_Threshold->SetLowerThreshold( std::numeric_limits< _TAuxPixel >::min( ) ); this->m_Threshold->SetUpperThreshold( this->m_Helper->GetOptimumThreshold( ) ); this->m_Threshold->Update( ); this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) ); } #endif // __fpa__Image__MoriFilter__hxx__ // eof - $RCSfile$