[Insight-developers] implicit functions / itkImageFunction

Damion Shelton dmsst59+@pitt.edu
Thu, 10 May 2001 16:43:03 -0400


Hi...

I'd like some feedback on the issue of implicit function behavior, in the
context of the existing itkImageFunction class, which as Vikram pointed out
might be useful. For starters, it appears - correct me if I'm wrong - that
itkImageFunction allows you to evaluate an arbitrary function (with
arbitrary return type) at every index position.

Right now I have three classes:

itkImplicitFunction<unsigned int VImageDimension>
itkSphereImplicitFunction<unsigned int VImageDimension>
itkImplicitFunctionImageEvaluatorFilter<class TInputImage, class
TOutputImage>

itkImplicitFunction is almost identical to vtkImplicitFunction - it permits
evaluation of a function and its gradient at an arbitrary position in space,
defined by a vector of doubles. An itkImplicitFunciton doesn't understand
indices or pixels, because in the interests of generality it might be nice
to be able to evaluate generalized n-dimensional functions.

itkSphereImplicitFunction is based on its cousin in VTK, but generalized to
the n-d case. The function value is essentially a measure of the distance
from the input point to the surface of the sphere, along a vector from the
point to the sphere's center. Therefore, negative values put you inside the
sphere and positive values put you outside.

itkImplicitFunctionImageEvaluatorFilter walks an image, and like
itkImageFunction, evaluates its internal ImplicitFunction at every index
location. The major differences are as follows:

1) itkImplicitFunctionImageEvaluatorFilter walks an entire image, evaluating
as it goes, while the Evaluate() call in itkImageFunction returns the value
at a single specified index.

2) itkImageFunction works on Images, while
itkImplicitFunctionImageEvaluatorFilter will work only on PhysicalImages.
"Normal" images no longer define an origin and spacing, which is required in
order to evaluate an ImplicitFunction that exists in real space, not in
index space. For the purposes of validation, we need to work in real space.

3) itkImplicitFunctionImageEvaluatorFilter will ultimately make decisions
about how to "shade" the image based on the value of the ImplicitFunction at
a given index location. In other words, the output of
itkImplicitFunctionImageEvaluatorFilter is itself an image, with the
ImplicitFunction "drawn" into the image volume.

So, the question is am I doing something that is a logical extension of
itkImageFunction? I don't think so, but it's entirely possible that there's
other stuff in the class hierarchy that I've missed.

As always, thoughts are most welcome....

-Damion-