00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 }
00201 }
00202
00203 #ifndef ITK_MANUAL_INSTANTIATION
00204 #include "itkScalarImageTextureCalculator.txx"
00205 #endif
00206
00207 #endif