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  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkListSampleCArray_h
16 #define __itkListSampleCArray_h
17 
18 #include "itkObjectFactory.h"
19 //#include "itkListSampleBase.h"
20 #include "itkSample.h"
21 
22 namespace itk{
23 namespace Statistics
24 {
25 
40  template < class TMeasurementVector, class TInternalValue = typename TMeasurementVector::ValueType >
42  : public Sample< TMeasurementVector >
43  {
44  public:
45 
48  typedef Sample< TMeasurementVector > Superclass;
49  typedef SmartPointer< Self > Pointer;
50  typedef SmartPointer< const Self > ConstPointer;
51 
53  itkNewMacro( Self );
54 
56  itkTypeMacro( ListSampleCArray, Sample );
57 
59  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
60  typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
61  typedef typename Superclass::MeasurementType MeasurementType;
62  typedef typename Superclass::AbsoluteFrequencyType AbsoluteFrequencyType;
63  typedef typename Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType;
64  typedef typename Superclass::InstanceIdentifier InstanceIdentifier;
65 
67  typedef TInternalValue InternalValueType;
70 
72  itkGetConstMacro( InternalContainer, InternalDataContainerType );
73 
75  void Resize( unsigned long n );
76 
78  void SetActualSize( unsigned long n );
79 
81  unsigned long GetActualSize( void );
82 
84  void Clear( void );
85 
87  virtual InstanceIdentifier Size( void ) const
88  {
89  return this->m_InternalContainerSize;
90  }
91 
99  InstanceIdentifier id ) const;
100 
103  MeasurementVectorType & mv ) const;
104 
107  unsigned int dim, const MeasurementType &value );
108 
111  const MeasurementVectorType &mv );
112 
115 
118  {
119  return static_cast<TotalAbsoluteFrequencyType>( this->m_InternalContainerSize );
120  }
121 
122  protected:
123 
125  virtual ~ListSampleCArray();
126  void PrintSelf( std::ostream& os, Indent indent ) const;
127 
128  private:
129 
130  ListSampleCArray( const Self& ); // purposely not implemented
131  void operator=( const Self& ); // purposely not implemented
132 
137 
140 
142  void AllocateInternalContainer( unsigned long size, unsigned int dim );
143 
145  void DeallocateInternalContainer( void );
146 
147  }; // end class ListSampleCArray
148 
149 
150 } // end namespace Statistics
151 } // end namespace itk
152 
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 #include "itkListSampleCArray.txx"
156 #endif
157 
158 
159 #endif // end #ifndef __itkListSampleCArray_h
void Resize(unsigned long n)
MeasurementVectorType m_TemporaryMeasurementVector
SmartPointer< const Self > ConstPointer
Sample< TMeasurementVector > Superclass
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
unsigned long GetActualSize(void)
Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
void SetMeasurement(InstanceIdentifier id, unsigned int dim, const MeasurementType &value)
void SetMeasurementVector(InstanceIdentifier id, const MeasurementVectorType &mv)
void SetActualSize(unsigned long n)
InternalDataType * InternalDataContainerType
virtual InstanceIdentifier Size(void) const
Superclass::MeasurementVectorType MeasurementVectorType
InternalDataContainerType m_InternalContainer
A ListSampleBase that internally uses a CArray, which can be accessed.
virtual TotalAbsoluteFrequencyType GetTotalFrequency(void) const
virtual AbsoluteFrequencyType GetFrequency(InstanceIdentifier id) const
Superclass::InstanceIdentifier InstanceIdentifier
void AllocateInternalContainer(unsigned long size, unsigned int dim)
virtual const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier id) const
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::AbsoluteFrequencyType AbsoluteFrequencyType
Superclass::MeasurementType MeasurementType


Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo