00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkHistogramAlgorithmBase.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/11/26 16:07:36 $ 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 00018 #ifndef __itkHistogramAlgorithmBase_h 00019 #define __itkHistogramAlgorithmBase_h 00020 00021 #include "itkMacro.h" 00022 #include "itkObjectFactory.h" 00023 #include "itkObject.h" 00024 00025 namespace itk 00026 { 00027 00036 template< class TInputHistogram > 00037 class HistogramAlgorithmBase : public Object 00038 { 00039 public: 00041 typedef HistogramAlgorithmBase Self; 00042 typedef Object Superclass ; 00043 typedef SmartPointer< Self > Pointer; 00044 typedef SmartPointer< const Self > ConstPointer; 00045 00047 itkTypeMacro(HistogramAlgorithmBase, Object); 00048 00050 typedef TInputHistogram InputHistogramType ; 00051 00053 void SetInputHistogram( const TInputHistogram * histogram ) 00054 { 00055 if ( m_InputHistogram != histogram ) 00056 { 00057 m_InputHistogram = histogram ; 00058 this->Modified() ; 00059 } 00060 } 00061 00063 const TInputHistogram * GetInputHistogram() const 00064 { return m_InputHistogram.GetPointer() ; } 00065 00069 void Update() 00070 { this->GenerateData() ; } 00071 00072 protected: 00073 HistogramAlgorithmBase() ; 00074 virtual ~HistogramAlgorithmBase() {} 00075 void PrintSelf(std::ostream& os, Indent indent) const; 00076 00077 virtual void GenerateData() = 0; 00078 00079 private: 00081 typename TInputHistogram::ConstPointer m_InputHistogram ; 00082 } ; // end of class 00083 00084 } // end of namespace itk 00085 00086 #ifndef ITK_MANUAL_INSTANTIATION 00087 #include "itkHistogramAlgorithmBase.txx" 00088 #endif 00089 00090 #endif 00091