Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
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;
124  typedef typename HistogramType::Pointer HistogramPointer;
125  typedef typename HistogramType::ConstPointer HistogramConstPointer;
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 
148  typedef DataObject::Pointer DataObjectPointer;
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 
213 
215  typedef enum {
246 
248  MeasurementType GetFeature(TextureFeatureName name);
249 
250  protected:
253  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
254 
256  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
257  using Superclass::MakeOutput;
258  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
259 
260  void GenerateData() ITK_OVERRIDE;
261 
262  private:
263  EnhancedHistogramToTextureFeaturesFilter(const Self &); //purposely not implemented
264  void operator=(const Self &); //purposely not implemented
265 
266  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
267  double & marginalDevSquared, double & pixelVariance);
268 
269  RelativeFrequencyContainerType m_RelativeFrequencyContainer;
270  };
271  } // end of namespace Statistics
272 } // end of namespace itk
273 
274 #ifndef ITK_MANUAL_INSTANTIATION
275 #include "itkEnhancedHistogramToTextureFeaturesFilter.hxx"
276 #endif
277 
278 #endif
void SetInput(const HistogramType *histogram)
const MeasurementObjectType * GetClusterShadeOutput() const
const MeasurementObjectType * GetInverseDifferenceMomentOutput() const
This class computes texture feature coefficients from a grey level co-occurrence matrix.
const MeasurementObjectType * GetHaralickCorrelationOutput() const
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
const MeasurementObjectType * GetCorrelationOutput() const
const MeasurementObjectType * GetEnergyOutput() const
const MeasurementObjectType * GetEntropyOutput() const
const MeasurementObjectType * GetInertiaOutput() const
const MeasurementObjectType * GetClusterProminenceOutput() const
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
MeasurementType GetFeature(TextureFeatureName name)
#define itkMacroGLCMFeatureGetter(name)