Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-20 16:21:47 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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 );
00133 
00137   double GetFeature(TextureFeatureName feature);
00138 
00139   itkGetMacro(Energy, double);
00140   itkGetMacro(Entropy, double);
00141   itkGetMacro(Correlation, double);
00142   itkGetMacro(InverseDifferenceMoment, double);
00143   itkGetMacro(Inertia, double);
00144   itkGetMacro(ClusterShade, double);
00145   itkGetMacro(ClusterProminence, double);
00146   itkGetMacro(HaralickCorrelation, double);
00147     
00148 protected:
00149   GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator() {};
00150   virtual ~GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator() {};
00151   void PrintSelf(std::ostream& os, Indent indent) const;
00152 
00153 private:
00154   GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator(const Self&); //purposely not implemented
00155   void operator=(const Self&); //purposely not implemented
00156    
00157   HistogramPointer m_Histogram;
00158   double m_Energy, m_Entropy, m_Correlation, m_InverseDifferenceMoment,
00159     m_Inertia, m_ClusterShade, m_ClusterProminence, m_HaralickCorrelation;
00160   void NormalizeHistogram(void);
00161   void ComputeMeansAndVariances( double &pixelMean, double &marginalMean, 
00162                                  double &marginalDevSquared, double &pixelVariance );
00163 };
00164 
00165 
00166 } // end of namespace Statistics 
00167 } // end of namespace itk 
00168 
00169 #ifndef ITK_MANUAL_INSTANTIATION
00170 #include "itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator.txx"
00171 #endif
00172 
00173 #endif
00174 

Generated at Mon Jul 12 2010 18:29:43 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000