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

itkWatershedEquivalenceRelabeler.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWatershedEquivalenceRelabeler.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-01-27 19:30:17 $
00007   Version:   $Revision: 1.10 $
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 __itkWatershedEquivalenceRelabeler_h
00018 #define __itkWatershedEquivalenceRelabeler_h
00019 
00020 #include "itkEquivalencyTable.h"
00021 #include "itkWatershedSegmenter.h"
00022 #include "itkImage.h"
00023 
00024 namespace itk
00025 {
00026 namespace watershed
00027 {
00051 template <class TScalarType, unsigned int TImageDimension>
00052 class ITK_EXPORT EquivalenceRelabeler
00053   : public ProcessObject
00054 {
00055 public:
00057   itkStaticConstMacro(ImageDimension, unsigned int,TImageDimension);
00058 
00060   typedef Image<unsigned long, TImageDimension>          ImageType;
00061   typedef EquivalenceRelabeler                           Self;
00062   typedef ProcessObject                                  Superclass;
00063   typedef TScalarType                                    ScalarType;
00064   typedef EquivalencyTable                               EquivalencyTableType;
00065   typedef Segmenter<Image<ScalarType, TImageDimension> > SegmenterType;
00066   typedef DataObject::Pointer                            DataObjectPointer;
00067 
00069   typedef SmartPointer<Self>       Pointer;
00070   typedef SmartPointer<const Self> ConstPointer;
00071   itkNewMacro(Self);
00072   itkTypeMacro(WatershedEquivalenceRelabeler, ProcessObject);
00074 
00076   void SetInputImage(ImageType *img)
00077     { this->ProcessObject::SetNthInput(0, img); }
00078   const ImageType * GetInputImage(void)
00079     {
00080     return static_cast<ImageType *>
00081       (this->ProcessObject::GetInput(0));
00082     }
00084 
00086   void SetOutputImage(ImageType * img)
00087     {
00088     this->ProcessObject::SetNthOutput(0,img);
00089     }
00090   typename ImageType::Pointer GetOutputImage()
00091     {
00092     return static_cast<ImageType *>
00093       (this->ProcessObject::GetOutput(0));
00094     }
00096 
00098   void SetEquivalencyTable(EquivalencyTableType *et)
00099     {
00100     this->ProcessObject::SetNthInput(1, et);
00101     }
00102   EquivalencyTableType::Pointer GetEquivalencyTable()
00103     {
00104     return static_cast<EquivalencyTableType *>
00105       (this->ProcessObject::GetInput(1));
00106     }
00108 
00110   void GenerateData();
00111 
00113   virtual DataObjectPointer MakeOutput(unsigned int idx);
00114 
00115 protected:
00116   EquivalenceRelabeler()
00117     {
00118     typename ImageType::Pointer img
00119       = static_cast<ImageType*>(this->MakeOutput(0).GetPointer());
00120     this->SetNumberOfRequiredOutputs(1);
00121     this->ProcessObject::SetNthOutput(0, img.GetPointer());
00122     }
00123   virtual ~EquivalenceRelabeler() {}
00124   EquivalenceRelabeler(const Self&) {}
00125   void operator=(const Self&) {}
00126   void PrintSelf(std::ostream& os, Indent indent) const;
00127   
00128   void GenerateOutputRequestedRegion(DataObject *output);
00129   void GenerateInputRequestedRegion();
00130 };
00131   
00132 }// end namespace watershed
00133 }// end namespace itk
00134 
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkWatershedEquivalenceRelabeler.txx"
00137 #endif
00138 
00139 #endif
00140 

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