Orfeo Toolbox  4.0
itkWatershedSegmentTreeGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkWatershedSegmentTreeGenerator_h
19 #define __itkWatershedSegmentTreeGenerator_h
20 
23 #include "itkEquivalencyTable.h"
24 
25 #include <algorithm>
26 #include <utility>
27 
28 namespace itk
29 {
30 namespace watershed
31 {
77 template< typename TScalar >
79 {
80 public:
86 
88  itkNewMacro(Self);
89  itkTypeMacro(WatershedSegmentTreeGenerator, ProcessObject);
90 
92  typedef TScalar ScalarType;
98 
103 
106  {
107  return static_cast< SegmentTableType * >( this->ProcessObject::GetInput(0) );
108  }
109 
111  {
112  // Reset the highest calculated flood level if we are given a
113  // different input image.
114  if ( st != this->GetInput(0) )
115  {
117  }
118  this->ProcessObject::SetNthInput(0, st);
119  }
120 
125  {
126  this->ProcessObject::SetNthInput(1, eq);
127  }
128 
130  {
131  return
132  static_cast< EquivalencyTableType * >( this->ProcessObject::GetInput(1) );
133  }
134 
137  {
138  return static_cast< SegmentTreeType * >
139  ( this->ProcessObject::GetOutput(0) );
140  }
141 
143  void GenerateData();
144 
149  itkSetMacro(Merge, bool);
150  itkGetConstMacro(Merge, bool);
151 
157  void SetFloodLevel(double);
158 
159  itkGetConstMacro(FloodLevel, double);
160 
164  itkSetMacro(HighestCalculatedFloodLevel, double);
165  itkGetConstMacro(HighestCalculatedFloodLevel, double);
166 
172  itkSetMacro(ConsumeInput, bool);
173  itkGetConstMacro(ConsumeInput, bool);
174 
179  const IdentifierType,
180  const IdentifierType);
181 
186  const IdentifierType,
187  const IdentifierType,
188  ScalarType);
189 
194 
195 protected:
199  void operator=(const Self &) {}
200  void PrintSelf(std::ostream & os, Indent indent) const;
201 
205 
209 
210  void MergeEquivalencies();
211 
214 
216 
217 private:
218  bool m_Merge;
219  double m_FloodLevel;
221 
222  typedef itksys::hash_map< IdentifierType, bool,
223  itksys::hash< IdentifierType > > HashMapType;
224 
226 
232 };
233 } // end namespace watershed
234 } // end namespace itk
235 
236 #ifndef ITK_MANUAL_INSTANTIATION
238 #endif
239 
240 #endif

Generated at Sat Mar 8 2014 15:47:06 for Orfeo Toolbox with doxygen 1.8.3.1