1 #ifndef __fpa__Image__MoriFilter__hxx__
2 #define __fpa__Image__MoriFilter__hxx__
4 // -------------------------------------------------------------------------
5 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
7 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
9 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
12 return( this->m_Helper->GetOutput( ) );
15 // -------------------------------------------------------------------------
16 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
18 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
20 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
21 GetAuxiliaryImage( ) const
23 return( this->m_Helper->GetOutput( ) );
26 // -------------------------------------------------------------------------
27 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
29 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
31 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
34 return( this->m_Helper->GetLower( ) );
37 // -------------------------------------------------------------------------
38 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
40 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
42 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
45 return( this->m_Helper->GetUpper( ) );
48 // -------------------------------------------------------------------------
49 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
51 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
53 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
56 return( this->m_Helper->GetStep( ) );
59 // -------------------------------------------------------------------------
60 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
62 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
64 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
65 GetInsideValue( ) const
67 return( this->m_Threshold->GetInsideValue( ) );
70 // -------------------------------------------------------------------------
71 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
73 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
75 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
76 GetOutsideValue( ) const
78 return( this->m_Threshold->GetInsideValue( ) );
81 // -------------------------------------------------------------------------
82 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
83 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
84 SetLower( const TInputPixel& v )
86 this->m_Helper->SetLower( v );
90 // -------------------------------------------------------------------------
91 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
92 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
93 SetUpper( const TInputPixel& v )
95 this->m_Helper->SetUpper( v );
99 // -------------------------------------------------------------------------
100 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
101 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
102 SetStep( const TInputPixel& v )
104 this->m_Helper->SetStep( v );
108 // -------------------------------------------------------------------------
109 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
110 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
112 const TInputPixel& l, const TInputPixel& u, const TInputPixel& s
120 // -------------------------------------------------------------------------
121 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
122 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
123 SetInsideValue( const TOutputPixel& v )
125 this->m_Threshold->SetInsideValue( v );
129 // -------------------------------------------------------------------------
130 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
131 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
132 SetOutsideValue( const TOutputPixel& v )
134 this->m_Threshold->SetOutsideValue( v );
138 // -------------------------------------------------------------------------
139 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
140 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
144 this->m_Helper = THelper::New( );
145 this->m_Threshold = TThreshold::New( );
148 // -------------------------------------------------------------------------
149 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
150 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
155 // -------------------------------------------------------------------------
156 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
157 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
160 this->m_Helper->ClearSeeds( );
161 this->m_Helper->AddSeed( this->m_Seed, this->GetOutsideValue( ) );
162 this->m_Helper->SetInput( this->GetInput( ) );
163 this->m_Helper->Update( );
165 this->m_Threshold->SetInput( this->m_Helper->GetOutput( ) );
166 this->m_Threshold->SetLowerThreshold( std::numeric_limits< _TAuxPixel >::min( ) );
167 this->m_Threshold->SetUpperThreshold( this->m_Helper->GetOptimumThreshold( ) );
168 this->m_Threshold->Update( );
169 this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) );
172 #endif // __fpa__Image__MoriFilter__hxx__