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: 2004/11/04 20:40:42 $
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 __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   typedef SmartPointer<const Self> ConstPointer;
00073   
00075   itkTypeMacro(ListSampleToHistogramGenerator, Object) ;
00076   
00078   itkNewMacro(Self) ;
00079 
00081   itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00082                       TListSample::MeasurementVectorSize);
00083 
00084   typedef Histogram< THistogramMeasurement, 
00085                      itkGetStaticConstMacro(MeasurementVectorSize),
00086                      TFrequencyContainer > HistogramType ;
00087 
00088   typedef typename HistogramType::SizeType HistogramSizeType ;
00089   typedef typename HistogramType::MeasurementVectorType  MeasurementVectorType;
00090 
00092   void SetListSample(const TListSample* list)
00093   { m_List = list ; }
00094 
00095   void SetMarginalScale(float scale)
00096   { m_MarginalScale = scale ; }
00097 
00098   void SetNumberOfBins(HistogramSizeType sizes)
00099   { m_Sizes = sizes ; }
00100 
00101   const HistogramType* GetOutput() const
00102   { return m_Histogram ; }
00103 
00104   void Update() 
00105   { this->GenerateData() ; }
00106 
00107   itkSetMacro(AutoMinMax,bool);
00108   itkGetConstReferenceMacro(AutoMinMax,bool);
00109 
00110   void SetHistogramMin(const MeasurementVectorType & histogramMin)
00111     {
00112     m_HistogramMin = histogramMin;
00113     m_AutoMinMax = false;
00114     }
00115 
00116   void SetHistogramMax(const MeasurementVectorType & histogramMax)
00117     {
00118     m_HistogramMax = histogramMax;
00119     m_AutoMinMax = false;
00120     }
00121 
00122 
00123 protected:
00124   ListSampleToHistogramGenerator() ;
00125   virtual ~ListSampleToHistogramGenerator() {}
00126   void GenerateData() ;
00127   void PrintSelf(std::ostream& os, Indent indent) const;
00128 
00129 private:
00130   const TListSample* m_List ;
00131   typename HistogramType::Pointer m_Histogram ;
00132   HistogramSizeType m_Sizes ;
00133   float m_MarginalScale ;
00134   MeasurementVectorType m_HistogramMin;
00135   MeasurementVectorType m_HistogramMax;
00136   bool m_AutoMinMax;
00137 
00138 } ; // end of class
00139 
00140 } // end of namespace Statistics 
00141 } // end of namespace itk 
00142 
00143 #ifndef ITK_MANUAL_INSTANTIATION
00144 #include "itkListSampleToHistogramGenerator.txx"
00145 #endif
00146 
00147 #endif

Generated at Wed Mar 30 00:02:39 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000