⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itkdensefrequencycontainer.h

📁 InsightToolkit-1.4.0(有大量的优化算法程序)
💻 H
字号:
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkDenseFrequencyContainer.h,v $
  Language:  C++
  Date:      $Date: 2003/09/10 14:29:44 $
  Version:   $Revision: 1.7 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __itkDenseFrequencyContainer_h
#define __itkDenseFrequencyContainer_h

#include <map>
#include "itkObjectFactory.h"
#include "itkObject.h"
#include "itkValarrayImageContainer.h"

namespace itk{ 
namespace Statistics{

/** \class DenseFrequencyContainer 
 *  \brief his class is a container for frequencies of bins in an histogram.
 *
 * This class uses the ValarrayImageContainer class to store
 * frequencies. If the histogram has many zero frequency bins. 
 * use SparseFrequencyContainer.  You should access each bin 
 * by (InstanceIdentifier)index or measurement vector.
 *
 * \sa Histogram, SparseFrequencyContainer
 */
    
template< class TFrequencyValue = float >
class ITK_EXPORT DenseFrequencyContainer 
  : public Object
{
public:
  /** Standard class typedefs */
  typedef DenseFrequencyContainer  Self;
  typedef Object Superclass;
  typedef SmartPointer<Self>   Pointer;

  /** Run-time type information (and related methods). */
  itkTypeMacro(DenseFrequencyContainer, Object);

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** InstanceIdenfitifer type alias */
  typedef unsigned long InstanceIdentifier ;

  /** Frequency type alias */
  typedef TFrequencyValue FrequencyType ;

  /** Internal storage class typedefs */
  typedef ValarrayImageContainer< InstanceIdentifier, FrequencyType > 
  FrequencyContainerType ;
  typedef typename FrequencyContainerType::Pointer FrequencyContainerPointer ;

  /** Calls the Initialize method of superclass to generate the offset table
   * and prepare the frequency container */
  void Initialize(unsigned long length) ;

  /** Sets the frequency of histogram using instance identifier */
  void SetFrequency(const InstanceIdentifier id, const FrequencyType value) ;

  /** Increases the frequency of a bin specified by the
   * InstanceIdentifier by one.  This function is convinient
   * to create histogram. */
  void IncreaseFrequency(const InstanceIdentifier id, 
                         const FrequencyType value);

  /** Method to get the frequency of a bin from the histogram */
  FrequencyType GetFrequency(const InstanceIdentifier id) const ;

  /** Gets the sum of the frequencies */
  FrequencyType GetTotalFrequency()
  { return m_TotalFrequency ; }

protected:
  DenseFrequencyContainer() ;
  virtual ~DenseFrequencyContainer() {}
  void PrintSelf(std::ostream& os, Indent indent) const;

private:
  DenseFrequencyContainer(const Self&) ; //purposely not implemented
  void operator=(const Self&) ; //purposely not implemented

  /** Internal storage */
  FrequencyContainerPointer m_FrequencyContainer ;
  FrequencyType  m_TotalFrequency ;
} ; // end of class

} // end of namespace Statistics
} // end of namespace itk

#ifndef ITK_MANUAL_INSTANTIATIONy
#include "itkDenseFrequencyContainer.txx"
#endif

#endif



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -