ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Numerics
Statistics
include
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
"
25
#include "
itkMeasurementVectorTraits.h
"
26
27
namespace
itk
28
{
29
namespace
Statistics
30
{
40
class
ITK_EXPORT
SparseFrequencyContainer2
:
public
Object
41
{
42
public
:
44
typedef
SparseFrequencyContainer2
Self
;
45
typedef
Object
Superclass
;
46
typedef
SmartPointer< Self >
Pointer
;
47
typedef
SmartPointer< const Self >
ConstPointer
;
48
50
itkTypeMacro(
SparseFrequencyContainer2
,
Object
);
51
itkNewMacro(
Self
);
53
55
typedef
MeasurementVectorTraits::InstanceIdentifier
InstanceIdentifier
;
56
58
typedef
MeasurementVectorTraits::AbsoluteFrequencyType
AbsoluteFrequencyType
;
59
61
typedef
MeasurementVectorTraits::TotalAbsoluteFrequencyType
TotalAbsoluteFrequencyType
;
62
64
typedef
MeasurementVectorTraits::RelativeFrequencyType
RelativeFrequencyType
;
65
67
typedef
MeasurementVectorTraits::TotalRelativeFrequencyType
TotalRelativeFrequencyType
;
68
70
typedef
std::map< InstanceIdentifier, AbsoluteFrequencyType >
FrequencyContainerType
;
71
typedef
FrequencyContainerType::const_iterator
72
FrequencyContainerConstIterator
;
73
75
void
Initialize(
SizeValueType
length);
76
79
void
SetToZero();
80
83
bool
SetFrequency(
const
InstanceIdentifier
id
,
const
AbsoluteFrequencyType
value);
84
87
bool
IncreaseFrequency(
const
InstanceIdentifier
id
,
88
const
AbsoluteFrequencyType
value);
89
92
AbsoluteFrequencyType
GetFrequency(
const
InstanceIdentifier
id
)
const
;
93
94
TotalAbsoluteFrequencyType
GetTotalFrequency()
95
{
96
return
m_TotalFrequency;
97
}
98
99
protected
:
100
SparseFrequencyContainer2
();
101
virtual
~SparseFrequencyContainer2
() {}
102
void
PrintSelf(std::ostream & os,
Indent
indent)
const
;
103
104
private
:
105
SparseFrequencyContainer2
(
const
Self &);
//purposely not implemented
106
void
operator=(
const
Self &);
//purposely not implemented
107
108
// Container of histogram
109
FrequencyContainerType
m_FrequencyContainer
;
110
TotalAbsoluteFrequencyType
m_TotalFrequency
;
111
};
// end of class
112
}
// end of namespace Statistics
113
}
// end of namespace itk
114
115
#endif
116
Generated on Mon May 13 2013 01:08:53 for ITK by
1.8.3.1