Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkSparseFrequencyContainer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSparseFrequencyContainer.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/08/24 15:16:59 $
00007   Version:   $Revision: 1.10 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkSparseFrequencyContainer_h
00018 #define __itkSparseFrequencyContainer_h
00019 
00020 #include <map>
00021 #include "itkObjectFactory.h"
00022 #include "itkObject.h"
00023 
00024 namespace itk{ 
00025   namespace Statistics{
00026 
00035 class ITK_EXPORT SparseFrequencyContainer : public Object
00036 {
00037 public:
00039   typedef SparseFrequencyContainer  Self;
00040   typedef Object Superclass;
00041   typedef SmartPointer<Self>   Pointer;
00042   typedef SmartPointer<const Self> ConstPointer;
00043 
00045   itkTypeMacro(SparseFrequencyContainer, Object);
00046   itkNewMacro(Self);
00047 
00049   typedef unsigned long InstanceIdentifier ;
00050 
00052   typedef float FrequencyType ;
00053 
00055   typedef std::map< InstanceIdentifier, FrequencyType > FrequencyContainerType ;  
00056   typedef FrequencyContainerType::const_iterator 
00057           FrequencyContainerConstIterator ;   
00058 
00060   void Initialize(unsigned long length) ;
00061 
00064   void SetToZero() ;
00065 
00068   bool SetFrequency(const InstanceIdentifier id, const FrequencyType value) ;
00069 
00072   bool IncreaseFrequency(const InstanceIdentifier id, 
00073                          const FrequencyType value);
00074 
00077   FrequencyType GetFrequency(const InstanceIdentifier id) const ;
00078 
00079   FrequencyType GetTotalFrequency()
00080   { return m_TotalFrequency ; }
00081 
00082 protected:
00083   SparseFrequencyContainer() ;
00084   virtual ~SparseFrequencyContainer() {}
00085   void PrintSelf(std::ostream& os, Indent indent) const;
00086 
00087 private:
00088   SparseFrequencyContainer(const Self&) ; //purposely not implemented
00089   void operator=(const Self&) ; //purposely not implemented
00090 
00091   // Container of histogram
00092   FrequencyContainerType m_FrequencyContainer ;
00093   FrequencyType  m_TotalFrequency ;
00094 } ; // end of class
00095 
00096   } // end of namespace Statistics
00097 } // end of namespace itk
00098 
00099 #endif

Generated at Tue Aug 30 16:46:24 2005 for ITK by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2000