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

itkSpatialObjectToImageStatisticsCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSpatialObjectToImageStatisticsCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/05/27 21:01:28 $
00007   Version:   $Revision: 1.6 $
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 __itkSpatialObjectToImageStatisticsCalculator_h
00018 #define __itkSpatialObjectToImageStatisticsCalculator_h
00019 
00020 #include "itkObject.h"
00021 #include "itkObjectFactory.h"
00022 #include "itkFloodFilledSpatialFunctionConditionalConstIterator.h"
00023 #include "itkMatrix.h"
00024 #include "itkNumericTraits.h"
00025 
00026 namespace itk
00027 {
00028 
00033 template <class TInputImage, class TInputSpatialObject, unsigned int TSampleDimension=1>            
00034 class ITK_EXPORT SpatialObjectToImageStatisticsCalculator : public Object 
00035 {
00036 public:
00038   typedef SpatialObjectToImageStatisticsCalculator Self;
00039   typedef Object  Superclass;
00040   typedef SmartPointer<Self>   Pointer;
00041   typedef SmartPointer<const Self>  ConstPointer;
00042 
00044   itkNewMacro(Self);
00045 
00047   itkTypeMacro(SpatialObjectToImageStatisticsCalculator, Object);
00048 
00050   typedef TInputImage  ImageType;
00051   typedef typename TInputImage::Pointer  ImagePointer;
00052   typedef typename TInputImage::ConstPointer ImageConstPointer;
00053   typedef typename TInputImage::PixelType PixelType;
00054   typedef typename TInputImage::IndexType IndexType;
00055   typedef  typename NumericTraits< PixelType >::AccumulateType AccumulateType;
00056 
00057   itkStaticConstMacro(ImageDimension, unsigned int,
00058                       ImageType::ImageDimension);
00059   
00060   itkStaticConstMacro(SampleDimension, unsigned int,
00061                       TSampleDimension);
00062 
00063   itkStaticConstMacro(ObjectDimension, unsigned int,
00064                       TInputSpatialObject::ObjectDimension);
00065 
00066 
00068   typedef TInputSpatialObject SpatialObjectType;  
00069   typedef typename SpatialObjectType::Pointer  SpatialObjectPointer;
00070   typedef typename SpatialObjectType::ConstPointer SpatialObjectConstPointer;
00071 
00073   typedef itk::FloodFilledSpatialFunctionConditionalConstIterator<ImageType,
00074                                                  SpatialObjectType> IteratorType;
00075  
00077   typedef Vector< double, TSampleDimension> VectorType;
00078   typedef Matrix< double, TSampleDimension, TSampleDimension > MatrixType ;
00079 
00081   itkSetMacro(SampleDirection,unsigned int);
00082   itkGetMacro(SampleDirection,unsigned int);
00083 
00085   itkSetConstObjectMacro(Image,ImageType);
00086 
00088   itkSetObjectMacro(SpatialObject,SpatialObjectType);
00089 
00091   const VectorType & GetMean() const {return m_Mean;}
00092 
00094   const MatrixType & GetCovarianceMatrix() const {return m_CovarianceMatrix;}
00095 
00097   AccumulateType GetSum() const {return m_Sum;}
00098 
00100   itkGetConstMacro(NumberOfPixels,unsigned long);
00101 
00103   void Update(void);
00104 
00105 protected:
00106   SpatialObjectToImageStatisticsCalculator();
00107   virtual ~SpatialObjectToImageStatisticsCalculator() {};
00108   void PrintSelf(std::ostream& os, Indent indent) const;
00109 
00110 private:
00111   SpatialObjectToImageStatisticsCalculator(const Self&); //purposely not implemented
00112   void operator=(const Self&); //purposely not implemented
00113   
00114   ImageConstPointer          m_Image;
00115   SpatialObjectPointer       m_SpatialObject;
00116   VectorType                 m_Mean;
00117   AccumulateType             m_Sum;
00118   unsigned long              m_NumberOfPixels;
00119   MatrixType                 m_CovarianceMatrix;
00120   unsigned int               m_SampleDirection;
00121   unsigned long              m_InternalImageTime;
00122   unsigned long              m_InternalSpatialObjectTime;
00123   TimeStamp                  m_ModifiedTime;
00124 };
00125 
00126 } // end namespace itk
00127 
00128 
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkSpatialObjectToImageStatisticsCalculator.txx"
00131 #endif
00132 
00133 #endif /* __itkSpatialObjectToImageStatisticsCalculator_h */

Generated at Thu May 25 00:06:04 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000