go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkListSampleCArray.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 itkListSampleCArray_h
19#define itkListSampleCArray_h
20
21#include "itkObjectFactory.h"
22//#include "itkListSampleBase.h"
23#include "itkSample.h"
24
25namespace itk
26{
27namespace Statistics
28{
29
44template <class TMeasurementVector, class TInternalValue = typename TMeasurementVector::ValueType>
45class ITK_TEMPLATE_EXPORT ListSampleCArray : public Sample<TMeasurementVector>
46{
47public:
49
52 using Superclass = Sample<TMeasurementVector>;
53 using Pointer = SmartPointer<Self>;
54 using ConstPointer = SmartPointer<const Self>;
55
57 itkNewMacro(Self);
58
60 itkTypeMacro(ListSampleCArray, Sample);
61
63 using typename Superclass::MeasurementVectorType;
64 using typename Superclass::MeasurementVectorSizeType;
65 using typename Superclass::MeasurementType;
66 using typename Superclass::AbsoluteFrequencyType;
67 using typename Superclass::TotalAbsoluteFrequencyType;
68 using typename Superclass::InstanceIdentifier;
69
71 using InternalValueType = TInternalValue;
74
76 itkGetConstMacro(InternalContainer, InternalDataContainerType);
77
79 void
80 Resize(unsigned long n);
81
83 void
84 SetActualSize(unsigned long n);
85
87 unsigned long
89
91 void
93
95 InstanceIdentifier
96 Size() const override
97 {
98 return this->m_InternalContainerSize;
99 }
100
101
108 const MeasurementVectorType &
109 GetMeasurementVector(InstanceIdentifier id) const override;
110
112 void
113 GetMeasurementVector(InstanceIdentifier id, MeasurementVectorType & mv) const;
114
116 void
117 SetMeasurement(InstanceIdentifier id, unsigned int dim, const MeasurementType & value);
118
120 void
121 SetMeasurementVector(InstanceIdentifier id, const MeasurementVectorType & mv);
122
124 AbsoluteFrequencyType
125 GetFrequency(InstanceIdentifier id) const override;
126
128 TotalAbsoluteFrequencyType
129 GetTotalFrequency() const override
130 {
131 return static_cast<TotalAbsoluteFrequencyType>(this->m_InternalContainerSize);
132 }
133
134
135protected:
138 void
139 PrintSelf(std::ostream & os, Indent indent) const override;
140
141private:
144 InstanceIdentifier m_InternalContainerSize;
145 InstanceIdentifier m_ActualSize;
146
148 mutable MeasurementVectorType m_TemporaryMeasurementVector;
149
151 void
152 AllocateInternalContainer(unsigned long size, unsigned int dim);
153
155 void
157};
158
159} // end namespace Statistics
160} // end namespace itk
161
162#ifndef ITK_MANUAL_INSTANTIATION
163# include "itkListSampleCArray.hxx"
164#endif
165
166#endif // end #ifndef itkListSampleCArray_h
A ListSampleBase that internally uses a CArray, which can be accessed.
void AllocateInternalContainer(unsigned long size, unsigned int dim)
void SetMeasurementVector(InstanceIdentifier id, const MeasurementVectorType &mv)
const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier id) const override
void Resize(unsigned long n)
Sample< TMeasurementVector > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
AbsoluteFrequencyType GetFrequency(InstanceIdentifier id) const override
void SetMeasurement(InstanceIdentifier id, unsigned int dim, const MeasurementType &value)
InternalDataType * InternalDataContainerType
MeasurementVectorType m_TemporaryMeasurementVector
TotalAbsoluteFrequencyType GetTotalFrequency() const override
SmartPointer< const Self > ConstPointer
void SetActualSize(unsigned long n)
ITK_DISALLOW_COPY_AND_MOVE(ListSampleCArray)
InstanceIdentifier Size() const override
InternalDataContainerType m_InternalContainer
void GetMeasurementVector(InstanceIdentifier id, MeasurementVectorType &mv) const


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo