00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 } ;
00117
00118 }
00119 }
00120
00121
#ifndef ITK_MANUAL_INSTANTIATION
00122
#include "itkListSampleToHistogramGenerator.txx"
00123
#endif
00124
00125
#endif