[Insight-developers] interpolaters/image functions and coord rep type

Luis Ibanez luis.ibanez@kitware.com
Tue, 19 Feb 2002 22:52:22 -0500


Templated functions for Casting have been added.
They are:

   PointCast, VectorCast and CovariantVectorCast

They can be used as:

     PointTypeA pointA;
     PointTypeB pointB;
     itk::PointCast( pointA, pointB );

pointA is copied/cast into pointB. Casting is performed
using static_cast<>, so... default C-types casting.

Unfortunately, and ICE in VC++ does not allow to
implement these functions like:

  template< typename CoordTypeA, typename CoordTypeB, unsigned int N>
  PointCast( const Point< CoordTypeA, N> & , Point< CoordTypeB, N> & ) {  }

which could have enforced consistency along the Point dimension.

Right now they are:

   template < typename TPointA, typename TPointB >
   void PointCast( const TPointA & pa, TPointB & b ) { ... }


The functions don't enforce nor check for dimension consistency....
maybe that can be addressed with Concept::Checking.

in the meantime... use at your own risk     :-/

In fact they are so open, that one of them is enough for
all the conversions... Points, Indexes, Vectors....
with the drawback of allowing crosstalk, eg: Point to Vector.



   Luis



=============================================================

Lydia Ng wrote:

>
>Also we would need utility functions that converts double Point to
>float Point and indexes both double Point and float Points etc ...
>