[Insight-developers] itkPoint from a math perspective

Damion Shelton dmsst59+@pitt.edu
Mon, 16 Jul 2001 16:23:11 -0400


Hi...

In attempting to convert spatial functions and the blox hierarchy to
itkPoint (from vnl_vector_fixed) I've run into a few snags. As we agreed on
in Seattle, I'm changing to the following data representations in my code:

Gradients: itkCovariantVector
Locations/positions: itkPoint

Unfortunately, there doesn't appear to be a standard means of using these
two objects in mathematical functions. For instance, to normalize an
itkPoint I've been using (but haven't tested, due to compilation problems
elsewhere):

seedPos.Get_vnl_vector().normalize();

This is a relatively simple operation - for more complex operations (dot
products, for instance), I found it neccessary to duplicate Point data in
order to avoid horribly messy code.

To summarize: Is there an easy way to interchange Points, CovariantVectors,
and vnl_vector's? I'm concerned that having to explicity convert back and
forth between data types is an impediment to clear code, and possibly a
speed handicap as well, since these interconversions would occur many
hundreds of thousands of times in my code.

Any thoughts are welcome.

-Damion