00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSampleToHistogramProjectionFilter_h
00018 #define __itkSampleToHistogramProjectionFilter_h
00019
00020 #include "itkMacro.h"
00021 #include "itkObject.h"
00022 #include "itkSample.h"
00023 #include "itkSubsample.h"
00024 #include "itkHistogram.h"
00025 #include "itkFunctionBase.h"
00026 #include "itkSampleAlgorithmBase.h"
00027 #include "itkArray.h"
00028
00029 namespace itk{
00030 namespace Statistics{
00031
00053 template < class TInputSample, class THistogramMeasurement >
00054 class ITK_EXPORT SampleToHistogramProjectionFilter :
00055 public SampleAlgorithmBase< TInputSample >
00056 {
00057 public:
00059 typedef SampleToHistogramProjectionFilter Self;
00060 typedef SampleAlgorithmBase< TInputSample > Superclass ;
00061 typedef SmartPointer< Self > Pointer ;
00062 typedef const SmartPointer< Self > ConstPointer ;
00063
00065 itkTypeMacro(SampleToHistogramProjectionFilter, SampleAlgorithmBase);
00066
00068 itkNewMacro(Self) ;
00069
00070
00072 typedef typename TInputSample::MeasurementVectorType MeasurementVectorType ;
00073 typedef typename TInputSample::MeasurementType MeasurementType ;
00074 typedef typename TInputSample::FrequencyType FrequencyType ;
00075 typedef typename TInputSample::InstanceIdentifier InstanceIdentifier ;
00076
00078 typedef typename Superclass::InputSampleType InputSampleType ;
00079 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
00080
00082 typedef Array< double > ArrayType;
00083
00085 typedef Array< double > MeanType;
00086
00088 typedef Histogram< THistogramMeasurement, 1 > HistogramType ;
00089
00091 virtual void SetHistogram(HistogramType* histogram) ;
00092
00094 void SetMean(MeanType* center) ;
00095
00097 MeanType* GetMean() ;
00098
00100 void SetStandardDeviation(double* value) ;
00101
00103 double* GetStandardDeviation() ;
00104
00106 void SetProjectionAxis(ArrayType* axis) ;
00107
00109 ArrayType* GetProjectionAxis() ;
00110
00114 void SetHistogramBinOverlap(double overlap) ;
00115
00116 protected:
00117 SampleToHistogramProjectionFilter() ;
00118 virtual ~SampleToHistogramProjectionFilter() {}
00119 void PrintSelf(std::ostream& os, Indent indent) const ;
00120
00123 float CalculateOverlap(int binIndex,
00124 float dotProduct,
00125 float scale,
00126 float marginalDistance,
00127 bool firstHalf) ;
00129 void GenerateData() ;
00130
00131 private:
00132 SampleToHistogramProjectionFilter(const Self&) ;
00133 void operator=(const Self&) ;
00134
00135 bool m_HistogramUseEquiProbableBins ;
00136 double m_HistogramBinOverlap ;
00137
00138 MeanType* m_Mean ;
00139 ArrayType* m_ProjectionAxis ;
00140 double* m_StandardDeviation ;
00141 HistogramType* m_Histogram ;
00142 FrequencyType m_MinimumFrequency ;
00143 } ;
00144
00145 }
00146 }
00147
00148 #ifndef ITK_MANUAL_INSTANTIATION
00149 #include "itkSampleToHistogramProjectionFilter.txx"
00150 #endif
00151
00152 #endif