ITK  6.0.0
Insight Toolkit
itkSparseFrequencyContainer2.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 itkSparseFrequencyContainer2_h
19#define itkSparseFrequencyContainer2_h
20
21#include <map>
22#include "itkObjectFactory.h"
23#include "itkObject.h"
24#include "itkNumericTraits.h"
26#include "ITKStatisticsExport.h"
27
28namespace itk
29{
30namespace Statistics
31{
42class ITKStatistics_EXPORT SparseFrequencyContainer2 : public Object
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(SparseFrequencyContainer2);
46
52
54 itkOverrideGetNameOfClassMacro(SparseFrequencyContainer2);
55 itkNewMacro(Self);
60
63
66
69
72
74 using FrequencyContainerType = std::map<InstanceIdentifier, AbsoluteFrequencyType>;
75 using FrequencyContainerConstIterator = FrequencyContainerType::const_iterator;
76
78 void
80
83 void
85
88 bool
90
93 bool
95
100
103 {
104 return m_TotalFrequency;
105 }
106
107protected:
109 ~SparseFrequencyContainer2() override = default;
110 void
111 PrintSelf(std::ostream & os, Indent indent) const override;
112
113private:
114 // Container of histogram
115 FrequencyContainerType m_FrequencyContainer{};
116 TotalAbsoluteFrequencyType m_TotalFrequency{};
117}; // end of class
118} // end of namespace Statistics
119} // end of namespace itk
120
121#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
NumericTraits< RelativeFrequencyType >::AccumulateType TotalRelativeFrequencyType
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
NumericTraits< AbsoluteFrequencyType >::RealType RelativeFrequencyType
his class is a container for an histogram.
bool SetFrequency(const InstanceIdentifier id, const AbsoluteFrequencyType value)
std::map< InstanceIdentifier, AbsoluteFrequencyType > FrequencyContainerType
bool IncreaseFrequency(const InstanceIdentifier id, const AbsoluteFrequencyType value)
void PrintSelf(std::ostream &os, Indent indent) const override
MeasurementVectorTraits::TotalRelativeFrequencyType TotalRelativeFrequencyType
FrequencyContainerType::const_iterator FrequencyContainerConstIterator
MeasurementVectorTraits::AbsoluteFrequencyType AbsoluteFrequencyType
MeasurementVectorTraits::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
void Initialize(SizeValueType length)
TotalAbsoluteFrequencyType GetTotalFrequency() const
MeasurementVectorTraits::RelativeFrequencyType RelativeFrequencyType
AbsoluteFrequencyType GetFrequency(const InstanceIdentifier id) const
MeasurementVectorTraits::InstanceIdentifier InstanceIdentifier
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86