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
26namespace itk
27{
28namespace Statistics
29{
35{
36public:
41 enum class RunLengthFeature : uint8_t
42 {
43 ShortRunEmphasis,
44 LongRunEmphasis,
45 GreyLevelNonuniformity,
46 RunLengthNonuniformity,
47 LowGreyLevelRunEmphasis,
48 HighGreyLevelRunEmphasis,
49 ShortRunLowGreyLevelEmphasis,
50 ShortRunHighGreyLevelEmphasis,
51 LongRunLowGreyLevelEmphasis,
52 LongRunHighGreyLevelEmphasis
53 };
54};
55// Helps for backwards compatibility
57// Define how to print enumeration
58extern ITKStatistics_EXPORT std::ostream &
60
98template <typename THistogram>
99class ITK_TEMPLATE_EXPORT HistogramToRunLengthFeaturesFilter : public ProcessObject
100{
101public:
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
208 itkGetMacro(TotalNumberOfRuns, unsigned long);
209
210#if !defined(ITK_LEGACY_REMOVE)
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
230
231protected:
234 void
235 PrintSelf(std::ostream & os, Indent indent) const override;
236
239 using Superclass::MakeOutput;
241
242 void
243 GenerateData() override;
244
245private:
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
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Contains all enum classes used by HistogramToRunLengthFeaturesFilter class.
This class computes texture feature coefficients from a grey level run-length matrix.
typename HistogramType::MeasurementVectorType MeasurementVectorType
const MeasurementObjectType * GetLongRunLowGreyLevelEmphasisOutput() const
void SetInput(const HistogramType *histogram)
const MeasurementObjectType * GetShortRunHighGreyLevelEmphasisOutput() const
const MeasurementObjectType * GetShortRunLowGreyLevelEmphasisOutput() const
typename HistogramType::TotalAbsoluteFrequencyType FrequencyType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) override
Make a DataObject of the correct type to used as the specified output.
const MeasurementObjectType * GetGreyLevelNonuniformityOutput() const
const MeasurementObjectType * GetHighGreyLevelRunEmphasisOutput() const
const MeasurementObjectType * GetShortRunEmphasisOutput() const
const MeasurementObjectType * GetRunLengthNonuniformityOutput() const
void PrintSelf(std::ostream &os, Indent indent) const override
const MeasurementObjectType * GetLongRunEmphasisOutput() const
const MeasurementObjectType * GetLowGreyLevelRunEmphasisOutput() const
MeasurementType GetFeature(RunLengthFeatureEnum feature)
const MeasurementObjectType * GetLongRunHighGreyLevelEmphasisOutput() const
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
ITKStatistics_EXPORT std::ostream & operator<<(std::ostream &out, const ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE value)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41