ITK  6.0.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:
41  enum class RunLengthFeature : uint8_t
42  {
53  };
54 };
55 // Helps for backwards compatibility
57 // Define how to print enumeration
58 extern ITKStatistics_EXPORT std::ostream &
60 
98 template <typename THistogram>
99 class ITK_TEMPLATE_EXPORT HistogramToRunLengthFeaturesFilter : public ProcessObject
100 {
101 public:
102  ITK_DISALLOW_COPY_AND_MOVE(HistogramToRunLengthFeaturesFilter);
103 
109 
111  itkOverrideGetNameOfClassMacro(HistogramToRunLengthFeaturesFilter);
112 
114  itkNewMacro(Self);
115 
116  using HistogramType = THistogram;
119  using MeasurementType = typename HistogramType::MeasurementType;
120  using MeasurementVectorType = typename HistogramType::MeasurementVectorType;
122  using FrequencyType = typename HistogramType::TotalAbsoluteFrequencyType;
123 
125  using Superclass::SetInput;
126  void
127  SetInput(const HistogramType * histogram);
128  const HistogramType *
129  GetInput() const;
134 
137 
140  GetShortRunEmphasis() const;
141  const MeasurementObjectType *
142  GetShortRunEmphasisOutput() const;
147  GetLongRunEmphasis() const;
148  const MeasurementObjectType *
149  GetLongRunEmphasisOutput() const;
154  GetGreyLevelNonuniformity() const;
155  const MeasurementObjectType *
156  GetGreyLevelNonuniformityOutput() const;
161  GetRunLengthNonuniformity() const;
162  const MeasurementObjectType *
163  GetRunLengthNonuniformityOutput() const;
168  GetLowGreyLevelRunEmphasis() const;
169  const MeasurementObjectType *
170  GetLowGreyLevelRunEmphasisOutput() const;
175  GetHighGreyLevelRunEmphasis() const;
176  const MeasurementObjectType *
177  GetHighGreyLevelRunEmphasisOutput() const;
182  GetShortRunLowGreyLevelEmphasis() const;
183  const MeasurementObjectType *
184  GetShortRunLowGreyLevelEmphasisOutput() const;
189  GetShortRunHighGreyLevelEmphasis() const;
190  const MeasurementObjectType *
191  GetShortRunHighGreyLevelEmphasisOutput() const;
196  GetLongRunLowGreyLevelEmphasis() const;
197  const MeasurementObjectType *
198  GetLongRunLowGreyLevelEmphasisOutput() const;
203  GetLongRunHighGreyLevelEmphasis() const;
204  const MeasurementObjectType *
205  GetLongRunHighGreyLevelEmphasisOutput() const;
208  itkGetMacro(TotalNumberOfRuns, unsigned long);
209 
210 #if !defined(ITK_LEGACY_REMOVE)
211 
212  static constexpr RunLengthFeatureEnum ShortRunEmphasis = RunLengthFeatureEnum::ShortRunEmphasis;
213  static constexpr RunLengthFeatureEnum LongRunEmphasis = RunLengthFeatureEnum::LongRunEmphasis;
214  static constexpr RunLengthFeatureEnum GreyLevelNonuniformity = RunLengthFeatureEnum::GreyLevelNonuniformity;
215  static constexpr RunLengthFeatureEnum RunLengthNonuniformity = RunLengthFeatureEnum::RunLengthNonuniformity;
216  static constexpr RunLengthFeatureEnum LowGreyLevelRunEmphasis = RunLengthFeatureEnum::LowGreyLevelRunEmphasis;
217  static constexpr RunLengthFeatureEnum HighGreyLevelRunEmphasis = RunLengthFeatureEnum::HighGreyLevelRunEmphasis;
218  static constexpr RunLengthFeatureEnum ShortRunLowGreyLevelEmphasis =
220  static constexpr RunLengthFeatureEnum ShortRunHighGreyLevelEmphasis =
222  static constexpr RunLengthFeatureEnum LongRunLowGreyLevelEmphasis = RunLengthFeatureEnum::LongRunLowGreyLevelEmphasis;
223  static constexpr RunLengthFeatureEnum LongRunHighGreyLevelEmphasis =
225 #endif
226 
229  GetFeature(RunLengthFeatureEnum feature);
230 
231 protected:
233  ~HistogramToRunLengthFeaturesFilter() override = default;
234  void
235  PrintSelf(std::ostream & os, Indent indent) const override;
236 
239  using Superclass::MakeOutput;
241 
242  void
243  GenerateData() override;
244 
245 private:
246  unsigned long m_TotalNumberOfRuns{};
247 };
248 
249 } // end of namespace Statistics
250 } // end of namespace itk
251 
252 #ifndef ITK_MANUAL_INSTANTIATION
253 # include "itkHistogramToRunLengthFeaturesFilter.hxx"
254 #endif
255 
256 #endif
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunHighGreyLevelEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunEmphasis
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::HighGreyLevelRunEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramType
THistogram HistogramType
Definition: itkHistogramToRunLengthFeaturesFilter.h:116
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramPointer
typename HistogramType::Pointer HistogramPointer
Definition: itkHistogramToRunLengthFeaturesFilter.h:117
itk::Statistics::HistogramToRunLengthFeaturesFilter::MeasurementVectorType
typename HistogramType::MeasurementVectorType MeasurementVectorType
Definition: itkHistogramToRunLengthFeaturesFilter.h:120
itk::Statistics::HistogramToRunLengthFeaturesFilter
This class computes texture feature coefficients from a grey level run-length matrix.
Definition: itkHistogramToRunLengthFeaturesFilter.h:99
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunLowGreyLevelEmphasis
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::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunHighGreyLevelEmphasis
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:121
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature
RunLengthFeature
Definition: itkHistogramToRunLengthFeaturesFilter.h:41
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::RunLengthNonuniformity
itkHistogram.h
itkMacro.h
itkProcessObject.h
itk::Statistics::HistogramToRunLengthFeaturesFilter::FrequencyType
typename HistogramType::TotalAbsoluteFrequencyType FrequencyType
Definition: itkHistogramToRunLengthFeaturesFilter.h:122
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LowGreyLevelRunEmphasis
itk::Statistics::HistogramToRunLengthFeaturesFilter::HistogramConstPointer
typename HistogramType::ConstPointer HistogramConstPointer
Definition: itkHistogramToRunLengthFeaturesFilter.h:118
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::GreyLevelNonuniformity
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:119
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::LongRunEmphasis
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::Statistics::HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature::ShortRunLowGreyLevelEmphasis
itkSimpleDataObjectDecorator.h
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