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);
00156
00158 itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00159 itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00161
00164 itkSetConstObjectMacro(Offsets, OffsetVector);
00165 itkGetConstObjectMacro(Offsets, OffsetVector);
00167
00170 void SetNumberOfBinsPerAxis( unsigned int );
00171
00174 void SetPixelValueMinMax( PixelType min, PixelType max );
00176
00179 void SetImageMask(const ImageType * );
00180
00183 void SetInsidePixelValue(PixelType InsidePixelValue);
00184
00185 itkGetMacro(FastCalculations, bool);
00186 itkSetMacro(FastCalculations, bool);
00187 itkBooleanMacro(FastCalculations);
00188
00189 protected:
00190 ScalarImageTextureCalculator();
00191 virtual ~ScalarImageTextureCalculator() {};
00192 void PrintSelf(std::ostream& os, Indent indent) const;
00193 void FastCompute();
00194 void FullCompute();
00195
00196 private:
00197 typename GLCMGeneratorType::Pointer m_GLCMGenerator;
00198 FeatureValueVectorPointer m_FeatureMeans;
00199 FeatureValueVectorPointer m_FeatureStandardDeviations;
00200 FeatureNameVectorConstPointer m_RequestedFeatures;
00201 OffsetVectorConstPointer m_Offsets;
00202 bool m_FastCalculations;
00203 };
00204
00205 }
00206 }
00207
00208 #ifndef ITK_MANUAL_INSTANTIATION
00209 #include "itkScalarImageTextureCalculator.txx"
00210 #endif
00211
00212 #endif
00213