Medical Imaging Interaction Toolkit  2026.06.00
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  {
101  template< typename THistogram >
102  class EnhancedHistogramToTextureFeaturesFilter:public ProcessObject
103  {
104  public:
107  typedef ProcessObject Superclass;
110 
112  itkTypeMacro(EnhancedHistogramToTextureFeaturesFilter, ProcessObject);
113 
115  itkNewMacro(Self);
116 
117  typedef THistogram HistogramType;
118  typedef typename HistogramType::Pointer HistogramPointer;
119  typedef typename HistogramType::ConstPointer HistogramConstPointer;
120  typedef typename HistogramType::MeasurementType MeasurementType;
121  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
122  typedef typename HistogramType::IndexType IndexType;
123  typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType;
124  typedef typename HistogramType::RelativeFrequencyType RelativeFrequencyType;
125 
126  typedef typename HistogramType::TotalAbsoluteFrequencyType
128 
129  typedef typename HistogramType::TotalRelativeFrequencyType
131 
133  typedef std::vector< RelativeFrequencyType > RelativeFrequencyContainerType;
134 
136  using Superclass::SetInput;
137  void SetInput(const HistogramType *histogram);
138 
139  const HistogramType * GetInput() const;
140 
142  typedef DataObject::Pointer DataObjectPointer;
143 
145  typedef SimpleDataObjectDecorator< MeasurementType > MeasurementObjectType;
146 
149 
151 
154 
156 
159 
161 
164 
166 
169 
171 
174 
176 
179 
181 
184 
186 
207 
209  typedef enum {
240 
243 
244  protected:
247  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
248 
250  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
251  using Superclass::MakeOutput;
253 
254  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.tpp>
270 #endif
271 
272 #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)