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

itkSampleToHistogramProjectionFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSampleToHistogramProjectionFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:29:48 $
00007   Version:   $Revision: 1.4 $
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 __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 "itkFixedArray.h"
00025 #include "itkHistogram.h"
00026 #include "itkFunctionBase.h"
00027 #include "itkSampleAlgorithmBase.h"
00028 #include "itkVector.h"
00029 
00030 namespace itk{ 
00031 namespace Statistics{
00032 
00047 template < class TInputSample, class THistogramMeasurement >
00048 class ITK_EXPORT SampleToHistogramProjectionFilter : 
00049     public SampleAlgorithmBase< TInputSample >
00050 {
00051 public:
00053   typedef SampleToHistogramProjectionFilter  Self;
00054   typedef SampleAlgorithmBase< TInputSample > Superclass ;
00055   typedef SmartPointer< Self > Pointer ;
00056   typedef const SmartPointer< Self > ConstPointer ;
00057 
00059   itkTypeMacro(SampleToHistogramProjectionFilter, SampleAlgorithmBase);
00060 
00062   itkNewMacro(Self) ;
00063 
00065   itkStaticConstMacro(MeasurementVectorSize, unsigned int, 
00066                       TInputSample::MeasurementVectorSize) ;
00067   typedef typename TInputSample::MeasurementVectorType MeasurementVectorType ;
00068   typedef typename TInputSample::MeasurementType MeasurementType ;
00069   typedef typename TInputSample::FrequencyType FrequencyType ;
00070   typedef typename TInputSample::InstanceIdentifier InstanceIdentifier ;
00071 
00073   typedef typename Superclass::InputSampleType InputSampleType ;
00074 
00076   typedef FixedArray< double, 
00077                       itkGetStaticConstMacro(MeasurementVectorSize) > ArrayType ;
00078 
00080   typedef Vector< double, 
00081                   itkGetStaticConstMacro(MeasurementVectorSize) > MeanType ;
00082 
00084   typedef Histogram< THistogramMeasurement, 1 > HistogramType ;
00085 
00087   virtual void SetHistogram(HistogramType* histogram) ;
00088 
00090   void SetMean(MeanType* center) ;
00091   
00093   MeanType* GetMean() ;
00094 
00096   void SetStandardDeviation(double* value) ;
00097 
00099   double* GetStandardDeviation() ;
00100 
00102   void SetProjectionAxis(ArrayType* axis) ;
00103 
00105   ArrayType* GetProjectionAxis() ;
00106 
00110   void SetHistogramBinOverlap(double overlap) ;
00111 
00112 protected:
00113   SampleToHistogramProjectionFilter() ;
00114   virtual ~SampleToHistogramProjectionFilter() {}
00115   void PrintSelf(std::ostream& os, Indent indent) const ;
00116 
00119   float CalculateOverlap(int binIndex,
00120                          float dotProduct, 
00121                          float scale,
00122                          float marginalDistance,
00123                          bool firstHalf) ;
00125   void GenerateData() ;
00126 
00127 private:
00128   SampleToHistogramProjectionFilter(const Self&) ; //purposely not implemented
00129   void operator=(const Self&) ; //purposely not implemented
00130 
00131   bool m_HistogramUseEquiProbableBins ;
00132   double m_HistogramBinOverlap ;
00133 
00134   MeanType* m_Mean ;
00135   ArrayType* m_ProjectionAxis ;
00136   double* m_StandardDeviation ;
00137   HistogramType* m_Histogram ;
00138   FrequencyType m_MinimumFrequency ;
00139 } ; // end of class
00140 
00141 } // end of namespace Statistics 
00142 } // end of namespace itk
00143 
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkSampleToHistogramProjectionFilter.txx"
00146 #endif
00147 
00148 #endif

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