ITK  5.4.0
Insight Toolkit
itkHistogramToRunLengthFeaturesFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkHistogramToRunLengthFeaturesFilter_h
19 #define itkHistogramToRunLengthFeaturesFilter_h
20 
21 #include "itkHistogram.h"
22 #include "itkMacro.h"
23 #include "itkProcessObject.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
35 {
36 public:
42  enum class RunLengthFeature : uint8_t
43  {
54  };
55 };
56 // Helps for backwards compatibility
58 // Define how to print enumeration
59 extern ITKStatistics_EXPORT std::ostream &
61 
99 template <typename THistogram>
100 class ITK_TEMPLATE_EXPORT HistogramToRunLengthFeaturesFilter : public ProcessObject
101 {
102 public:
103  ITK_DISALLOW_COPY_AND_MOVE(HistogramToRunLengthFeaturesFilter);
104 
110 
112  itkOverrideGetNameOfClassMacro(HistogramToRunLengthFeaturesFilter);
113 
115  itkNewMacro(Self);
116 
117  using HistogramType = THistogram;
120  using MeasurementType = typename HistogramType::MeasurementType;
121  using MeasurementVectorType = typename HistogramType::MeasurementVectorType;
123  using FrequencyType = typename HistogramType::TotalAbsoluteFrequencyType;
124 
126  using Superclass::SetInput;
127  void
128  SetInput(const HistogramType * histogram);
129  const HistogramType *
130  GetInput() const;
135 
138 
141  GetShortRunEmphasis() const;
142  const MeasurementObjectType *
143  GetShortRunEmphasisOutput() const;
148  GetLongRunEmphasis() const;
149  const MeasurementObjectType *
150  GetLongRunEmphasisOutput() const;
155  GetGreyLevelNonuniformity() const;
156  const MeasurementObjectType *
157  GetGreyLevelNonuniformityOutput() const;
162  GetRunLengthNonuniformity() const;
163  const MeasurementObjectType *
164  GetRunLengthNonuniformityOutput() const;
169  GetLowGreyLevelRunEmphasis() const;
170  const MeasurementObjectType *
171  GetLowGreyLevelRunEmphasisOutput() const;
176  GetHighGreyLevelRunEmphasis() const;
177  const MeasurementObjectType *
178  GetHighGreyLevelRunEmphasisOutput() const;
183  GetShortRunLowGreyLevelEmphasis() const;
184  const MeasurementObjectType *
185  GetShortRunLowGreyLevelEmphasisOutput() const;
190  GetShortRunHighGreyLevelEmphasis() const;
191  const MeasurementObjectType *
192  GetShortRunHighGreyLevelEmphasisOutput() const;
197  GetLongRunLowGreyLevelEmphasis() const;
198  const MeasurementObjectType *
199  GetLongRunLowGreyLevelEmphasisOutput() const;
204  GetLongRunHighGreyLevelEmphasis() const;
205  const MeasurementObjectType *
206  GetLongRunHighGreyLevelEmphasisOutput() const;
209  itkGetMacro(TotalNumberOfRuns, unsigned long);
210 
211 #if !defined(ITK_LEGACY_REMOVE)
212 
213  static constexpr RunLengthFeatureEnum ShortRunEmphasis = RunLengthFeatureEnum::ShortRunEmphasis;
214  static constexpr RunLengthFeatureEnum LongRunEmphasis = RunLengthFeatureEnum::LongRunEmphasis;
215  static constexpr RunLengthFeatureEnum GreyLevelNonuniformity = RunLengthFeatureEnum::GreyLevelNonuniformity;
216  static constexpr RunLengthFeatureEnum RunLengthNonuniformity = RunLengthFeatureEnum::RunLengthNonuniformity;
217  static constexpr RunLengthFeatureEnum LowGreyLevelRunEmphasis = RunLengthFeatureEnum::LowGreyLevelRunEmphasis;
218  static constexpr RunLengthFeatureEnum HighGreyLevelRunEmphasis = RunLengthFeatureEnum::HighGreyLevelRunEmphasis;
219  static constexpr RunLengthFeatureEnum ShortRunLowGreyLevelEmphasis =
221  static constexpr RunLengthFeatureEnum ShortRunHighGreyLevelEmphasis =
223  static constexpr RunLengthFeatureEnum LongRunLowGreyLevelEmphasis = RunLengthFeatureEnum::LongRunLowGreyLevelEmphasis;
224  static constexpr RunLengthFeatureEnum LongRunHighGreyLevelEmphasis =
226 #endif
227 
230  GetFeature(RunLengthFeatureEnum feature);
231 
232 protected:
234  ~HistogramToRunLengthFeaturesFilter() override = default;
235  void
236  PrintSelf(std::ostream & os, Indent indent) const override;
237 
240  using Superclass::MakeOutput;
242 
243  void
244  GenerateData() override;
245 
246 private:
247  unsigned long m_TotalNumberOfRuns{};
248 };
249 
250 } // end of namespace Statistics
251 } // end of namespace itk
252 
253 #ifndef ITK_MANUAL_INSTANTIATION
254 # include "itkHistogramToRunLengthFeaturesFilter.hxx"
255 #endif
256 
257 #endif
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunLowGreyLevelEmphasis
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::SimpleDataObjectDecorator
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Definition: itkSimpleDataObjectDecorator.h:66
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunHighGreyLevelEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::RunLengthNonuniformity
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramType
THistogram HistogramType
Definition: itkHistogramToRunLengthFeaturesFilter.h:117
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramPointer
typename HistogramType::Pointer HistogramPointer
Definition: itkHistogramToRunLengthFeaturesFilter.h:118
itk::Statistics::HistogramToRunLengthFeaturesFilter::MeasurementVectorType
typename HistogramType::MeasurementVectorType MeasurementVectorType
Definition: itkHistogramToRunLengthFeaturesFilter.h:121
itk::Statistics::HistogramToRunLengthFeaturesFilter
This class computes texture feature coefficients from a grey level run-length matrix.
Definition: itkHistogramToRunLengthFeaturesFilter.h:100
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::Statistics::operator<<
ITKStatistics_EXPORT std::ostream & operator<<(std::ostream &out, const ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE value)
itk::Statistics::HistogramToRunLengthFeaturesFilter::IndexType
typename HistogramType::IndexType IndexType
Definition: itkHistogramToRunLengthFeaturesFilter.h:122
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunEmphasis
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkHistogram.h
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunLowGreyLevelEmphasis
itkMacro.h
itkProcessObject.h
itk::Statistics::HistogramToRunLengthFeaturesFilter::FrequencyType
typename HistogramType::TotalAbsoluteFrequencyType FrequencyType
Definition: itkHistogramToRunLengthFeaturesFilter.h:123
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::HighGreyLevelRunEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature
RunLengthFeature
Definition: itkHistogramToRunLengthFeaturesFilter.h:42
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramConstPointer
typename HistogramType::ConstPointer HistogramConstPointer
Definition: itkHistogramToRunLengthFeaturesFilter.h:119
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Statistics::HistogramToRunLengthFeaturesFilter::MeasurementType
typename HistogramType::MeasurementType MeasurementType
Definition: itkHistogramToRunLengthFeaturesFilter.h:120
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunHighGreyLevelEmphasis
itkSimpleDataObjectDecorator.h
RunLengthFeature
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums
Contains all enum classes used by HistogramToRunLengthFeaturesFilter class.
Definition: itkHistogramToRunLengthFeaturesFilter.h:34
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LowGreyLevelRunEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::GreyLevelNonuniformity