ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSparseFrequencyContainer2.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
28 namespace itk
29 {
30 namespace Statistics
31 {
41 class ITKStatistics_EXPORT SparseFrequencyContainer2:public Object
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_ASSIGN(SparseFrequencyContainer2);
45 
48  using Superclass = Object;
51 
53  itkTypeMacro(SparseFrequencyContainer2, Object);
54  itkNewMacro(Self);
56 
59 
62 
65 
68 
71 
73  using FrequencyContainerType = std::map< InstanceIdentifier, AbsoluteFrequencyType >;
74  using FrequencyContainerConstIterator = FrequencyContainerType::const_iterator;
75 
77  void Initialize(SizeValueType length);
78 
81  void SetToZero();
82 
85  bool SetFrequency(const InstanceIdentifier id, const AbsoluteFrequencyType value);
86 
89  bool IncreaseFrequency(const InstanceIdentifier id,
90  const AbsoluteFrequencyType value);
91 
94  AbsoluteFrequencyType GetFrequency(const InstanceIdentifier id) const;
95 
97  {
98  return m_TotalFrequency;
99  }
100 
101 protected:
103  ~SparseFrequencyContainer2() override = default;
104  void PrintSelf(std::ostream & os, Indent indent) const override;
105 
106 private:
107  // Container of histogram
110 }; // end of class
111 } // end of namespace Statistics
112 } // end of namespace itk
113 
114 #endif
his class is a container for an histogram.
Light weight base class for most itk classes.
unsigned long SizeValueType
Definition: itkIntTypes.h:83
MeasurementVectorTraits::AbsoluteFrequencyType AbsoluteFrequencyType
std::map< InstanceIdentifier, AbsoluteFrequencyType > FrequencyContainerType
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
NumericTraits< AbsoluteFrequencyType >::RealType RelativeFrequencyType
MeasurementVectorTraits::InstanceIdentifier InstanceIdentifier
FrequencyContainerType::const_iterator FrequencyContainerConstIterator
MeasurementVectorTraits::TotalRelativeFrequencyType TotalRelativeFrequencyType
MeasurementVectorTraits::RelativeFrequencyType RelativeFrequencyType
MeasurementVectorTraits::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
NumericTraits< RelativeFrequencyType >::AccumulateType TotalRelativeFrequencyType