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 #ifndef __itkListSampleCArray_h
15 #define __itkListSampleCArray_h
16 
17 #include "itkObjectFactory.h"
18 //#include "itkListSampleBase.h"
19 #include "itkSample.h"
20 
21 namespace itk
22 {
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;
68  typedef InternalValueType * InternalDataType;
69  typedef InternalDataType * InternalDataContainerType;
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 
92 
99  virtual const MeasurementVectorType & GetMeasurementVector(
100  InstanceIdentifier id ) const;
101 
103  void GetMeasurementVector( InstanceIdentifier id,
104  MeasurementVectorType & mv ) const;
105 
107  void SetMeasurement( InstanceIdentifier id,
108  unsigned int dim, const MeasurementType & value );
109 
111  void SetMeasurementVector( InstanceIdentifier id,
112  const MeasurementVectorType & mv );
113 
115  virtual AbsoluteFrequencyType GetFrequency( InstanceIdentifier id ) const;
116 
118  virtual TotalAbsoluteFrequencyType GetTotalFrequency( void ) const
119  {
120  return static_cast< TotalAbsoluteFrequencyType >( this->m_InternalContainerSize );
121  }
122 
123 
124 protected:
125 
127  virtual ~ListSampleCArray();
128  void PrintSelf( std::ostream & os, Indent indent ) const;
129 
130 private:
131 
132  ListSampleCArray( const Self & ); // purposely not implemented
133  void operator=( const Self & ); // purposely not implemented
134 
136  InternalDataContainerType m_InternalContainer;
137  InstanceIdentifier m_InternalContainerSize;
138  InstanceIdentifier m_ActualSize;
139 
141  mutable MeasurementVectorType m_TemporaryMeasurementVector;
142 
144  void AllocateInternalContainer( unsigned long size, unsigned int dim );
145 
147  void DeallocateInternalContainer( void );
148 
149 };
150 
151 } // end namespace Statistics
152 } // end namespace itk
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 #include "itkListSampleCArray.hxx"
156 #endif
157 
158 #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 12-09-2014 for elastix by doxygen 1.8.8 elastix logo