[Insight-users] itkEucledianDistance

Luis Ibanez luis.ibanez@kitware.com
Wed, 22 Jan 2003 13:22:29 -0500


Hi Kumar,


Unfortunately the term "vector" is used to
indicate too many different things...

Depending on what you are doing there are
different ITK classes that could be apropriate.

Some questions may help to figure out
the best option for your case:

1) What are you representing with this vector ?
    Is this used for representing positions in space ?
    or are you using it as a container with float
    values...

2) How many elements are you placing in this vector?

3) Do you need it to have variable size ?


If you are representing coordinates in space,
you may want to look at the itk::Point and
itk::Vector classes. They have built-in methods
for computing distances.

Please let us know


   Luis



--------------------------------

kumar wrote:

> Hello Everyone
> I am wanting to compute the Eucledian Distance between two vectors and
> I thought I could use the class EucledianDistance from the itk::Statistics
> It is templated over TVector
> 
> So I tried to declare
> itk::Statistics::EuclideanDistance<vnl_vector<double> > Distance_Computer;
> 
> But that did not help me as the class TVector needs some functions to be 
> implemented
> by it  as seen in the following functions
> 
> itkStaticConstMacro(VectorLength, unsigned int, TVector::Length);
>  typedef typename TVector::ValueType ValueType ;
> 
> So the class needs a variable called Length and also a variable called 
> ValueType
> Since these are not there in vnl_vector this class cannot be used in 
> instantiating Eucledian class with vnl_vector
> 
> What could be done in  this case ( A new derived class could be created 
> , but that leads to lot of rework for just that case)
> 
> And also what shoudl be the structure of TVector that is wanted b 
> yEucledian class is not known easily
> 
> Any feedback on this is welcome
> 
> Thanks and Warm Regards
> Kumar
> 
>