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: 2002/09/21 20:26:42 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) 2002 Insight 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 "itkVector.h"
00028 
00029 namespace itk{ 
00030 namespace Statistics{
00031 
00046 template < class TInputSample, class THistogramMeasurement >
00047 class ITK_EXPORT SampleToHistogramProjectionFilter : 
00048     public SampleAlgorithmBase< TInputSample >
00049 {
00050 public:
00052   typedef SampleToHistogramProjectionFilter  Self;
00053   typedef SampleAlgorithmBase< TInputSample > Superclass ;
00054   typedef SmartPointer< Self > Pointer ;
00055   typedef const SmartPointer< Self > ConstPointer ;
00056 
00058   itkTypeMacro(SampleToHistogramProjectionFilter, SampleAlgorithmBase);
00059 
00061   itkNewMacro(Self) ;
00062 
00064   itkStaticConstMacro(MeasurementVectorSize, unsigned int, 
00065                       TInputSample::MeasurementVectorSize) ;
00066   typedef typename TInputSample::MeasurementVectorType MeasurementVectorType ;
00067   typedef typename TInputSample::MeasurementType MeasurementType ;
00068   typedef typename TInputSample::FrequencyType FrequencyType ;
00069   typedef typename TInputSample::InstanceIdentifier InstanceIdentifier ;
00070 
00072   typedef typename Superclass::InputSampleType InputSampleType ;
00073 
00075   typedef FixedArray< double, 
00076                       itkGetStaticConstMacro(MeasurementVectorSize) > ArrayType ;
00077 
00079   typedef Vector< double, 
00080                   itkGetStaticConstMacro(MeasurementVectorSize) > MeanType ;
00081 
00083   typedef Histogram< THistogramMeasurement, 1 > HistogramType ;
00084 
00086   virtual void SetHistogram(HistogramType* histogram) ;
00087 
00089   void SetMean(MeanType* center) ;
00090   
00092   MeanType* GetMean() ;
00093 
00095   void SetStandardDeviation(double* value) ;
00096 
00098   double* GetStandardDeviation() ;
00099 
00101   void SetProjectionAxis(ArrayType* axis) ;
00102 
00104   ArrayType* GetProjectionAxis() ;
00105 
00109   void SetHistogramBinOverlap(double overlap) ;
00110 
00111 protected:
00112   SampleToHistogramProjectionFilter() ;
00113   virtual ~SampleToHistogramProjectionFilter() {}
00114   void PrintSelf(std::ostream& os, Indent indent) const ;
00115 
00118   float CalculateOverlap(int binIndex,
00119                          float dotProduct, 
00120                          float scale,
00121                          float marginalDistance,
00122                          bool firstHalf) ;
00124   void GenerateData() ;
00125 
00126 private:
00127   SampleToHistogramProjectionFilter(const Self&) ; //purposely not implemented
00128   void operator=(const Self&) ; //purposely not implemented
00129 
00130   bool m_HistogramUseEquiProbableBins ;
00131   double m_HistogramBinOverlap ;
00132   double m_OrthoMargin ;
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 Fri May 21 01:15:17 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000