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

itkWatershedRelabeler.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWatershedRelabeler.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:39:01 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkWatershedRelabeler_h
00018 #define __itkWatershedRelabeler_h
00019 
00020 #include "itkWatershedEquivalencyTable.h"
00021 #include "itkWatershedSegmentTree.h"
00022 #include "itkWatershedSegmenter.h"
00023 #include "itkImage.h"
00024 
00025 namespace itk
00026 {
00027 namespace watershed
00028 {
00029 
00063 template <class TScalarType, unsigned int TImageDimension>
00064 class Relabeler
00065   : public ProcessObject
00066 {
00067 public:
00069   typedef Relabeler Self;
00070   typedef ProcessObject Superclass;
00071   typedef SmartPointer<Self> Pointer;
00072   typedef SmartPointer<const Self> ConstPointer;
00073   itkNewMacro(Self);
00074   itkTypeMacro(Relabeler, ProcessObject);
00075 
00077   itkStaticConstMacro(ImageDimension, unsigned int,TImageDimension);
00078   
00080   typedef TScalarType ScalarType;
00081   typedef Image<unsigned long, TImageDimension> ImageType;
00082   typedef SegmentTree<ScalarType> SegmentTreeType;
00083   typedef Segmenter<Image<ScalarType, TImageDimension> > SegmenterType;
00084   typedef DataObject::Pointer DataObjectPointer;
00085 
00087   virtual DataObjectPointer MakeOutput(unsigned int idx);
00088   
00090   void SetInputImage(ImageType *img)
00091     {
00092       this->ProcessObject::SetNthInput(0, img);
00093     }
00094   ImageType * GetInputImage(void)
00095     {
00096       return static_cast<ImageType *>
00097         (this->ProcessObject::GetInput(0) );
00098     }
00099 
00101   void SetOutputImage(ImageType * img)
00102     {
00103       this->ProcessObject::SetNthOutput(0,img);
00104     }
00105   ImageType * GetOutputImage(void)
00106     { return static_cast<ImageType *>
00107         (this->ProcessObject::GetOutput(0) ); }
00108 
00110   void SetInputSegmentTree(SegmentTreeType *et)
00111     {
00112       this->ProcessObject::SetNthInput(1, et);
00113     }
00114   SegmentTreeType * GetInputSegmentTree(void)
00115     {
00116       return static_cast<SegmentTreeType *>
00117         (this->ProcessObject::GetInput(1));
00118     }
00119 
00121   void GenerateData();
00122 
00125   itkSetClampMacro(FloodLevel, double, 0.0, 1.0);
00126   itkGetMacro(FloodLevel, double);
00127 
00129   void GraftOutput(ImageType *graft);
00130   void GraftNthOutput(unsigned int idx, ImageType *graft);
00131   
00132 protected:
00133   Relabeler();
00134   virtual ~Relabeler() {}
00135   Relabeler(const Self&) {}
00136   void operator=(const Self&) {}
00137   void PrintSelf(std::ostream& os, Indent indent) const;
00138   
00139   double m_FloodLevel;
00140   void GenerateOutputRequestedRegion(DataObject *output);
00141   void GenerateInputRequestedRegion();
00142 };
00143   
00144 }// end namespace watershed
00145 }// end namespace itk
00146 
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkWatershedRelabeler.txx"
00149 #endif
00150 
00151 #endif
00152 

Generated at Wed Mar 12 01:13:14 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000