ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkWatershedBoundaryResolver.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 __itkWatershedBoundaryResolver_h
19 #define __itkWatershedBoundaryResolver_h
20 
21 
22 #include "itkWatershedSegmenter.h"
23 
24 namespace itk
25 {
26 namespace watershed
27 {
63 template< typename TPixelType, unsigned int TDimension >
65 {
66 public:
72  itkNewMacro(Self);
73  itkTypeMacro(WatershedBoundaryResolver, ProcessObject);
75 
77  itkStaticConstMacro(ImageDimension, unsigned int, TDimension);
78 
80  typedef TPixelType PixelType;
85 
88  { this->ProcessObject::SetNthInput(0, bd); }
90  { return static_cast< BoundaryType * >( this->GetInput(0) ); }
92 
95  { this->ProcessObject::SetNthInput(1, bd); }
97  { return static_cast< BoundaryType * >( this->GetInput(1) ); }
99 
102  itkSetMacro(Face, unsigned short);
103  itkGetConstMacro(Face, unsigned short);
105 
110  { this->ProcessObject::SetNthOutput( 0, a.GetPointer() ); }
112  {
113  return static_cast< EquivalencyTableType * >
114  ( this->ProcessObject::GetOutput(0) );
115  }
117 
119  virtual void GenerateData() ITK_OVERRIDE;
120 
123  using Superclass::MakeOutput;
124  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
125 
126 protected:
128  {
130  static_cast< EquivalencyTable * >( this->MakeOutput(0).GetPointer() );
131 
133  this->ProcessObject::SetNthOutput( 0, eq.GetPointer() );
134  }
135 
136  virtual ~BoundaryResolver() {}
137  BoundaryResolver(const Self &) {}
138  void operator=(const Self &) {}
139  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
140 
141  unsigned short m_Face;
142  virtual void GenerateOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
143 };
144 } // end namespace watershed
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 #include "itkWatershedBoundaryResolver.hxx"
149 #endif
150 
151 #endif
virtual void SetNumberOfRequiredOutputs(DataObjectPointerArraySizeType _arg)
Light weight base class for most itk classes.
virtual void GenerateData() ITK_OVERRIDE
Boundary< PixelType, TDimension > BoundaryType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
ObjectType * GetPointer() const
Segmenter< Image< TPixelType, TDimension > > SegmenterType
EquivalencyTableType::Pointer GetEquivalencyTable()
void SetEquivalencyTable(EquivalencyTableType::Pointer a)
Hash table to manage integral label equivalencies.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject * GetInput(const DataObjectIdentifierType &key)
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
virtual void SetNthOutput(DataObjectPointerArraySizeType num, DataObject *output)
virtual void GenerateOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
Base class for all data objects in ITK.
DataObject * GetOutput(const DataObjectIdentifierType &key)