itkScalarImageToTextureFeaturesFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkScalarImageToTextureFeaturesFilter_h
00018 #define __itkScalarImageToTextureFeaturesFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkProcessObject.h"
00022 #include "itkVectorContainer.h"
00023 #include "itkMacro.h"
00024 #include "itkDataObjectDecorator.h"
00025
00026 #include "itkHistogramToTextureFeaturesFilter.h"
00027 #include "itkScalarImageToCooccurrenceMatrixFilter.h"
00028 #include "itkDenseFrequencyContainer2.h"
00029
00030 namespace itk {
00031 namespace Statistics {
00032
00107 template< class TImageType,
00108 class THistogramFrequencyContainer = DenseFrequencyContainer2 >
00109 class ITK_EXPORT ScalarImageToTextureFeaturesFilter : public ProcessObject
00110 {
00111 public:
00113 typedef ScalarImageToTextureFeaturesFilter Self;
00114 typedef ProcessObject Superclass;
00115 typedef SmartPointer<Self> Pointer;
00116 typedef SmartPointer<const Self> ConstPointer;
00117
00119 itkTypeMacro(ScalarImageToTextureFeaturesFilter, ProcessObject);
00120
00122 itkNewMacro(Self);
00123
00124 typedef THistogramFrequencyContainer FrequencyContainerType;
00125 typedef TImageType ImageType;
00126 typedef typename ImageType::Pointer ImagePointer;
00127
00128 typedef typename ImageType::PixelType PixelType;
00129 typedef typename ImageType::OffsetType OffsetType;
00130 typedef VectorContainer<unsigned char, OffsetType> OffsetVector;
00131 typedef typename OffsetVector::Pointer OffsetVectorPointer;
00132 typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer;
00133
00134 typedef ScalarImageToCooccurrenceMatrixFilter<
00135 ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType;
00136
00137 typedef typename CooccurrenceMatrixFilterType::HistogramType
00138 HistogramType;
00139
00140 typedef HistogramToTextureFeaturesFilter< HistogramType >
00141 TextureFeaturesFilterType;
00142
00143 typedef typename TextureFeaturesFilterType::TextureFeatureName TextureFeatureName;
00144 typedef VectorContainer<unsigned char, TextureFeatureName> FeatureNameVector;
00145
00146 typedef typename FeatureNameVector::Pointer FeatureNameVectorPointer;
00147 typedef typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer;
00148 typedef VectorContainer<unsigned char, double> FeatureValueVector;
00149 typedef typename FeatureValueVector::Pointer FeatureValueVectorPointer;
00150
00152 typedef DataObject::Pointer DataObjectPointer;
00153
00155 typedef DataObjectDecorator<FeatureValueVector>
00156 FeatureValueVectorDataObjectType;
00157
00158 const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const;
00159 const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const;
00160
00162 void SetInput( const ImageType * );
00163 const ImageType* GetInput() const;
00165
00167 itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
00168 itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
00170
00172 itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00173 itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
00175
00178 itkSetConstObjectMacro(Offsets, OffsetVector);
00179 itkGetConstObjectMacro(Offsets, OffsetVector);
00181
00184 void SetNumberOfBinsPerAxis( unsigned int );
00185
00188 void SetPixelValueMinMax( PixelType min, PixelType max );
00190
00193 void SetMaskImage(const ImageType * );
00194 const ImageType* GetMaskImage() const;
00196
00199 void SetInsidePixelValue(PixelType InsidePixelValue);
00200
00201 itkGetConstMacro(FastCalculations, bool);
00202 itkSetMacro(FastCalculations, bool);
00203 itkBooleanMacro(FastCalculations);
00204
00205 protected:
00206 ScalarImageToTextureFeaturesFilter();
00207 virtual ~ScalarImageToTextureFeaturesFilter() {};
00208 void PrintSelf(std::ostream& os, Indent indent) const;
00209
00210 void FastCompute();
00211 void FullCompute();
00212
00214 virtual void GenerateData();
00215
00217 virtual DataObjectPointer MakeOutput( unsigned int );
00218
00219 private:
00220 typename CooccurrenceMatrixFilterType::Pointer m_GLCMGenerator;
00221
00222 FeatureValueVectorPointer m_FeatureMeans;
00223 FeatureValueVectorPointer m_FeatureStandardDeviations;
00224 FeatureNameVectorConstPointer m_RequestedFeatures;
00225 OffsetVectorConstPointer m_Offsets;
00226 bool m_FastCalculations;
00227 };
00228
00229 }
00230 }
00231
00232 #ifndef ITK_MANUAL_INSTANTIATION
00233 #include "itkScalarImageToTextureFeaturesFilter.txx"
00234 #endif
00235
00236 #endif
00237