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

itkListSampleToHistogramGenerator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkListSampleToHistogramGenerator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:29:46 $
00007   Version:   $Revision: 1.5 $
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 __itkListSampleToHistogramGenerator_h
00018 #define __itkListSampleToHistogramGenerator_h
00019 
00020 #include "itkObject.h"
00021 #include "itkListSampleBase.h"
00022 #include "itkHistogram.h"
00023 #include "itkStatisticsAlgorithm.h"
00024 #include "itkDenseFrequencyContainer.h"
00025 
00026 namespace itk{
00027 namespace Statistics{
00028 
00061 template< class TListSample, 
00062           class THistogramMeasurement,  
00063           class TFrequencyContainer = DenseFrequencyContainer< float > >
00064 class ITK_EXPORT ListSampleToHistogramGenerator :
00065     public Object
00066 {
00067 public:
00069   typedef ListSampleToHistogramGenerator Self;
00070   typedef Object Superclass;
00071   typedef SmartPointer<Self>   Pointer;
00072   
00074   itkTypeMacro(ListSampleToHistogramGenerator, Object) ;
00075   
00077   itkNewMacro(Self) ;
00078 
00080   itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00081                       TListSample::MeasurementVectorSize);
00082 
00083   typedef Histogram< THistogramMeasurement, 
00084                      itkGetStaticConstMacro(MeasurementVectorSize),
00085                      TFrequencyContainer > HistogramType ;
00086 
00087   typedef typename HistogramType::SizeType HistogramSizeType ;
00088 
00090   void SetListSample(TListSample* list)
00091   { m_List = list ; }
00092 
00093   void SetMarginalScale(float scale)
00094   { m_MarginalScale = scale ; }
00095 
00096   void SetNumberOfBins(HistogramSizeType sizes)
00097   { m_Sizes = sizes ; }
00098 
00099   HistogramType* GetOutput()
00100   { return m_Histogram ; }
00101 
00102   void Update() 
00103   { this->GenerateData() ; }
00104 
00105 protected:
00106   ListSampleToHistogramGenerator() ;
00107   virtual ~ListSampleToHistogramGenerator() {}
00108   void GenerateData() ;
00109 
00110 private:
00111   TListSample* m_List ;
00112   typename HistogramType::Pointer m_Histogram ;
00113   HistogramSizeType m_Sizes ;
00114   float m_MarginalScale ;
00115 
00116 } ; // end of class
00117 
00118 } // end of namespace Statistics 
00119 } // end of namespace itk 
00120 
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkListSampleToHistogramGenerator.txx"
00123 #endif
00124 
00125 #endif

Generated at Tue Sep 16 11:32:03 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000