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

itkScalarImageToGreyLevelCooccurrenceMatrixGenerator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScalarImageToGreyLevelCooccurrenceMatrixGenerator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005-08-24 15:16:54 $
00007   Version:   $Revision: 1.8 $
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 __itkScalarImageToGreyLevelCooccurrenceMatrixGenerator_h
00018 #define __itkScalarImageToGreyLevelCooccurrenceMatrixGenerator_h
00019 
00020 #include "itkImage.h"
00021 #include "itkHistogram.h"
00022 #include "itkDenseFrequencyContainer.h"
00023 #include "itkVectorContainer.h"
00024 #include "itkObject.h"
00025 #include "itkNumericTraits.h"
00026 #include "itkMacro.h"
00027 
00028 namespace itk {
00029   namespace Statistics {
00030 
00090 template< class TImageType,
00091           class THistogramFrequencyContainer = DenseFrequencyContainer >
00092 class ScalarImageToGreyLevelCooccurrenceMatrixGenerator : public Object
00093   {
00094   public:
00096     typedef ScalarImageToGreyLevelCooccurrenceMatrixGenerator Self;
00097     typedef Object Superclass;
00098     typedef SmartPointer<Self> Pointer;
00099     typedef SmartPointer<const Self> ConstPointer;
00100 
00102     itkTypeMacro(ScalarImageToGreyLevelCooccurrenceMatrixGenerator, Object);
00103 
00105     itkNewMacro(Self) ;
00106 
00107     typedef TImageType                                      ImageType;
00108     typedef typename ImageType::Pointer                     ImagePointer;
00109     typedef typename ImageType::ConstPointer                ImageConstPointer;
00110     typedef typename ImageType::PixelType                   PixelType;
00111     typedef typename ImageType::RegionType                  RegionType;
00112     typedef typename ImageType::SizeType                    RadiusType;
00113     typedef typename ImageType::OffsetType                  OffsetType;
00114     typedef VectorContainer<unsigned char, OffsetType>      OffsetVector;
00115     typedef typename OffsetVector::Pointer                  OffsetVectorPointer;
00116     typedef typename OffsetVector::ConstPointer             OffsetVectorConstPointer;
00117     
00118     typedef typename NumericTraits<PixelType>::RealType     MeasurementType;
00119     
00120     typedef Histogram< MeasurementType, 2, THistogramFrequencyContainer >
00121                                                             HistogramType;
00122     typedef typename HistogramType::Pointer                 HistogramPointer;
00123     typedef typename HistogramType::ConstPointer            HistogramConstPointer;
00124     typedef typename HistogramType::MeasurementVectorType   MeasurementVectorType;
00125     
00126     
00127     itkStaticConstMacro(DefaultBinsPerAxis, unsigned int, 256);
00128     
00130     void Compute( void );
00131 
00133     itkSetConstObjectMacro( Input, ImageType );
00134     itkGetConstObjectMacro( Input, ImageType );
00136 
00139     itkSetConstObjectMacro( Offsets, OffsetVector );
00140     itkGetConstObjectMacro( Offsets, OffsetVector );
00141     void SetOffset( const OffsetType offset )
00142       {
00143       OffsetVectorPointer offsetVector = OffsetVector::New();
00144       offsetVector->push_back(offset);
00145       this->SetOffsets(offsetVector);
00146       }
00148 
00152     itkGetObjectMacro( Output, HistogramType );
00153 
00155     itkSetMacro( NumberOfBinsPerAxis, unsigned int );
00156     itkGetMacro( NumberOfBinsPerAxis, unsigned int );
00158 
00160     void SetPixelValueMinMax( PixelType min, PixelType max );
00161     itkGetMacro(Min, PixelType);
00162     itkGetMacro(Max, PixelType);
00164 
00167     itkSetMacro(Normalize, bool);
00168     itkGetMacro(Normalize, bool);
00169     itkBooleanMacro(Normalize);
00171 
00172   protected:
00173     ScalarImageToGreyLevelCooccurrenceMatrixGenerator();
00174     virtual ~ScalarImageToGreyLevelCooccurrenceMatrixGenerator() {};
00175     void PrintSelf(std::ostream& os, Indent indent) const;
00176     virtual void FillHistogram( RadiusType radius, RegionType region );
00177         
00178    private:
00179     void NormalizeHistogram( void );
00180   
00181     ImageConstPointer        m_Input;
00182     HistogramPointer         m_Output;
00183     OffsetVectorConstPointer m_Offsets;
00184     PixelType                m_Min, m_Max;
00185 
00186     unsigned int            m_NumberOfBinsPerAxis;
00187     MeasurementVectorType   m_LowerBound, m_UpperBound;
00188     bool                    m_Normalize;
00189 
00190   };
00191     
00192     
00193   } // end of namespace Statistics 
00194 } // end of namespace itk 
00195 
00196 #ifndef ITK_MANUAL_INSTANTIATION
00197 #include "itkScalarImageToGreyLevelCooccurrenceMatrixGenerator.txx"
00198 #endif
00199 
00200 #endif
00201 

Generated at Sat Feb 28 13:28:58 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000