Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkWatershedBoundaryResolver.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWatershedBoundaryResolver.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:53:37 $
00007   Version:   $Revision: 1.12 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkWatershedBoundaryResolver_h
00018 #define __itkWatershedBoundaryResolver_h
00019 
00020 #if defined(_MSC_VER)
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023 #include "itkWatershedBoundary.h"
00024 #include "itkEquivalencyTable.h"
00025 #include "itkWatershedSegmenter.h"
00026 
00027 namespace itk
00028 {
00029 namespace watershed
00030 {
00065 template <class TPixelType, unsigned int TDimension>
00066 class ITK_EXPORT BoundaryResolver : public ProcessObject
00067 {
00068 public:
00070   typedef BoundaryResolver         Self;
00071   typedef ProcessObject            Superclass;
00072   typedef SmartPointer<Self>       Pointer;
00073   typedef SmartPointer<const Self> ConstPointer;
00074   itkNewMacro(Self);
00075   itkTypeMacro(WatershedBoundaryResolver, ProcessObject);
00077 
00079   itkStaticConstMacro(ImageDimension, unsigned int, TDimension);
00080 
00082   typedef TPixelType                                PixelType;
00083   typedef Boundary<PixelType, TDimension>           BoundaryType;
00084   typedef EquivalencyTable                          EquivalencyTableType;
00085   typedef Segmenter<Image<TPixelType, TDimension> > SegmenterType;
00086   typedef DataObject::Pointer                       DataObjectPointer;
00087 
00089   void SetBoundaryA(BoundaryType *bd)
00090   { this->ProcessObject::SetNthInput(0, bd); }
00091   typename BoundaryType::Pointer GetBoundaryA()
00092   { return static_cast<BoundaryType *>(this->GetInput(0));  }
00094 
00096   void SetBoundaryB(BoundaryType *bd)
00097   { this->ProcessObject::SetNthInput(1, bd); }
00098   typename BoundaryType::Pointer GetBoundaryB()
00099   { return static_cast<BoundaryType *>(this->GetInput(1));  }
00101 
00104   itkSetMacro(Face, unsigned short);
00105   itkGetConstMacro(Face, unsigned short);
00107 
00111   void SetEquivalencyTable(EquivalencyTableType::Pointer a)
00112   { this->ProcessObject::SetNthOutput(0, a.GetPointer()); }
00113   EquivalencyTableType::Pointer GetEquivalencyTable()
00114   { return static_cast<EquivalencyTableType *>
00115       (this->ProcessObject::GetOutput(0)); }
00117 
00119   void GenerateData();
00120 
00122   virtual DataObjectPointer MakeOutput(unsigned int idx);  
00123 protected:
00124   BoundaryResolver() : m_Face(0)
00125     {
00126     EquivalencyTable::Pointer eq
00127       = static_cast<EquivalencyTable*>(this->MakeOutput(0).GetPointer());
00128     this->SetNumberOfRequiredOutputs(1);
00129     this->ProcessObject::SetNthOutput(0, eq.GetPointer());
00130     }
00131   virtual ~BoundaryResolver() {}
00132   BoundaryResolver(const Self&) {}
00133   void operator=(const Self&) {}
00134   void PrintSelf(std::ostream& os, Indent indent) const;
00136 
00137   unsigned short m_Face;
00138   void GenerateOutputRequestedRegion(DataObject *output);
00139 };
00140   
00141 }// end namespace watershed
00142 }// end namespace itk
00143 
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkWatershedBoundaryResolver.txx"
00146 #endif
00147 
00148 #endif
00149 

Generated at Mon Jul 12 2010 20:18:13 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000