[Insight-developers] ITK Function heirarchy

Lydia Ng lng@insightful.com
Wed, 12 Sep 2001 19:43:03 -0700


As discussed in the Seattle meeting, all ITK "function" object 
refactored to derive from a common base class. 

Following is a proposal for your comments -
we can discuss it at the tcon this Friday. 

Lydia

-------------------------------------------------------
(a) FunctionBase (Lydia)

All ITK function object shall derive from a common
base class FunctionBase.

FunctionBase derives from Object and is templated
over the input (domain) type and output (range) type.

The abstract method Evaluate() maps a point from the
input space to a point in the output space. 

    virtual TOutput Evaluate(const TInput& input) const = 0;

Subclasses must override Evaluate().

--------------------------------------------------------
(b) ImageFunction (Lydia)

As discussed in Seattle, ImageFunction and ContinuousImageFunction
are to be collapse into one class ImageFunction

ImageFunction is templated over the input image type,
and function output type.

ImageFunction derives from Evaluate with Point being the
input (domain) type such that

template <class TInputImage, class TOutput>
class ImageFunction : public FunctionBase< 
                               Point<double,TInputImage::ImageDimension>,
                               TOutput>
{
  enum{ ImageDimension = TInputImage::ImageDimension };
  typedef Point<double,ImageDimension> PointType

  virtual TOutput Evaluate( const PointType& point ) const = 0;

};


Evaluation at Index and ContinuousIndex is to be supported
by methods:
TOutput EvaluateAtIndex( 
  const IndexType& index );

TOutput EvaluateAtContinuousIndex( 
  const ContinuousIndexType& index );

------------------------------------------------------------
(c) 

The following function objects needs to be refactor
to derive from FunctionBase:

- SpatialFunction (Damion)
- PixelFunction (was DataAccessor - Luis)
- FiniteDifferenceFunction (Josh)
- KernelFunction (Lydia)