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 >
84 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
86 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
87 GetOptimumThreshold( ) const
89 return( this->m_Helper->GetOptimumThreshold( ) );
92 // -------------------------------------------------------------------------
93 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
95 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
96 TCurve fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
99 return( this->m_Helper->GetCurve( ) );
102 // -------------------------------------------------------------------------
103 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
104 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
105 SetLower( const TInputPixel& v )
107 this->m_Helper->SetLower( v );
111 // -------------------------------------------------------------------------
112 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
113 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
114 SetUpper( const TInputPixel& v )
116 this->m_Helper->SetUpper( v );
120 // -------------------------------------------------------------------------
121 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
122 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
123 SetStep( const TInputPixel& v )
125 this->m_Helper->SetStep( v );
129 // -------------------------------------------------------------------------
130 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
131 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
133 const TInputPixel& l, const TInputPixel& u, const TInputPixel& s
141 // -------------------------------------------------------------------------
142 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
143 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
144 SetInsideValue( const TOutputPixel& v )
146 this->m_Threshold->SetInsideValue( v );
150 // -------------------------------------------------------------------------
151 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
152 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
153 SetOutsideValue( const TOutputPixel& v )
155 this->m_Threshold->SetOutsideValue( v );
159 // -------------------------------------------------------------------------
160 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
161 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
165 this->m_Helper = THelper::New( );
166 this->m_Threshold = TThreshold::New( );
169 // -------------------------------------------------------------------------
170 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
171 fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
176 // -------------------------------------------------------------------------
177 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
178 void fpa::Image::MoriFilter< _TInputImage, _TOutputImage, _TAuxPixel >::
181 this->m_Helper->SetSeed( this->m_Seed );
182 this->m_Helper->SetInput( this->GetInput( ) );
183 this->m_Helper->Update( );
185 this->m_Threshold->SetInput( this->m_Helper->GetOutput( ) );
186 this->m_Threshold->SetLowerThreshold( std::numeric_limits< _TAuxPixel >::min( ) );
187 this->m_Threshold->SetUpperThreshold( this->m_Helper->GetOptimumThreshold( ) );
188 this->m_Threshold->Update( );
189 this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) );
192 #endif // __fpa__Image__MoriFilter__hxx__