[Insight-developers] itk vs vnl / Vector & Matrix
Luis Ibanez
luis.ibanez@kitware.com
Wed, 20 Feb 2002 16:17:03 -0500
Robert Tamburo wrote:
>Okie dokie, finding the 1). smallest value in a vector and 2). the average
>of values in a vector would be useful for me.
>
Vector, Point and CovariantVector are intended for representing spatial
coordinates.
Unfortunately "vector" seems to have too many connotations :-/
itkVector is not really intended to be used as the MatLab generalized
vector...
but rather as a mathematical type for representing the tangent of a
curve or a speed.
(in which case averaging x,y,z components could not make much sense)
We could do that at the Array level but not adding by a method to the array
it rather be implemented by additional utility classes that access the
itk::Array.
This is because the elements of the array could be anything, not necesarily
arithmetic types. They could be <std::list<CoreAtoms>> for example :-)
A member method relaying on the array elements to provide operator+()
and operator/() will impose too many limitations.
For something like "min" and "average" it could make more sense to use a
std::vector<>
and take advantage of all the STL algorithms. You can get access to them
by using the
itkVectorContainer because it derives from a std::vector and wraps
std::iterators which
is what most STL algorithms expect as input.
What particular use case are you considering for the "min" and "average" ?
Luis