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 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
00091 void SetListSample(
const TListSample*
list)
00092 { m_List = list ; }
00093
00094 void SetMarginalScale(
float scale)
00095 { m_MarginalScale = scale ; }
00096
00097 void SetNumberOfBins(
HistogramSizeType sizes)
00098 { m_Sizes = sizes ; }
00099
00100 const HistogramType* GetOutput()
const
00101
{
return m_Histogram ; }
00102
00103 void Update()
00104 { this->
GenerateData() ; }
00105
00106
protected:
00107 ListSampleToHistogramGenerator() ;
00108 virtual ~ListSampleToHistogramGenerator() {}
00109
void GenerateData() ;
00110
00111
private:
00112
const TListSample* m_List ;
00113
typename HistogramType::Pointer m_Histogram ;
00114 HistogramSizeType m_Sizes ;
00115
float m_MarginalScale ;
00116
00117 } ;
00118
00119 }
00120 }
00121
00122
#ifndef ITK_MANUAL_INSTANTIATION
00123
#include "itkListSampleToHistogramGenerator.txx"
00124
#endif
00125
00126
#endif