[Insight-developers] Removing PhysicalPoitnToIndex() from itk Image ?

Miller, James V (CRD) millerjv@crd.ge.com
Fri, 22 Feb 2002 14:44:33 -0500


Deriving these helper classes from ImageFunction seems
to be a matter of convenience rather than one of design.

These convenience classes are not computing a function based
on image pixel values but rather computing a coordinate as a
function of the coordinate transform of the image.

I would suggest not deriving from ImageFunction so to avoid
confusion as to what ImageFunctions are. I would, however, 
duplicate the API: Evaluate(), EvaluateAtIndex(), etc.
I guess it would derive from FunctionBase.


-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
Sent: Thursday, February 21, 2002 4:41 PM
To: Stephen R. Aylward
Cc: insight-dev-list
Subject: Re: [Insight-developers] Removing PhysicalPoitnToIndex() from
itkImage ?


Stephen R. Aylward wrote:

>So this class could be used by any function that needed to do multiple
>calls to a single transform such that appropriate intermediate
>calculations are cached and therefore the multiple calls go faster?
>

The classes will be a variant of ImageFunction in which the output
type will be templated to be: { Point | Index |  ContinousIndex }.

They will get from the image the pointer to the Transform and
will keep it inside. They will not be particularly faster than
the current methods. It is more a matter of cleaning up the Image
class and allowing to generalize the Transforms. At this point
we are forced to use only Affine.


Thanks to the fact that ImageFunction already has methods for

-  Evaluat( Point ),
-  EvaluateAtIndex()
-  EvaluateAtContinuousIndex()

we will only need to instantiate the return type.

The helper classes will look like:

1) Point to Index : This is a function that receives a point and
    return an Index

template< typename ImageType, typename TCoordRep >
PointToIndexImageFunction :
    public ImageFunction<ImageType,
                         Index<ImageType::ImageDimension>,
                         TCoordRep  >

The call for Evaluate will then return an Index.



2) Point to ContinousIndex will be like

template< typename ImageType, typename TCoordRep >
PointToIndexImageFunction :
    public ImageFunction<ImageType,
                         ContinousIndex<ImageType::ImageDimension>,
                         TCoordRep  >



and so on.



  Luis



_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers