[Insight-developers] itk vs vnl / Vector & Matrix

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 20 Feb 2002 16:51:53 -0500


I don't think there is any reason itkArray cannot be used in STL algorithms.
Array defines an iterator and we "should" be able to pass these iterators
into standard STL algorithms (since these iterators happen to be pointers).


-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
Sent: Wednesday, February 20, 2002 4:17 PM
To: Robert Tamburo
Cc: Insight-Developers (E-mail)
Subject: Re: [Insight-developers] itk vs vnl / Vector & Matrix


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


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