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

itkScalarImageTextureCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScalarImageTextureCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/08/24 15:16:53 $
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 __itkScalarImageTextureCalculator_h
00018 #define __itkScalarImageTextureCalculator_h
00019 
00020 #include "itkImage.h"
00021 #include "itkObject.h"
00022 #include "itkVectorContainer.h"
00023 #include "itkMacro.h"
00024 
00025 #include "itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculator.h"
00026 #include "itkMaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator.h"
00027 
00028 namespace itk {
00029 namespace Statistics {
00030 
00106 template< class TImageType,
00107           class THistogramFrequencyContainer = DenseFrequencyContainer >
00108 class ScalarImageTextureCalculator : public Object
00109 {
00110 public:
00112   typedef ScalarImageTextureCalculator Self;
00113   typedef Object Superclass;
00114   typedef SmartPointer<Self> Pointer;
00115   typedef SmartPointer<const Self> ConstPointer;
00116       
00118   itkTypeMacro(ScalarImageTextureCalculator, Object);
00119       
00121   itkNewMacro(Self) ;
00122   
00123   typedef THistogramFrequencyContainer                FrequencyContainerType;
00124   typedef TImageType                                  ImageType;
00125   typedef typename ImageType::Pointer                 ImagePointer;
00126       
00127   typedef typename ImageType::PixelType               PixelType;
00128   typedef typename ImageType::OffsetType              OffsetType;
00129   typedef VectorContainer<unsigned char, OffsetType>  OffsetVector;
00130   typedef typename OffsetVector::Pointer              OffsetVectorPointer;
00131   typedef typename OffsetVector::ConstPointer         OffsetVectorConstPointer;
00132 
00133   typedef MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator< ImageType,
00134     FrequencyContainerType > GLCMGeneratorType;
00135   typedef GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator< typename
00136   GLCMGeneratorType::HistogramType >                GLCMCalculatorType;
00137       
00138   typedef VectorContainer<unsigned char, TextureFeatureName> FeatureNameVector;
00139   typedef typename FeatureNameVector::Pointer         FeatureNameVectorPointer;
00140   typedef typename FeatureNameVector::ConstPointer    FeatureNameVectorConstPointer;
00141   typedef VectorContainer<unsigned char, double>      FeatureValueVector;
00142   typedef typename FeatureValueVector::Pointer        FeatureValueVectorPointer;
00143      
00145   void Compute( void );
00146       
00148   void SetInput( const ImageType * );
00149       
00153   itkGetObjectMacro(FeatureMeans, FeatureValueVector);
00154   itkGetObjectMacro(FeatureStandardDeviations, FeatureValueVector);
00155       
00157   itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00158   itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00159 
00162   itkSetConstObjectMacro(Offsets, OffsetVector);
00163   itkGetConstObjectMacro(Offsets, OffsetVector);
00164       
00167   void SetNumberOfBinsPerAxis( unsigned int );
00168       
00171   void SetPixelValueMinMax( PixelType min, PixelType max );
00172       
00175   void SetImageMask(const ImageType * );
00176       
00179   void SetInsidePixelValue(PixelType InsidePixelValue);
00180 
00181   itkGetMacro(FastCalculations, bool);
00182   itkSetMacro(FastCalculations, bool);
00183   itkBooleanMacro(FastCalculations);
00184       
00185 protected:
00186   ScalarImageTextureCalculator();
00187   virtual ~ScalarImageTextureCalculator() {};
00188   void PrintSelf(std::ostream& os, Indent indent) const;
00189   void FastCompute();
00190   void FullCompute();
00191       
00192 private:
00193   typename GLCMGeneratorType::Pointer m_GLCMGenerator;
00194   FeatureValueVectorPointer m_FeatureMeans, m_FeatureStandardDeviations;
00195   FeatureNameVectorConstPointer m_RequestedFeatures;
00196   OffsetVectorConstPointer m_Offsets;
00197   bool m_FastCalculations;
00198 };    
00199     
00200 } // end of namespace Statistics 
00201 } // end of namespace itk 
00202 
00203 #ifndef ITK_MANUAL_INSTANTIATION
00204 #include "itkScalarImageTextureCalculator.txx"
00205 #endif
00206 
00207 #endif

Generated at Thu May 25 00:00:00 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000