Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkEnhancedHistogramToTextureFeaturesFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef __itkEnhancedHistogramToTextureFeaturesFilter_h
19 #define __itkEnhancedHistogramToTextureFeaturesFilter_h
20 
21 #include "itkHistogram.h"
22 #include "itkMacro.h"
23 #include "itkProcessObject.h"
24 #include "itkSimpleDataObjectDecorator.h"
25 
27 #define itkMacroGLCMFeatureGetter(name) \
28  const MeasurementObjectType * Get##name##Output() const; \
29  \
30  MeasurementType Get##name() const;
31 
32 namespace itk
33 {
34  namespace Statistics
35  {
107  template< typename THistogram >
108  class EnhancedHistogramToTextureFeaturesFilter:public ProcessObject
109  {
110  public:
113  typedef ProcessObject Superclass;
116 
118  itkTypeMacro(EnhancedHistogramToTextureFeaturesFilter, ProcessObject);
119 
121  itkNewMacro(Self);
122 
123  typedef THistogram HistogramType;
126  typedef typename HistogramType::MeasurementType MeasurementType;
127  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
128  typedef typename HistogramType::IndexType IndexType;
129  typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType;
130  typedef typename HistogramType::RelativeFrequencyType RelativeFrequencyType;
131 
132  typedef typename HistogramType::TotalAbsoluteFrequencyType
134 
135  typedef typename HistogramType::TotalRelativeFrequencyType
137 
139  typedef std::vector< RelativeFrequencyType > RelativeFrequencyContainerType;
140 
142  using Superclass::SetInput;
143  void SetInput(const HistogramType *histogram);
144 
145  const HistogramType * GetInput() const;
146 
149 
151  typedef SimpleDataObjectDecorator< MeasurementType > MeasurementObjectType;
152 
154  MeasurementType GetEnergy() const;
155 
156  const MeasurementObjectType * GetEnergyOutput() const;
157 
159  MeasurementType GetEntropy() const;
160 
161  const MeasurementObjectType * GetEntropyOutput() const;
162 
164  MeasurementType GetCorrelation() const;
165 
166  const MeasurementObjectType * GetCorrelationOutput() const;
167 
169  MeasurementType GetInverseDifferenceMoment() const;
170 
171  const MeasurementObjectType * GetInverseDifferenceMomentOutput() const;
172 
174  MeasurementType GetInertia() const;
175 
176  const MeasurementObjectType * GetInertiaOutput() const;
177 
179  MeasurementType GetClusterShade() const;
180 
181  const MeasurementObjectType * GetClusterShadeOutput() const;
182 
184  MeasurementType GetClusterProminence() const;
185 
186  const MeasurementObjectType * GetClusterProminenceOutput() const;
187 
189  MeasurementType GetHaralickCorrelation() const;
190 
191  const MeasurementObjectType * GetHaralickCorrelationOutput() const;
192 
210 
212  typedef enum {
240 
242  MeasurementType GetFeature(TextureFeatureName name);
243 
244  protected:
247  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
248 
250  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
251  using Superclass::MakeOutput;
252  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
253 
254  virtual void GenerateData() ITK_OVERRIDE;
255 
256  private:
257  EnhancedHistogramToTextureFeaturesFilter(const Self &); //purposely not implemented
258  void operator=(const Self &); //purposely not implemented
259 
260  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
261  double & marginalDevSquared, double & pixelVariance);
262 
263  RelativeFrequencyContainerType m_RelativeFrequencyContainer;
264  };
265  } // end of namespace Statistics
266 } // end of namespace itk
267 
268 #ifndef ITK_MANUAL_INSTANTIATION
269 #include "itkEnhancedHistogramToTextureFeaturesFilter.hxx"
270 #endif
271 
272 #endif
void SetInput(const HistogramType *histogram)
const MeasurementObjectType * GetClusterProminenceOutput() const
itk::SmartPointer< Self > Pointer
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
itk::SmartPointer< const Self > ConstPointer
This class computes texture feature coefficients from a grey level co-occurrence matrix.
const MeasurementObjectType * GetClusterShadeOutput() const
const MeasurementObjectType * GetHaralickCorrelationOutput() const
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
const MeasurementObjectType * GetInertiaOutput() const
const MeasurementObjectType * GetEnergyOutput() const
const MeasurementObjectType * GetInverseDifferenceMomentOutput() const
const MeasurementObjectType * GetCorrelationOutput() const
MeasurementType GetFeature(TextureFeatureName name)
#define itkMacroGLCMFeatureGetter(name)
const MeasurementObjectType * GetEntropyOutput() const