ITK  4.8.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:
46  typedef Object Superclass;
49 
51  itkTypeMacro(SparseFrequencyContainer2, Object);
52  itkNewMacro(Self);
54 
57 
60 
63 
66 
69 
71  typedef std::map< InstanceIdentifier, AbsoluteFrequencyType > FrequencyContainerType;
72  typedef FrequencyContainerType::const_iterator
74 
76  void Initialize(SizeValueType length);
77 
80  void SetToZero();
81 
84  bool SetFrequency(const InstanceIdentifier id, const AbsoluteFrequencyType value);
85 
88  bool IncreaseFrequency(const InstanceIdentifier id,
89  const AbsoluteFrequencyType value);
90 
93  AbsoluteFrequencyType GetFrequency(const InstanceIdentifier id) const;
94 
96  {
97  return m_TotalFrequency;
98  }
99 
100 protected:
103  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
104 
105 private:
106  SparseFrequencyContainer2(const Self &); //purposely not implemented
107  void operator=(const Self &); //purposely not implemented
108 
109  // Container of histogram
112 }; // end of class
113 } // end of namespace Statistics
114 } // end of namespace itk
115 
116 #endif
his class is a container for an histogram.
Light weight base class for most itk classes.
NumericTraits< AbsoluteFrequencyType >::RealType RelativeFrequencyType
MeasurementVectorTraits::AbsoluteFrequencyType AbsoluteFrequencyType
NumericTraits< RelativeFrequencyType >::AccumulateType TotalRelativeFrequencyType
MeasurementVectorTraits::RelativeFrequencyType RelativeFrequencyType
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
MeasurementVectorTraits::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
FrequencyContainerType::const_iterator FrequencyContainerConstIterator
MeasurementVectorTraits::InstanceIdentifier InstanceIdentifier
std::map< InstanceIdentifier, AbsoluteFrequencyType > FrequencyContainerType
MeasurementVectorTraits::TotalRelativeFrequencyType TotalRelativeFrequencyType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57