00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkHistogramAlgorithmBase.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-05-12 17:26:20 $ 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 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 ITK_EXPORT 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 } 00062 00064 const TInputHistogram * GetInputHistogram() const 00065 { return m_InputHistogram.GetPointer(); } 00066 00070 void Update() 00071 { this->GenerateData(); } 00072 00073 protected: 00074 HistogramAlgorithmBase(); 00075 virtual ~HistogramAlgorithmBase() {} 00076 void PrintSelf(std::ostream& os, Indent indent) const; 00077 00078 virtual void GenerateData() = 0; 00079 00080 private: 00082 typename TInputHistogram::ConstPointer m_InputHistogram; 00083 }; // end of class 00084 00085 } // end of namespace itk 00086 00087 #ifndef ITK_MANUAL_INSTANTIATION 00088 #include "itkHistogramAlgorithmBase.txx" 00089 #endif 00090 00091 #endif 00092