ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkHistogramToTextureFeaturesFilter.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 itkHistogramToTextureFeaturesFilter_h
19 #define itkHistogramToTextureFeaturesFilter_h
20 
21 #include "itkHistogram.h"
22 #include "itkMacro.h"
23 #include "itkProcessObject.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
101 template< typename THistogram >
102 class ITK_TEMPLATE_EXPORT HistogramToTextureFeaturesFilter:public ProcessObject
103 {
104 public:
105  ITK_DISALLOW_COPY_AND_ASSIGN(HistogramToTextureFeaturesFilter);
106 
112 
115 
117  itkNewMacro(Self);
118 
119  using HistogramType = THistogram;
120  using HistogramPointer = typename HistogramType::Pointer;
121  using HistogramConstPointer = typename HistogramType::ConstPointer;
122  using MeasurementType = typename HistogramType::MeasurementType;
123  using MeasurementVectorType = typename HistogramType::MeasurementVectorType;
125  using AbsoluteFrequencyType = typename HistogramType::AbsoluteFrequencyType;
126  using RelativeFrequencyType = typename HistogramType::RelativeFrequencyType;
127 
128  using TotalAbsoluteFrequencyType = typename HistogramType::TotalAbsoluteFrequencyType;
129 
130  using TotalRelativeFrequencyType = typename HistogramType::TotalRelativeFrequencyType;
131 
133  using RelativeFrequencyContainerType = std::vector< RelativeFrequencyType >;
134 
136  using Superclass::SetInput;
137  void SetInput(const HistogramType *histogram);
138 
139  const HistogramType * GetInput() const;
140 
143 
146 
148  MeasurementType GetEnergy() const;
149 
150  const MeasurementObjectType * GetEnergyOutput() const;
151 
153  MeasurementType GetEntropy() const;
154 
155  const MeasurementObjectType * GetEntropyOutput() const;
156 
158  MeasurementType GetCorrelation() const;
159 
160  const MeasurementObjectType * GetCorrelationOutput() const;
161 
163  MeasurementType GetInverseDifferenceMoment() const;
164 
165  const MeasurementObjectType * GetInverseDifferenceMomentOutput() const;
166 
168  MeasurementType GetInertia() const;
169 
170  const MeasurementObjectType * GetInertiaOutput() const;
171 
173  MeasurementType GetClusterShade() const;
174 
175  const MeasurementObjectType * GetClusterShadeOutput() const;
176 
178  MeasurementType GetClusterProminence() const;
179 
180  const MeasurementObjectType * GetClusterProminenceOutput() const;
181 
183  MeasurementType GetHaralickCorrelation() const;
184 
185  const MeasurementObjectType * GetHaralickCorrelationOutput() const;
186 
188  typedef enum {
197  InvalidFeatureName
198  } TextureFeatureName;
199 
201  MeasurementType GetFeature(TextureFeatureName name);
202 
203 protected:
205  ~HistogramToTextureFeaturesFilter() override = default;
206  void PrintSelf(std::ostream & os, Indent indent) const override;
207 
210  using Superclass::MakeOutput;
212 
213  void GenerateData() override;
214 
215 private:
216  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
217  double & marginalDevSquared, double & pixelVariance);
218 
220 };
221 } // end of namespace Statistics
222 } // end of namespace itk
223 
224 #ifndef ITK_MANUAL_INSTANTIATION
225 #include "itkHistogramToTextureFeaturesFilter.hxx"
226 #endif
227 
228 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename HistogramType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
This class computes texture feature coefficients from a grey level co-occurrence matrix.
typename HistogramType::MeasurementVectorType MeasurementVectorType
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
typename HistogramType::TotalRelativeFrequencyType TotalRelativeFrequencyType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< Self > Pointer
typename HistogramType::RelativeFrequencyType RelativeFrequencyType