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: 2003/09/10 14:28:41 $
00007   Version:   $Revision: 1.9 $
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(BoundaryResolver, ProcessObject);
00076   
00078   itkStaticConstMacro(ImageDimension, unsigned int, TDimension);
00079 
00081   typedef TPixelType PixelType;
00082   typedef Boundary<PixelType, TDimension> BoundaryType;
00083   typedef EquivalencyTable EquivalencyTableType;
00084   typedef Segmenter<Image<TPixelType, TDimension> > SegmenterType;
00085   typedef DataObject::Pointer DataObjectPointer;
00086   
00088   void SetBoundaryA(BoundaryType *bd)
00089   { this->ProcessObject::SetNthInput(0, bd); }
00090   typename BoundaryType::Pointer GetBoundaryA()
00091   { return static_cast<BoundaryType *>(this->GetInput(0));  }
00092   
00094   void SetBoundaryB(BoundaryType *bd)
00095   { this->ProcessObject::SetNthInput(1, bd); }
00096   typename BoundaryType::Pointer GetBoundaryB()
00097   { return static_cast<BoundaryType *>(this->GetInput(1));  }
00098   
00101   itkSetMacro(Face, unsigned short);
00102   itkGetMacro(Face, unsigned short);
00103   
00107   void SetEquivalencyTable(EquivalencyTableType::Pointer a)
00108   { this->ProcessObject::SetNthOutput(0, a.GetPointer()); }
00109   EquivalencyTableType::Pointer GetEquivalencyTable()
00110   { return static_cast<EquivalencyTableType *>
00111       (this->ProcessObject::GetOutput(0)); }
00112 
00114   void GenerateData();
00115 
00117   virtual DataObjectPointer MakeOutput(unsigned int idx);  
00118 protected:
00119   BoundaryResolver() : m_Face(0)
00120   {
00121     EquivalencyTable::Pointer eq
00122       = static_cast<EquivalencyTable*>(this->MakeOutput(0).GetPointer());
00123     this->SetNumberOfRequiredOutputs(1);
00124     this->ProcessObject::SetNthOutput(0, eq.GetPointer());
00125   }
00126   virtual ~BoundaryResolver() {}
00127   BoundaryResolver(const Self&) {}
00128   void operator=(const Self&) {}
00129   void PrintSelf(std::ostream& os, Indent indent) const;
00130 
00131   unsigned short m_Face;
00132   void GenerateOutputRequestedRegion(DataObject *output);
00133 };
00134   
00135 }// end namespace watershed
00136 }// end namespace itk
00137 
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkWatershedBoundaryResolver.txx"
00140 #endif
00141 
00142 #endif

Generated at Thu May 25 00:17:16 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000