[vtkusers] vtkProcrustesAlignmentFilter error in centroid size

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Mon May 12 05:41:18 EDT 2003


David,

Looking at the code now I'm not sure why we put that sqrt() in there. It 
would make sense *after* the for loop, ie:

   S += vtkMath::Distance2BetweenPoints(p,cp);
}
return sqrt(S);

Or perhaps more efficiently, leave it out all together and have 
CentroidSize (or CentroidSize2) return the square of the centroid size.

Rasmus and I are looking into this. Thankyou for noticing this!

For users of vtkProcrustesAlignmentFilter, CentroidSize is only called when 
using a similarity alignment.

Tim.

At 17:50 10/05/2003 +0930, David Netherway wrote:
>The procedure CentroidSize below returns the sum of the distances from
>points to the centroid instead of the square root of the sum of squared
>distances.
>This is contrary to my understanding of the centroid size. Is this an error
>or deliberate?
>
>David Netherway
>
>Module: $RCSfile: vtkProcrustesAlignmentFilter.cxx,v $
>
>Date: $Date: 2003/03/11 15:19:30 $
>
>Version: $Revision: 1.10 $
>
>// Calculate the centroid size of a point cloud
>
>static inline double CentroidSize(vtkPoints* pd, float *cp)
>
>{
>
>Centroid(pd, cp);
>
>
>double S = 0;
>
>for (int i = 0; i < pd->GetNumberOfPoints(); i++)
>
>{
>
>float *p = pd->GetPoint(i);
>
>
>S += sqrt(vtkMath::Distance2BetweenPoints(p,cp));
>
>}
>
>
>return S;
>
>}
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers

---------------------------------------------------------------------------
Tim Hutton,                        http://www.eastman.ucl.ac.uk/~dmi/MINORI
Research Fellow & PhD student,                   T.Hutton at eastman.ucl.ac.uk
MINORI Project, Biomedical Informatics Unit,
Eastman Dental Institute, UCL,                   Tel: [+44] (0)20 7915 2344
256 Gray's Inn Road, London WC1X 8LD, UK         Fax: on request
---------------------------------------------------------------------------
This email represents the views of the sender alone and must not be 
construed as representing the views of the Eastman Dental Institute. It may 
contain confidential information and may be protected by law as a legally 
privileged document and copyright work. Its content should not be disclosed 
and it should not be given or copied to anyone other than the person(s) 
named or referenced above. If you have received this email in error, please 
contact the sender.





More information about the vtkusers mailing list