00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator_h
00018 #define __itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator_h
00019
00020 #include "itkHistogram.h"
00021 #include "itkMacro.h"
00022
00023 namespace itk {
00024 namespace Statistics {
00025
00098 enum TextureFeatureName { Energy, Entropy, Correlation,
00099 InverseDifferenceMoment, Inertia, ClusterShade, ClusterProminence,
00100 HaralickCorrelation };
00101
00102 template< class THistogram >
00103 class GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator : public Object
00104 {
00105 public:
00107 typedef GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator Self;
00108 typedef Object Superclass;
00109 typedef SmartPointer<Self> Pointer;
00110 typedef SmartPointer<const Self> ConstPointer;
00111
00113 itkTypeMacro(GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator, Object);
00114
00116 itkNewMacro(Self) ;
00117
00118 typedef THistogram HistogramType;
00119 typedef typename HistogramType::Pointer HistogramPointer;
00120 typedef typename HistogramType::ConstPointer HistogramConstPointer;
00121 typedef typename HistogramType::MeasurementType MeasurementType;
00122 typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
00123 typedef typename HistogramType::IndexType IndexType;
00124 typedef typename HistogramType::FrequencyType FrequencyType;
00125
00127 void Compute( void );
00128
00130 itkSetObjectMacro( Histogram, HistogramType );
00131 itkGetObjectMacro( Histogram, HistogramType );
00132
00136 double GetFeature(TextureFeatureName feature);
00137
00138 itkGetMacro(Energy, double);
00139 itkGetMacro(Entropy, double);
00140 itkGetMacro(Correlation, double);
00141 itkGetMacro(InverseDifferenceMoment, double);
00142 itkGetMacro(Inertia, double);
00143 itkGetMacro(ClusterShade, double);
00144 itkGetMacro(ClusterProminence, double);
00145 itkGetMacro(HaralickCorrelation, double);
00146
00147 protected:
00148 GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator() {};
00149 virtual ~GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator() {};
00150 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00152 private:
00153 HistogramPointer m_Histogram;
00154 double m_Energy, m_Entropy, m_Correlation, m_InverseDifferenceMoment,
00155 m_Inertia, m_ClusterShade, m_ClusterProminence, m_HaralickCorrelation;
00156 void NormalizeHistogram(void);
00157 void ComputeMeansAndVariances( double &pixelMean, double &marginalMean,
00158 double &marginalDevSquared, double &pixelVariance );
00159 };
00160
00161
00162 }
00163 }
00164
00165 #ifndef ITK_MANUAL_INSTANTIATION
00166 #include "itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator.txx"
00167 #endif
00168
00169 #endif