00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMeanCalculator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/09/21 08:07:14 $ 00007 Version: $Revision: 1.8 $ 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 00018 #ifndef __itkMeanCalculator_h 00019 #define __itkMeanCalculator_h 00020 00021 #include "itkSampleAlgorithmBase.h" 00022 00023 #include "itkVector.h" 00024 00025 namespace itk{ 00026 namespace Statistics{ 00027 00040 template< class TSample > 00041 class MeanCalculator : 00042 public SampleAlgorithmBase< TSample > 00043 { 00044 public: 00046 typedef MeanCalculator Self; 00047 typedef Object Superclass ; 00048 typedef SmartPointer<Self> Pointer; 00049 00051 itkTypeMacro(MeanCalculator, Object); 00052 itkNewMacro(Self) ; 00053 00054 itkStaticConstMacro(MeasurementVectorSize, unsigned int, 00055 TSample::MeasurementVectorSize); 00056 00058 typedef Vector< double, 00059 itkGetStaticConstMacro(MeasurementVectorSize) > OutputType ; 00060 00062 OutputType* GetOutput() ; 00063 00064 protected: 00065 MeanCalculator() ; 00066 virtual ~MeanCalculator() {} 00067 void PrintSelf(std::ostream& os, Indent indent) const; 00068 00070 void GenerateData() ; 00071 00072 private: 00074 OutputType m_Output ; 00075 } ; // end of class 00076 00077 } // end of namespace Statistics 00078 } // end of namespace itk 00079 00080 #ifndef ITK_MANUAL_INSTANTIATION 00081 #include "itkMeanCalculator.txx" 00082 #endif 00083 00084 #endif 00085