[Insight-users] Minor bug in itkDanielssonDistanceMapImageFilter?

Zachary Pincus zpincus at stanford.edu
Fri Oct 7 21:06:33 EDT 2005


Hello,

It appears that the Danielsson distance map image filter does not  
honor the "SquaredDistance" boolean. Presumably, this boolean is  
available to have the distances be reported as squares, thus saving  
the time to perform a sqrt operation on each pixel. Anyhow, the sqrt  
is computed at every step regardless, on line 298 (or so):

     dt.Set( static_cast<typename OutputImageType::PixelType>(sqrt 
( distance )) );

instead, this should be:
     if (m_SquaredDistance)
       {
       dt.Set( static_cast<typename OutputImageType::PixelType> 
( distance ) );
       }
     else
       {
       dt.Set( static_cast<typename OutputImageType::PixelType>(sqrt 
( distance )) );
       }

Currently the m_SquaredDistance variable is never consulted at any  
step of the computation.

I'll file a bug and then check in the change if nobody thinks that  
this would cause backward-compatibility issues.

Zach Pincus


More information about the Insight-users mailing list