]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MoriRegionGrow.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / MoriRegionGrow.hxx
1 #ifndef __fpa__Image__MoriRegionGrow__hxx__
2 #define __fpa__Image__MoriRegionGrow__hxx__
3
4 // -------------------------------------------------------------------------
5 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
6 typename
7 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
8 TAuxImage*
9 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
10 GetAuxiliaryImage( )
11 {
12   return( this->m_Helper->GetOutput( ) );
13 }
14
15 // -------------------------------------------------------------------------
16 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
17 const typename
18 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
19 TAuxImage*
20 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
21 GetAuxiliaryImage( ) const
22 {
23   return( this->m_Helper->GetOutput( ) );
24 }
25
26 // -------------------------------------------------------------------------
27 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
28 typename
29 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
30 TInputPixel
31 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
32 GetLower( ) const
33 {
34   return( this->m_Helper->GetLower( ) );
35 }
36
37 // -------------------------------------------------------------------------
38 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
39 typename
40 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
41 TInputPixel
42 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
43 GetUpper( ) const
44 {
45   return( this->m_Helper->GetUpper( ) );
46 }
47
48 // -------------------------------------------------------------------------
49 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
50 typename
51 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
52 TInputPixel
53 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
54 GetStep( ) const
55 {
56   return( this->m_Helper->GetStep( ) );
57 }
58
59 // -------------------------------------------------------------------------
60 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
61 typename
62 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
63 TOutputPixel
64 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
65 GetInsideValue( ) const
66 {
67   return( this->m_Threshold->GetInsideValue( ) );
68 }
69
70 // -------------------------------------------------------------------------
71 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
72 typename
73 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
74 TOutputPixel
75 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
76 GetOutsideValue( ) const
77 {
78   return( this->m_Threshold->GetInsideValue( ) );
79 }
80
81 // -------------------------------------------------------------------------
82 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
83 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
84 SetLower( const TInputPixel& v )
85 {
86   this->m_Helper->SetLower( v );
87   this->Modified( );
88 }
89
90 // -------------------------------------------------------------------------
91 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
92 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
93 SetUpper( const TInputPixel& v )
94 {
95   this->m_Helper->SetUpper( v );
96   this->Modified( );
97 }
98
99 // -------------------------------------------------------------------------
100 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
101 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
102 SetStep( const TInputPixel& v )
103 {
104   this->m_Helper->SetStep( v );
105   this->Modified( );
106 }
107
108 // -------------------------------------------------------------------------
109 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
110 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
111 SetInsideValue( const TOutputPixel& v )
112 {
113   this->m_Threshold->SetInsideValue( v );
114   this->Modified( );
115 }
116
117 // -------------------------------------------------------------------------
118 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
119 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
120 SetOutsideValue( const TOutputPixel& v )
121 {
122   this->m_Threshold->SetOutsideValue( v );
123   this->Modified( );
124 }
125
126 // -------------------------------------------------------------------------
127 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
128 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
129 MoriRegionGrow( )
130   : Superclass( )
131 {
132   this->m_Helper = THelper::New( );
133   this->m_Threshold = TThreshold::New( );
134 }
135
136 // -------------------------------------------------------------------------
137 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
138 fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
139 ~MoriRegionGrow( )
140 {
141 }
142
143 // -------------------------------------------------------------------------
144 template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
145 void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
146 GenerateData( )
147 {
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( );
152
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( ) );
158 }
159
160 #endif // __fpa__Image__MoriRegionGrow__hxx__
161
162 // eof - $RCSfile$