00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDenseFrequencyContainer_h
00018 #define __itkDenseFrequencyContainer_h
00019
00020 #include <map>
00021 #include "itkObjectFactory.h"
00022 #include "itkObject.h"
00023 #include "itkValarrayImageContainer.h"
00024
00025 namespace itk{
00026 namespace Statistics{
00027
00039 template< class TFrequencyValue = float >
00040 class ITK_EXPORT DenseFrequencyContainer
00041 : public Object
00042 {
00043 public:
00045 typedef DenseFrequencyContainer Self;
00046 typedef Object Superclass;
00047 typedef SmartPointer<Self> Pointer;
00048 typedef SmartPointer<const Self> ConstPointer;
00049
00051 itkTypeMacro(DenseFrequencyContainer, Object);
00052
00054 itkNewMacro(Self);
00055
00057 typedef unsigned long InstanceIdentifier ;
00058
00060 typedef TFrequencyValue FrequencyType ;
00061
00063 typedef ValarrayImageContainer< InstanceIdentifier, FrequencyType >
00064 FrequencyContainerType ;
00065 typedef typename FrequencyContainerType::Pointer FrequencyContainerPointer ;
00066
00069 void Initialize(unsigned long length) ;
00070
00073 void SetToZero() ;
00074
00077 bool SetFrequency(const InstanceIdentifier id, const FrequencyType value) ;
00078
00082 bool IncreaseFrequency(const InstanceIdentifier id,
00083 const FrequencyType value);
00084
00087 FrequencyType GetFrequency(const InstanceIdentifier id) const ;
00088
00090 FrequencyType GetTotalFrequency()
00091 { return m_TotalFrequency ; }
00092
00093 protected:
00094 DenseFrequencyContainer() ;
00095 virtual ~DenseFrequencyContainer() {}
00096 void PrintSelf(std::ostream& os, Indent indent) const;
00097
00098 private:
00099 DenseFrequencyContainer(const Self&) ;
00100 void operator=(const Self&) ;
00101
00103 FrequencyContainerPointer m_FrequencyContainer ;
00104 FrequencyType m_TotalFrequency ;
00105 } ;
00106
00107 }
00108 }
00109
00110 #ifndef ITK_MANUAL_INSTANTIATIONy
00111 #include "itkDenseFrequencyContainer.txx"
00112 #endif
00113
00114 #endif
00115
00116
00117