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

itkSimpleFuzzyConnectednessImageFilterBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSimpleFuzzyConnectednessImageFilterBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-09-19 11:43:27 $
00007   Version:   $Revision: 1.3 $
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 __itkSimpleFuzzyConnectednessImageFilterBase_h
00018 #define __itkSimpleFuzzyConnectednessImageFilterBase_h
00019 
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 #include <vnl/vnl_matrix_fixed.h>
00023 
00024 #include <queue>
00025 
00026 namespace itk{
00027 
00056 template <class TInputImage, class TOutputImage>
00057 class ITK_EXPORT SimpleFuzzyConnectednessImageFilterBase:
00058     public ImageToImageFilter<TInputImage,TOutputImage>
00059 {
00060 public:
00062   typedef SimpleFuzzyConnectednessImageFilterBase       Self;
00063   typedef ImageToImageFilter<TInputImage,TOutputImage>   Superclass;
00064   typedef SmartPointer <Self>  Pointer;
00065   typedef SmartPointer<const Self>  ConstPointer;
00066 
00068   itkNewMacro(Self);
00069 
00071   itkTypeMacro(SimpleFuzzyConnectednessImageFilterBase,ImageToImageFilter);
00072 
00074   itkStaticConstMacro(ImageDimension, unsigned int,
00075                       TInputImage::ImageDimension);
00076 
00078   typedef TInputImage InputImageType;
00079   typedef TOutputImage OutputImageType;
00080   typedef Image <unsigned short, itkGetStaticConstMacro(ImageDimension)> UShortImage;
00081   typedef typename TInputImage::IndexType         IndexType;
00082   typedef typename TInputImage::SizeType          SizeType;
00083   typedef typename TInputImage::PixelType         PixelType;
00084   typedef UShortImage                             FuzzySceneType;
00085   typedef typename FuzzySceneType::Pointer        FuzzyScenePointer;
00086   typedef typename InputImageType::ConstPointer   InputImageConstPointer;
00087   typedef std::queue<IndexType>                   QueueType;
00088   typedef typename OutputImageType::RegionType    RegionType;
00089   typedef typename OutputImageType::PixelType     OutputPixelType;
00090   typedef typename OutputImageType::Pointer       OutputImagePointer;
00091 
00094   itkSetMacro(Weight, double);
00095   itkGetMacro(Weight, double);
00097 
00102   itkSetMacro(Threshold, double);
00103   itkGetMacro(Threshold, double);
00105 
00108   itkSetMacro(InsideValue, OutputPixelType);
00109   itkGetMacro(InsideValue, OutputPixelType);
00111 
00114   itkSetMacro(OutsideValue, OutputPixelType);
00115   itkGetMacro(OutsideValue, OutputPixelType);
00117 
00119   itkSetMacro(      ObjectSeed, IndexType );
00120   itkGetConstReferenceMacro( ObjectSeed, IndexType );
00122 
00124   void MakeSegmentObject();
00125 
00127   const FuzzySceneType * GetFuzzyScene(void) const
00128   { return m_FuzzyScene; };
00129 
00131   void UpdateThreshold(const double x);
00132 
00133 protected:
00134   SimpleFuzzyConnectednessImageFilterBase();
00135   ~SimpleFuzzyConnectednessImageFilterBase();
00136   void PrintSelf(std::ostream& os, Indent indent) const;
00137 
00139   void GenerateData();
00140 
00141   double            m_Weight;
00142   double            m_Threshold;
00143   IndexType         m_ObjectSeed;
00144   SizeType          m_Size;
00145 
00146   InputImageConstPointer    m_InputImage;
00147   FuzzyScenePointer         m_FuzzyScene;
00148   OutputImagePointer        m_SegmentObject; 
00149   
00150   QueueType m_Queue;
00151 
00152   void PushNeighbors(const IndexType &center);
00153 
00155   virtual double FuzzyAffinity(const PixelType, const PixelType)
00156   { return 0; }
00157 
00158   double FindStrongPath(const IndexType &center);
00159 
00160 private:
00161   SimpleFuzzyConnectednessImageFilterBase(const Self&); //purposely not implemented
00162   void operator=(const Self&); //purposely not implemented
00163 
00164   OutputPixelType  m_InsideValue;
00165   OutputPixelType  m_OutsideValue;
00166 
00167 };
00168 
00169 
00170 } // end namespace itk.
00171 
00172 #ifndef ITK_MANUAL_INSTANTIATION
00173 #include "itkSimpleFuzzyConnectednessImageFilterBase.txx"
00174 #endif
00175 
00176 #endif
00177 

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