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

itkHistogramToTextureFeaturesFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkHistogramToTextureFeaturesFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-08 16:55:05 $
00007   Version:   $Revision: 1.2 $
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 __itkHistogramToTextureFeaturesFilter_h
00018 #define __itkHistogramToTextureFeaturesFilter_h
00019 
00020 #include "itkHistogram.h"
00021 #include "itkMacro.h"
00022 #include "itkProcessObject.h"
00023 #include "itkSimpleDataObjectDecorator.h"
00024 
00025 namespace itk {
00026 namespace Statistics {
00027 
00098 template < class THistogram >
00099 class ITK_EXPORT HistogramToTextureFeaturesFilter : public ProcessObject
00100 {
00101 public:
00103   typedef HistogramToTextureFeaturesFilter                Self;
00104   typedef ProcessObject                                   Superclass;
00105   typedef SmartPointer<Self>                              Pointer;
00106   typedef SmartPointer<const Self>                        ConstPointer;
00107 
00109   itkTypeMacro(HistogramToTextureFeaturesFilter, ProcessObject);
00110 
00112   itkNewMacro(Self);
00113 
00114   typedef THistogram                                      HistogramType;
00115   typedef typename HistogramType::Pointer                 HistogramPointer;
00116   typedef typename HistogramType::ConstPointer            HistogramConstPointer;
00117   typedef typename HistogramType::MeasurementType         MeasurementType;
00118   typedef typename HistogramType::MeasurementVectorType   MeasurementVectorType;
00119   typedef typename HistogramType::IndexType               IndexType;
00120   typedef typename HistogramType::AbsoluteFrequencyType   AbsoluteFrequencyType;
00121   typedef typename HistogramType::RelativeFrequencyType   RelativeFrequencyType;
00122 
00123   typedef typename HistogramType::TotalAbsoluteFrequencyType   
00124                                                      TotalAbsoluteFrequencyType;
00125 
00126   typedef typename HistogramType::TotalRelativeFrequencyType   
00127                                                      TotalRelativeFrequencyType;
00128 
00130   typedef std::vector< RelativeFrequencyType >          RelativeFrequencyContainerType;
00131 
00133   void SetInput ( const HistogramType * histogram );
00134   const HistogramType * GetInput() const;
00136 
00138   typedef DataObject::Pointer                   DataObjectPointer;
00139 
00141   typedef SimpleDataObjectDecorator<MeasurementType>     MeasurementObjectType;
00142 
00144   MeasurementType GetEnergy() const;
00145   const MeasurementObjectType* GetEnergyOutput() const;
00147 
00149   MeasurementType GetEntropy() const;
00150   const MeasurementObjectType* GetEntropyOutput() const;
00152 
00154   MeasurementType GetCorrelation() const;
00155   const MeasurementObjectType* GetCorrelationOutput() const;
00157 
00159   MeasurementType GetInverseDifferenceMoment() const;
00160   const MeasurementObjectType* GetInverseDifferenceMomentOutput() const;
00161 
00163   MeasurementType GetInertia() const;
00164   const MeasurementObjectType* GetInertiaOutput() const;
00166 
00168   MeasurementType GetClusterShade() const;
00169   const MeasurementObjectType* GetClusterShadeOutput() const;
00171 
00173   MeasurementType GetClusterProminence() const;
00174   const MeasurementObjectType* GetClusterProminenceOutput() const;
00176 
00178   MeasurementType GetHaralickCorrelation() const;
00179   const MeasurementObjectType* GetHaralickCorrelationOutput() const;
00181 
00183   typedef enum 
00184     { 
00185     Energy,
00186     Entropy,
00187     Correlation,
00188     InverseDifferenceMoment,
00189     Inertia,
00190     ClusterShade,
00191     ClusterProminence,
00192     HaralickCorrelation,
00193     InvalidFeatureName
00194     }  TextureFeatureName;
00195 
00197   MeasurementType GetFeature( TextureFeatureName name );
00198 
00199   
00200 protected:
00201   HistogramToTextureFeaturesFilter();
00202   ~HistogramToTextureFeaturesFilter() {};
00203   void PrintSelf(std::ostream& os, Indent indent) const;
00204 
00206   virtual DataObjectPointer MakeOutput( unsigned int );
00207 
00208 
00209   void GenerateData();
00210 
00211 private:
00212   HistogramToTextureFeaturesFilter(const Self&); //purposely not implemented
00213   void operator=(const Self&); //purposely not implemented
00214 
00215   void ComputeMeansAndVariances( double &pixelMean, double &marginalMean, 
00216     double &marginalDevSquared, double &pixelVariance );
00217 
00218   RelativeFrequencyContainerType             m_RelativeFrequencyContainer;
00219 };
00220     
00221     
00222 } // end of namespace Statistics 
00223 } // end of namespace itk 
00224 
00225 #ifndef ITK_MANUAL_INSTANTIATION
00226 #include "itkHistogramToTextureFeaturesFilter.txx"
00227 #endif
00228 
00229 #endif
00230 

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