1 #ifndef __fpa__Image__MoriRegionGrow__hxx__
2 #define __fpa__Image__MoriRegionGrow__hxx__
4 // -------------------------------------------------------------------------
5 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
7 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
9 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
12 return( this->m_Helper->GetOutput( ) );
15 // -------------------------------------------------------------------------
16 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
18 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
20 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
21 GetAuxiliaryImage( ) const
23 return( this->m_Helper->GetOutput( ) );
26 // -------------------------------------------------------------------------
27 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
29 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
31 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
34 return( this->m_Helper->GetLower( ) );
37 // -------------------------------------------------------------------------
38 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
40 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
42 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
45 return( this->m_Helper->GetUpper( ) );
48 // -------------------------------------------------------------------------
49 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
51 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
53 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
56 return( this->m_Helper->GetStep( ) );
59 // -------------------------------------------------------------------------
60 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
62 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
64 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
65 GetInsideValue( ) const
67 return( this->m_Threshold->GetInsideValue( ) );
70 // -------------------------------------------------------------------------
71 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
73 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
75 fpa::Image::MoriRegionGrow< _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::MoriRegionGrow< _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::MoriRegionGrow< _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::MoriRegionGrow< _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::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
111 SetInsideValue( const TOutputPixel& v )
113 this->m_Threshold->SetInsideValue( v );
117 // -------------------------------------------------------------------------
118 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
119 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
120 SetOutsideValue( const TOutputPixel& v )
122 this->m_Threshold->SetOutsideValue( v );
126 // -------------------------------------------------------------------------
127 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
128 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
132 this->m_Helper = THelper::New( );
133 this->m_Threshold = TThreshold::New( );
136 // -------------------------------------------------------------------------
137 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
138 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
143 // -------------------------------------------------------------------------
144 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
145 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
148 this->m_Helper->ClearSeeds( );
149 this->m_Helper->AddSeed( this->m_Seed, 0 );
150 this->m_Helper->SetInput( this->GetInput( ) );
151 this->m_Helper->Update( );
153 this->m_Threshold->SetInput( this->m_Helper->GetOutput( ) );
154 this->m_Threshold->SetLowerThreshold( std::numeric_limits< _TAuxPixel >::min( ) );
155 this->m_Threshold->SetUpperThreshold( this->m_Helper->GetOptimumThreshold( ) );
156 this->m_Threshold->Update( );
157 this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) );
160 #endif // __fpa__Image__MoriRegionGrow__hxx__