ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkHistogramAlgorithmBase.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
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 {
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 protected:
00073   HistogramAlgorithmBase();
00074   virtual ~HistogramAlgorithmBase() {}
00075   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 } // end of namespace itk
00085 
00086 #ifndef ITK_MANUAL_INSTANTIATION
00087 #include "itkHistogramAlgorithmBase.hxx"
00088 #endif
00089 
00090 #endif
00091