Medical Imaging Interaction Toolkit  2025.12.02
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 * https://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  {
102  template< typename THistogram >
103  class EnhancedHistogramToTextureFeaturesFilter:public ProcessObject
104  {
105  public:
108  typedef ProcessObject Superclass;
111 
113  itkTypeMacro(EnhancedHistogramToTextureFeaturesFilter, ProcessObject);
114 
116  itkNewMacro(Self);
117 
118  typedef THistogram HistogramType;
119  typedef typename HistogramType::Pointer HistogramPointer;
120  typedef typename HistogramType::ConstPointer HistogramConstPointer;
121  typedef typename HistogramType::MeasurementType MeasurementType;
122  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
123  typedef typename HistogramType::IndexType IndexType;
124  typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType;
125  typedef typename HistogramType::RelativeFrequencyType RelativeFrequencyType;
126 
127  typedef typename HistogramType::TotalAbsoluteFrequencyType
129 
130  typedef typename HistogramType::TotalRelativeFrequencyType
132 
134  typedef std::vector< RelativeFrequencyType > RelativeFrequencyContainerType;
135 
137  using Superclass::SetInput;
138  void SetInput(const HistogramType *histogram);
139 
140  const HistogramType * GetInput() const;
141 
143  typedef DataObject::Pointer DataObjectPointer;
144 
146  typedef SimpleDataObjectDecorator< MeasurementType > MeasurementObjectType;
147 
150 
152 
155 
157 
160 
162 
165 
167 
170 
172 
175 
177 
180 
182 
185 
187 
208 
210  typedef enum {
241 
244 
245  protected:
248  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
249 
251  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
252  using Superclass::MakeOutput;
254 
255  void GenerateData() ITK_OVERRIDE;
256 
257  private:
258  EnhancedHistogramToTextureFeaturesFilter(const Self &); //purposely not implemented
259  void operator=(const Self &); //purposely not implemented
260 
261  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
262  double & marginalDevSquared, double & pixelVariance);
263 
264  RelativeFrequencyContainerType m_RelativeFrequencyContainer;
265  };
266  } // end of namespace Statistics
267 } // end of namespace itk
268 
269 #ifndef ITK_MANUAL_INSTANTIATION
270 #include "itkEnhancedHistogramToTextureFeaturesFilter.hxx"
271 #endif
272 
273 #endif
This class computes texture feature coefficients from a grey level co-occurrence matrix.
const MeasurementObjectType * GetInertiaOutput() const
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
const MeasurementObjectType * GetEnergyOutput() const
const MeasurementObjectType * GetClusterProminenceOutput() const
const MeasurementObjectType * GetClusterShadeOutput() const
MeasurementType GetFeature(TextureFeatureName name)
void SetInput(const HistogramType *histogram)
const MeasurementObjectType * GetEntropyOutput() const
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
const MeasurementObjectType * GetInverseDifferenceMomentOutput() const
const MeasurementObjectType * GetHaralickCorrelationOutput() const
const MeasurementObjectType * GetCorrelationOutput() const
#define itkMacroGLCMFeatureGetter(name)