[Insight-users] itkSphereSpatialFuction - Documentation Error

Robert Tamburo robert.tamburo at gmail.com
Fri Jun 30 13:11:23 EDT 2006


In the brief description for this class, it states: "Implements a  
function that returns 0 for points inside or on the surface of a  
sphere, 1 for points outside the sphere"

But in the actual implementation, 1 is returned for points inside or  
on the surface of the sphere and 0 is returned for points outside the  
sphere (see relevant code below).

   double acc = 0;

   for(unsigned int i = 0; i < VImageDimension; i++)
     {
     acc += (position[i] - m_Center[i]) * (position[i] - m_Center[i]);
     }

   acc -= m_Radius*m_Radius;

   if(acc <= 0) // inside the sphere
     {
     return 1;
     }
   else
     {
     return 0; // outside the sphere
     }



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060630/55fa3448/attachment.html


More information about the Insight-users mailing list