[Insight-developers] Changes made to itkVector

Luis Ibanez luis.ibanez at kitware.com
Wed Jul 7 13:01:04 EDT 2004


Hi Hans,

The purpose of the itk::Vector class is to represent
a geometrical vector in space. More specifically as
the difference between two point positions in space.

Unfortunately the term "vector" is usually applied also
to the concept of "array" and tend to create confusion.
In this context, instantiating an itk::Vector of <bool>
or any other type where the RealType is not applicable
may not make much sense.

You probably want to instantiate your images as having
pixel type  itk::FixedArray<>. This is the parent class
of the itk::Vector<> and is the class that serves to
represent a generic array of fixed size.

The itk::Vector should provide the mathematical functionality
of a geometrical vector. That motivated the recent changes
because methods such as GetNorm() and GetSquaredNorm() were
returning the values in the "component type" as opposed to
the RealType. This meant that an itk::Vector<int,3> was
returning a "int" norm instead of a RealType one.

The Vector<>, Point<> and CovariantVector<> types are then
reserved for geometrical applications.


Please let me know if using the FixedArray<> may work
for your applications,



    Thanks,



       Luis


--------------------
Hans Johnson wrote:

> Luis,
> 
> On July 5, 2004 you made a change to itkVector.h and added:
> 
> typedef typename NumericTraits< ValueType >::RealType   RealValueType;
> 
> 
> I am getting a compiler error now:
> 
>>no type named `RealType' in `class itk::NumericTraits<itk::SmartPointer<itk::Image<float, 3> > >'
> 
> 
> I was using an itkVector of Images as an intermediate to refactoring some old code into ITK (This had worked for about a year).  I've already changed the code to remove the dependance on the itk::Vector (certainly not what it was inteded to be used for).
> 
> My biggest concern is that the only valid itkVector types at this moment are those for which RealType is defined (i.e. bool, char, short, int, float, double, and long double).
> 
> Regards,
> Hans
> 
>  
> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 





More information about the Insight-developers mailing list