X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=libs%2Ffpa%2FImage%2FMoriFilter.hxx;fp=libs%2Ffpa%2FImage%2FMoriRegionGrow.hxx;h=9f822c9ea9d22bd6234ddd1a823266b2727c6680;hb=1b83bb346b8416eab760148e7ec92eb8b4a9024c;hp=737bf1f79d15acb515c1d9fb6f94a2f959c80bb3;hpb=49336779a8037ecd49fc0c4f6038c02636eb538b;p=FrontAlgorithms.git diff --git a/libs/fpa/Image/MoriRegionGrow.hxx b/libs/fpa/Image/MoriFilter.hxx similarity index 64% rename from libs/fpa/Image/MoriRegionGrow.hxx rename to libs/fpa/Image/MoriFilter.hxx index 737bf1f..9f822c9 100644 --- a/libs/fpa/Image/MoriRegionGrow.hxx +++ b/libs/fpa/Image/MoriFilter.hxx @@ -1,12 +1,12 @@ -#ifndef __fpa__Image__MoriRegionGrow__hxx__ -#define __fpa__Image__MoriRegionGrow__hxx__ +#ifndef __fpa__Image__MoriFilter__hxx__ +#define __fpa__Image__MoriFilter__hxx__ // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TAuxImage* -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetAuxiliaryImage( ) { return( this->m_Helper->GetOutput( ) ); @@ -15,9 +15,9 @@ GetAuxiliaryImage( ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > const typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TAuxImage* -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetAuxiliaryImage( ) const { return( this->m_Helper->GetOutput( ) ); @@ -26,9 +26,9 @@ GetAuxiliaryImage( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetLower( ) const { return( this->m_Helper->GetLower( ) ); @@ -37,9 +37,9 @@ GetLower( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetUpper( ) const { return( this->m_Helper->GetUpper( ) ); @@ -48,9 +48,9 @@ GetUpper( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TInputPixel -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetStep( ) const { return( this->m_Helper->GetStep( ) ); @@ -59,9 +59,9 @@ GetStep( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TOutputPixel -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetInsideValue( ) const { return( this->m_Threshold->GetInsideValue( ) ); @@ -70,9 +70,9 @@ GetInsideValue( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > typename -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: TOutputPixel -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GetOutsideValue( ) const { return( this->m_Threshold->GetInsideValue( ) ); @@ -80,7 +80,7 @@ GetOutsideValue( ) const // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetLower( const TInputPixel& v ) { this->m_Helper->SetLower( v ); @@ -89,7 +89,7 @@ SetLower( const TInputPixel& v ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetUpper( const TInputPixel& v ) { this->m_Helper->SetUpper( v ); @@ -98,7 +98,7 @@ SetUpper( const TInputPixel& v ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetStep( const TInputPixel& v ) { this->m_Helper->SetStep( v ); @@ -107,7 +107,19 @@ SetStep( const TInputPixel& v ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _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 ); @@ -116,7 +128,7 @@ SetInsideValue( const TOutputPixel& v ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: SetOutsideValue( const TOutputPixel& v ) { this->m_Threshold->SetOutsideValue( v ); @@ -125,8 +137,8 @@ SetOutsideValue( const TOutputPixel& v ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: -MoriRegionGrow( ) +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: +MoriFilter( ) : Superclass( ) { this->m_Helper = THelper::New( ); @@ -135,18 +147,18 @@ MoriRegionGrow( ) // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: -~MoriRegionGrow( ) +fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: +~MoriFilter( ) { } // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage, class _TAuxPixel > -void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >:: +void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >:: GenerateData( ) { this->m_Helper->ClearSeeds( ); - this->m_Helper->AddSeed( this->m_Seed, 0 ); + this->m_Helper->AddSeed( this->m_Seed, this->GetOutsideValue( ) ); this->m_Helper->SetInput( this->GetInput( ) ); this->m_Helper->Update( ); @@ -157,6 +169,6 @@ GenerateData( ) this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) ); } -#endif // __fpa__Image__MoriRegionGrow__hxx__ +#endif // __fpa__Image__MoriFilter__hxx__ // eof - $RCSfile$