[Insight-developers] itkPoint itkVector additional methods

Miller, James V (CRD) millerjv@crd.ge.com
Mon, 23 Jul 2001 07:52:01 -0400


Luis,

I think the SetToMedian() method needs to be renamed.  Median has a strict statistical meaning which
is the middle point out of a sample of N (this is the definition for N odd.  if N is even, the median
is usually defined as the midpoint between the two middle samples).

I think the SetToMedian() method should be renamed to SetToMidpoint().

Another way to provide this API is to not provide "Set" methods but rather class (static) methods
like

Point Point::MidPoint(Point &, Point &)
	return a Point which is the midpoint of the arguments

Point Point::LinearCombination(Point &, Point&, float)
	return a Point which is the linear combination of the specified points

Point Point::BarycentricCombination(Point &, Point &, float, float)
	return a Point which is the barycentric combination of the specified points



I would also add a more general method:

Point Point::LinearCombination(Point [], float weights[], unsigned int num)
	return a Point which is the linear combination or weighted average of a set
	of points. I suppose this last one could be implemented using PointContainers 
      and iterators. I am tempted to call this method weighted average but that would
	imply that the weights sum to one. I don't want to restrict the call to that case.







-----Original Message-----
From: Luis Ibanez [mailto:ibanez@choroid.cs.unc.edu]
Sent: Saturday, July 21, 2001 2:52 PM
To: insight-Developers
Subject: [Insight-developers] itkPoint itkVector additional methods



According to what we discuss in the Tcon,...


itkVector has now a Normalize() method. it will divide
the components by the norm. no verification for zero is
done.


itkPoint has the following method:

- Point.SetToMedian( A, B) the calling point is set to
     the median of the two points given as parameters

- Point.SetToBarycentricCombination( A, B, a )
     the calling point is set to a*A + (1-a)*B

- Point.SetToBarycentricCombination( A, B, C, a, b )
     the calling point is set to a*A+b*B+(1-a-b)*C



Luis




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