00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSimpleFuzzyConnectednessRGBImageFilter_h
00018 #define __itkSimpleFuzzyConnectednessRGBImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 #include "itkSimpleFuzzyConnectednessImageFilterBase.h"
00023 #include <vnl/vnl_matrix_fixed.h>
00024
00025 #include <queue>
00026
00027 namespace itk{
00028
00078 template <class TInputImage, class TOutputImage>
00079 class ITK_EXPORT SimpleFuzzyConnectednessRGBImageFilter:
00080 public SimpleFuzzyConnectednessImageFilterBase<TInputImage,TOutputImage>
00081 {
00082 public:
00084 typedef SimpleFuzzyConnectednessRGBImageFilter Self;
00085 typedef SimpleFuzzyConnectednessImageFilterBase<TInputImage,TOutputImage>
00086 Superclass;
00087 typedef SmartPointer <Self> Pointer;
00088 typedef SmartPointer<const Self> ConstPointer;
00089
00091 itkNewMacro(Self);
00092
00094 itkTypeMacro(SimpleFuzzyConnectednessRGBImageFilter,
00095 SimpleFuzzyConnectednessImageFilterBase);
00096
00098 typedef typename TInputImage::PixelType PixelType;
00099
00101 itkSetVectorMacro(Mean,double,3);
00102 void GetMean(double omean[3])
00103 {
00104 omean[0]=m_Mean[0];omean[1]=m_Mean[1];omean[2]=m_Mean[2];
00105 }
00106 void SetVariance(double ivar[3][3])
00107 {
00108 m_Variance[0][0]=ivar[0][0];m_Variance[0][1]=ivar[0][1];m_Variance[0][2]=ivar[0][2];
00109 m_Variance[1][0]=ivar[1][0];m_Variance[1][1]=ivar[1][1];m_Variance[1][2]=ivar[1][2];
00110 m_Variance[2][0]=ivar[2][0];m_Variance[2][1]=ivar[2][2];m_Variance[2][2]=ivar[2][2];
00111 }
00112 void GetVariance(double ovar[3][3])
00113 {
00114 ovar[0][0]=m_Variance[0][0];ovar[0][1]=m_Variance[0][1];ovar[0][2]=m_Variance[0][2];
00115 ovar[1][0]=m_Variance[1][0];ovar[1][1]=m_Variance[1][1];ovar[1][2]=m_Variance[1][2];
00116 ovar[2][0]=m_Variance[2][0];ovar[2][1]=m_Variance[2][1];ovar[2][2]=m_Variance[2][2];
00117 }
00118 itkSetVectorMacro(Diff_Mean,double,3);
00119 void GetDiff_Mean(double odmean[3])
00120 {
00121 odmean[0]=m_Diff_Mean[0];odmean[1]=m_Diff_Mean[1];odmean[2]=m_Diff_Mean[2];
00122 };
00123 void SetDiff_Variance(double idvar[3][3])
00124 {
00125 m_Diff_Variance[0][0]=idvar[0][0];m_Diff_Variance[0][1]=idvar[0][1];m_Diff_Variance[0][2]=idvar[0][2];
00126 m_Diff_Variance[1][0]=idvar[1][0];m_Diff_Variance[1][1]=idvar[1][1];m_Diff_Variance[1][2]=idvar[1][2];
00127 m_Diff_Variance[2][0]=idvar[2][0];m_Diff_Variance[2][1]=idvar[2][1];m_Diff_Variance[2][2]=idvar[2][2];
00128 }
00129 void GetDiff_Variance(double odvar[3][3])
00130 {
00131 odvar[0][0]=m_Diff_Variance[0][0];odvar[0][1]=m_Diff_Variance[0][1];odvar[0][2]=m_Diff_Variance[0][2];
00132 odvar[1][0]=m_Diff_Variance[1][0];odvar[1][1]=m_Diff_Variance[1][1];odvar[1][2]=m_Diff_Variance[1][2];
00133 odvar[2][0]=m_Diff_Variance[2][0];odvar[2][1]=m_Diff_Variance[2][1];odvar[2][2]=m_Diff_Variance[2][2];
00134 }
00136
00137 protected:
00138 SimpleFuzzyConnectednessRGBImageFilter();
00139 ~SimpleFuzzyConnectednessRGBImageFilter();
00140 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00141
00142 void GenerateData(void);
00143
00144 private:
00145 SimpleFuzzyConnectednessRGBImageFilter(const Self&);
00146 void operator=(const Self&);
00147
00148 double m_Mean[3];
00149 double m_Variance[3][3];
00150 double m_Diff_Mean[3];
00151 double m_Diff_Variance[3][3];
00152
00153 double m_VarianceInverse[3][3];
00154 double m_Diff_VarianceInverse[3][3];
00155 double m_VarianceDet;
00156 double m_Diff_VarianceDet;
00157
00158 virtual double FuzzyAffinity(const PixelType f1, const PixelType f2);
00159 };
00160
00161
00162 }
00163
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkSimpleFuzzyConnectednessRGBImageFilter.txx"
00166 #endif
00167
00168 #endif
00169