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 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 void PrintSelf(std::ostream& os, Indent indent) const;
00114
00116 void GenerateData();
00117
00118 double m_Weight;
00119 double m_Threshold;
00120 IndexType m_ObjectsSeed;
00121 SizeType m_Size;
00122
00123 typename InputImageType::ConstPointer m_InputImage;
00124 typename UShortImage::Pointer m_FuzzyScene;
00125 typename OutputImageType::Pointer m_SegmentObject;
00126
00127 QueueType m_Queue;
00128
00129 void PushNeighbors(const IndexType ¢er);
00130
00132 virtual double FuzzyAffinity(const PixelType, const PixelType)
00133 { return 0; }
00134
00135 double FindStrongPath(const IndexType ¢er);
00136
00137 private:
00138 SimpleFuzzyConnectednessImageFilterBase(const Self&);
00139 void operator=(const Self&);
00140
00141 };
00142
00143
00144 }
00146 #ifndef ITK_MANUAL_INSTANTIATION
00147 #include "itkSimpleFuzzyConnectednessImageFilterBase.txx"
00148 #endif
00149
00150 #endif