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: 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 __itkWatershedRelabeler_h
00018 #define __itkWatershedRelabeler_h
00019 
00020 #include "itkEquivalencyTable.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 ITK_EXPORT 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);
00076 
00078   itkStaticConstMacro(ImageDimension, unsigned int,TImageDimension);
00079 
00081   typedef TScalarType ScalarType;
00082   typedef Image<unsigned long, TImageDimension> ImageType;
00083   typedef SegmentTree<ScalarType> SegmentTreeType;
00084   typedef Segmenter<Image<ScalarType, TImageDimension> > SegmenterType;
00085   typedef DataObject::Pointer DataObjectPointer;
00086 
00088   virtual DataObjectPointer MakeOutput(unsigned int idx);
00089 
00091   void SetInputImage(ImageType *img)
00092   {
00093     this->ProcessObject::SetNthInput(0, img);
00094   }
00095   ImageType * GetInputImage(void)
00096   {
00097     return static_cast<ImageType *>
00098       (this->ProcessObject::GetInput(0) );
00099   }
00101 
00103   void SetOutputImage(ImageType * img)
00104   {
00105     this->ProcessObject::SetNthOutput(0,img);
00106   }
00107   ImageType * GetOutputImage(void)
00108   { return static_cast<ImageType *>
00109       (this->ProcessObject::GetOutput(0) ); }
00111 
00113   void SetInputSegmentTree(SegmentTreeType *et)
00114   {
00115     this->ProcessObject::SetNthInput(1, et);
00116   }
00117   SegmentTreeType * GetInputSegmentTree(void)
00118   {
00119     return static_cast<SegmentTreeType *>
00120       (this->ProcessObject::GetInput(1));
00121   }
00123 
00125   void GenerateData();
00126 
00129   itkSetClampMacro(FloodLevel, double, 0.0, 1.0);
00130   itkGetMacro(FloodLevel, double);
00132 
00134   void GraftOutput(ImageType *graft);
00135   void GraftNthOutput(unsigned int idx, ImageType *graft);
00137 
00138 protected:
00139   Relabeler();
00140   virtual ~Relabeler() {}
00141   Relabeler(const Self&) {}
00142   void operator=(const Self&) {}
00143   void PrintSelf(std::ostream& os, Indent indent) const;
00144   
00145   double m_FloodLevel;
00146   void GenerateOutputRequestedRegion(DataObject *output);
00147   void GenerateInputRequestedRegion();
00148 };
00149   
00150 }// end namespace watershed
00151 }// end namespace itk
00152 
00153 #ifndef ITK_MANUAL_INSTANTIATION
00154 #include "itkWatershedRelabeler.txx"
00155 #endif
00156 
00157 #endif
00158 
00159 

Generated at Mon Apr 14 15:01:01 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000