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: 2009-01-27 19:30:18 $
00007   Version:   $Revision: 1.11 $
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(WatershedRelabeler, 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     {
00109     return static_cast<ImageType *>
00110       (this->ProcessObject::GetOutput(0) );
00111     }
00113 
00115   void SetInputSegmentTree(SegmentTreeType *et)
00116     {
00117     this->ProcessObject::SetNthInput(1, et);
00118     }
00119   SegmentTreeType * GetInputSegmentTree(void)
00120     {
00121     return static_cast<SegmentTreeType *>
00122       (this->ProcessObject::GetInput(1));
00123     }
00125 
00127   void GenerateData();
00128 
00131   itkSetClampMacro(FloodLevel, double, 0.0, 1.0);
00132   itkGetMacro(FloodLevel, double);
00134 
00136   void GraftOutput(ImageType *graft);
00137   void GraftNthOutput(unsigned int idx, ImageType *graft);
00139 
00140 protected:
00141   Relabeler();
00142   virtual ~Relabeler() {}
00143   Relabeler(const Self&) {}
00144   void operator=(const Self&) {}
00145   void PrintSelf(std::ostream& os, Indent indent) const;
00146   
00147   double m_FloodLevel;
00148   void GenerateOutputRequestedRegion(DataObject *output);
00149   void GenerateInputRequestedRegion();
00150 };
00151   
00152 }// end namespace watershed
00153 }// end namespace itk
00154 
00155 #ifndef ITK_MANUAL_INSTANTIATION
00156 #include "itkWatershedRelabeler.txx"
00157 #endif
00158 
00159 #endif
00160 

Generated at Sat Feb 28 13:53:27 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000