00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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);
00096
00101 itkSetMacro(Threshold, double);
00102 itkGetMacro(Threshold, double);
00103
00106 itkSetMacro(InsideValue, OutputPixelType);
00107 itkGetMacro(InsideValue, OutputPixelType);
00108
00111 itkSetMacro(OutsideValue, OutputPixelType);
00112 itkGetMacro(OutsideValue, OutputPixelType);
00113
00115 itkSetMacro( ObjectSeed, IndexType );
00116 itkGetConstReferenceMacro( ObjectSeed, IndexType );
00117
00119 void MakeSegmentObject();
00120
00122 const FuzzySceneType * GetFuzzyScene(void) const
00123 { return m_FuzzyScene; };
00124
00126 void UpdateThreshold(const double x);
00127
00128 protected:
00129 SimpleFuzzyConnectednessImageFilterBase();
00130 ~SimpleFuzzyConnectednessImageFilterBase();
00131 void PrintSelf(std::ostream& os, Indent indent) const;
00132
00134 void GenerateData();
00135
00136 double m_Weight;
00137 double m_Threshold;
00138 IndexType m_ObjectSeed;
00139 SizeType m_Size;
00140
00141 InputImageConstPointer m_InputImage;
00142 FuzzyScenePointer m_FuzzyScene;
00143 OutputImagePointer m_SegmentObject;
00144
00145 QueueType m_Queue;
00146
00147 void PushNeighbors(const IndexType ¢er);
00148
00150 virtual double FuzzyAffinity(const PixelType, const PixelType)
00151 { return 0; }
00152
00153 double FindStrongPath(const IndexType ¢er);
00154
00155 private:
00156 SimpleFuzzyConnectednessImageFilterBase(const Self&);
00157 void operator=(const Self&);
00158
00159 OutputPixelType m_InsideValue;
00160 OutputPixelType m_OutsideValue;
00161
00162 };
00163
00164
00165 }
00167 #ifndef ITK_MANUAL_INSTANTIATION
00168 #include "itkSimpleFuzzyConnectednessImageFilterBase.txx"
00169 #endif
00170
00171 #endif