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 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 typename UShortImage::Pointer FuzzyScene;
00085 typedef std::queue<IndexType> QueueType;
00086 typedef typename TOutputImage::RegionType RegionType;
00087
00090 itkSetMacro(Weight, double);
00091 itkGetMacro(Weight, double);
00092
00094 itkSetMacro(Threshold, double);
00095 itkGetMacro(Threshold, double);
00096
00098 void SetObjectsSeed(const IndexType & seed);
00099
00101 void MakeSegmentObject();
00102
00104 FuzzyScene GetFuzzyScene(void)
00105 { return m_FuzzyScene; };
00106
00108 void UpdateThreshold(const double x);
00109
00110 protected:
00111 SimpleFuzzyConnectednessImageFilterBase();
00112 ~SimpleFuzzyConnectednessImageFilterBase();
00113
00115 void GenerateData();
00116
00117 double m_Weight;
00118 double m_Threshold;
00119 IndexType m_ObjectsSeed;
00120 SizeType m_Size;
00121
00122 typename InputImageType::ConstPointer m_InputImage;
00123 typename UShortImage::Pointer m_FuzzyScene;
00124 typename OutputImageType::Pointer m_SegmentObject;
00125
00126 QueueType m_Queue;
00127
00128 void PushNeighbors(const IndexType ¢er);
00129
00131 virtual double FuzzyAffinity(const PixelType f1, const PixelType f2)
00132 { return 0; }
00133
00134 double FindStrongPath(const IndexType ¢er);
00135
00136 private:
00137 SimpleFuzzyConnectednessImageFilterBase(const Self&);
00138 void operator=(const Self&);
00139
00140 };
00141
00142
00143 }
00145 #ifndef ITK_MANUAL_INSTANTIATION
00146 #include "itkSimpleFuzzyConnectednessImageFilterBase.txx"
00147 #endif
00148
00149 #endif