[Insight-developers] Bug fix for the NarrowBand filters.

Joshua Cates cates at sci.utah.edu
Mon, 9 Feb 2004 16:19:54 -0700 (MST)


Hi,

I have fixed a bug in itkIsoContourDistanceImageFilter that was causing
all of the narrow-band-based level-set filters to hang when run with 
certain combinations of image sizes and numbers of threads. 

Itk::ImageSource (which handles the splitting of images and spawning of
threads in this case) does not always split the image into the number of
threads that were requested (i.e. the value returned from
GetNumberOfThreads()). Sometimes fewer threads are created, depending on
the dimensions of the image.  

IsoContourDistanceImageFilter was initializing its Barrier using
GetNumberOfThreads and so frequently hung waiting on threads that were
never actually spawned.

For example: if a user calls SetNumberOfThreads(20) and processes a
128x128 image, only 18 threads are actually used, but
IsoContourDistanceImageFilter was trying to synchronize on 20.

Josh.

______________________________
 Josh Cates			
 Scientific Computing and Imaging Institute
 University of Utah
 Email: cates at sci.utah.edu
 Phone: (801) 587-7697
 URL:   http://www.sci.utah.edu/~cates