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
26namespace itk
27{
28namespace Statistics
29{
35{
36public:
42 enum class RunLengthFeature : uint8_t
43 {
44 ShortRunEmphasis,
45 LongRunEmphasis,
46 GreyLevelNonuniformity,
47 RunLengthNonuniformity,
48 LowGreyLevelRunEmphasis,
49 HighGreyLevelRunEmphasis,
50 ShortRunLowGreyLevelEmphasis,
51 ShortRunHighGreyLevelEmphasis,
52 LongRunLowGreyLevelEmphasis,
53 LongRunHighGreyLevelEmphasis
54 };
55};
56// Helps for backwards compatibility
58// Define how to print enumeration
59extern ITKStatistics_EXPORT std::ostream &
61
99template <typename THistogram>
100class ITK_TEMPLATE_EXPORT HistogramToRunLengthFeaturesFilter : public ProcessObject
101{
102public:
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
209 itkGetMacro(TotalNumberOfRuns, unsigned long);
210
211#if !defined(ITK_LEGACY_REMOVE)
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
231
232protected:
235 void
236 PrintSelf(std::ostream & os, Indent indent) const override;
237
240 using Superclass::MakeOutput;
242
243 void
244 GenerateData() override;
245
246private:
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
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