Orfeo Toolbox  4.2
itkWatershedRelabeler.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 __itkWatershedRelabeler_h
19 #define __itkWatershedRelabeler_h
20 
22 #include "itkWatershedSegmenter.h"
23 
24 namespace itk
25 {
26 namespace watershed
27 {
63 template< typename TScalar, unsigned int TImageDimension >
64 class Relabeler:
65  public ProcessObject
66 {
67 public:
69  typedef Relabeler Self;
73 
75  itkNewMacro(Self);
76  itkTypeMacro(WatershedRelabeler, ProcessObject);
77 
79  itkStaticConstMacro(ImageDimension, unsigned int, TImageDimension);
80 
82  typedef TScalar ScalarType;
87 
92 
95  {
96  this->ProcessObject::SetNthInput(0, img);
97  }
98 
100  {
101  return itkDynamicCastInDebugMode< ImageType * >
102  ( this->ProcessObject::GetInput(0) );
103  }
104 
107  {
108  this->ProcessObject::SetNthOutput(0, img);
109  }
110 
112  {
113  return itkDynamicCastInDebugMode< ImageType * >
114  ( this->ProcessObject::GetOutput(0) );
115  }
116 
119  {
120  this->ProcessObject::SetNthInput(1, et);
121  }
122 
124  {
125  return itkDynamicCastInDebugMode< SegmentTreeType * >
126  ( this->ProcessObject::GetInput(1) );
127  }
128 
130  virtual void GenerateData() ITK_OVERRIDE;
131 
134  itkSetClampMacro(FloodLevel, double, 0.0, 1.0);
135  itkGetConstMacro(FloodLevel, double);
136 
138  void GraftOutput(ImageType *graft);
139 
140  void GraftNthOutput(unsigned int idx, ImageType *graft);
141 
142 protected:
143  Relabeler();
144  virtual ~Relabeler() {}
145  Relabeler(const Self &) {}
146  void operator=(const Self &) {}
147  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
148 
149  double m_FloodLevel;
150  virtual void GenerateOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
151 
152  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
153 };
154 } // end namespace watershed
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkWatershedRelabeler.hxx"
159 #endif
160 
161 #endif

Generated at Sat Aug 30 2014 15:52:11 for Orfeo Toolbox with doxygen 1.8.3.1