| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkFunctionBase.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:36 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
DEF |
#ifndef _itkFunctionBase_h |
| 18 |
DEF |
#define _itkFunctionBase_h |
| 19 |
|
|
| 20 |
|
#include "itkObject.h" |
| 21 |
|
#include "itkObjectFactory.h" |
| 22 |
|
|
| 23 |
|
namespace itk |
| 24 |
|
{ |
| 25 |
|
|
| 26 |
|
/** |
| 27 |
|
* \class FunctionBase |
| 28 |
|
* \brief Base class for all ITK function objects |
| 29 |
|
* |
| 30 |
|
* FunctionBase is the base class for ITK function objects. Specifically, |
| 31 |
|
* the abstract method Evaluate() maps a point from the input space to a point |
| 32 |
|
* in the output space. |
| 33 |
|
* |
| 34 |
|
* Subclasses must override Evaluate(). |
| 35 |
|
* |
| 36 |
|
* This class is template over the input (domain) type and |
| 37 |
|
* the output (range) type. |
| 38 |
|
* |
| 39 |
|
* \ingroup Functions |
| 40 |
|
* |
| 41 |
|
*/ |
| 42 |
|
template < class TInput, class TOutput > |
| 43 |
|
class ITK_EXPORT FunctionBase : public Object |
| 44 |
|
{ |
| 45 |
|
public: |
| 46 |
|
/** Standard class typedefs. */ |
| 47 |
|
typedef FunctionBase Self; |
| 48 |
TDA |
typedef Object Superclass; |
| 49 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 50 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 51 |
|
|
| 52 |
|
/** Run-time type information (and related methods). */ |
| 53 |
|
itkTypeMacro(FunctionBase, Object); |
| 54 |
|
|
| 55 |
|
/** Input type */ |
| 56 |
|
typedef TInput InputType; |
| 57 |
|
|
| 58 |
|
/** Output type */ |
| 59 |
|
typedef TOutput OutputType; |
| 60 |
|
|
| 61 |
|
/** Evaluate at the specified input position */ |
| 62 |
|
virtual OutputType Evaluate( const InputType& input ) const = 0; |
| 63 |
|
|
| 64 |
|
protected: |
| 65 |
|
FunctionBase(){}; |
| 66 |
|
~FunctionBase(){}; |
| 67 |
|
|
| 68 |
|
private: |
| 69 |
|
FunctionBase(const Self& ); //purposely not implemented |
| 70 |
|
void operator=(const Self& ); //purposely not implemented |
| 71 |
|
|
| 72 |
|
}; |
| 73 |
|
|
| 74 |
|
} // namespace itk |
| 75 |
|
|
| 76 |
|
#endif |
| 77 |
|
|