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 
25 namespace itk
26 {
27 namespace Statistics
28 {
29 
44 template< class TMeasurementVector, class TInternalValue = typename TMeasurementVector::ValueType >
46  public Sample< TMeasurementVector >
47 {
48 public:
49 
52  typedef Sample< TMeasurementVector > Superclass;
53  typedef SmartPointer< Self > Pointer;
54  typedef SmartPointer< const Self > ConstPointer;
55 
57  itkNewMacro( Self );
58 
60  itkTypeMacro( ListSampleCArray, Sample );
61 
63  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
64  typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
65  typedef typename Superclass::MeasurementType MeasurementType;
66  typedef typename Superclass::AbsoluteFrequencyType AbsoluteFrequencyType;
67  typedef typename Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType;
68  typedef typename Superclass::InstanceIdentifier InstanceIdentifier;
69 
71  typedef TInternalValue InternalValueType;
74 
76  itkGetConstMacro( InternalContainer, InternalDataContainerType );
77 
79  void Resize( unsigned long n );
80 
82  void SetActualSize( unsigned long n );
83 
85  unsigned long GetActualSize( void );
86 
88  void Clear( void );
89 
91  InstanceIdentifier Size( void ) const override
92  {
93  return this->m_InternalContainerSize;
94  }
95 
96 
103  const MeasurementVectorType & GetMeasurementVector(
104  InstanceIdentifier id ) const override;
105 
108  MeasurementVectorType & mv ) const;
109 
112  unsigned int dim, const MeasurementType & value );
113 
116  const MeasurementVectorType & mv );
117 
120 
123  {
124  return static_cast< TotalAbsoluteFrequencyType >( this->m_InternalContainerSize );
125  }
126 
127 
128 protected:
129 
131  ~ListSampleCArray() override;
132  void PrintSelf( std::ostream & os, Indent indent ) const override;
133 
134 private:
135 
136  ListSampleCArray( const Self & ); // purposely not implemented
137  void operator=( const Self & ); // purposely not implemented
138 
143 
146 
148  void AllocateInternalContainer( unsigned long size, unsigned int dim );
149 
152 
153 };
154 
155 } // end namespace Statistics
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkListSampleCArray.hxx"
160 #endif
161 
162 #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)
void Resize(unsigned long n)
Superclass::InstanceIdentifier InstanceIdentifier
void PrintSelf(std::ostream &os, Indent indent) const override
InternalDataType * InternalDataContainerType
AbsoluteFrequencyType GetFrequency(InstanceIdentifier id) const override
void SetMeasurement(InstanceIdentifier id, unsigned int dim, const MeasurementType &value)
Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
Superclass::MeasurementType MeasurementType
MeasurementVectorType m_TemporaryMeasurementVector
Superclass::AbsoluteFrequencyType AbsoluteFrequencyType
TotalAbsoluteFrequencyType GetTotalFrequency(void) const override
void SetActualSize(unsigned long n)
SmartPointer< const Self > ConstPointer
InstanceIdentifier Size(void) const override
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Superclass::MeasurementVectorType MeasurementVectorType
const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier id) const override
unsigned long GetActualSize(void)
Sample< TMeasurementVector > Superclass
InternalDataContainerType m_InternalContainer
void GetMeasurementVector(InstanceIdentifier id, MeasurementVectorType &mv) const


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.9.1 elastix logo