[Insight-users] erosion performance for binary images

M.Staring at lumc.nl M.Staring at lumc.nl
Fri Jun 5 10:03:43 EDT 2009


Hi all (Gaetan),
 
I am wondering what is the fastest performing filter for the erosion of
3D binary data.
 
I have tried the BinaryErodeImageFilter and the several flavours of
erosion filters from the review directory (OptGrayscaleErodeImageFilter:
BASIC, HISTO, VHGW, ANCHOR), contributed by Gaetan, on a large
(512x512x142) binary 3D dataset. These new filters, which I expected to
be much faster, appeared to be slower. I think that is because these
filters are all suitable for grayscale images, so they are "too general"
for my problem. Do you think that assumption is correct?
 
Here are some performance numbers:
 
Ball radius: 1
  Elapsed time erosion_binary: 5.422s.
  Elapsed time erosion basic: 1.875s.
  Elapsed time erosion HISTO: 11.86s.
  Elapsed time erosion VHGW: 17.734s.
  Elapsed time erosion Anchor: 33.891s.
Ball radius: 2
  Elapsed time erosion_binary: 5.704s.
  Elapsed time erosion basic: 9.312s.
  Elapsed time erosion HISTO: 26.954s.
  Elapsed time erosion VHGW: 13.031s.
  Elapsed time erosion Anchor: 33.484s.
Ball radius: 4
  Elapsed time erosion_binary: 6.453s.
  Elapsed time erosion basic: 67.047s.
  Elapsed time erosion HISTO: 82.063s.
  Elapsed time erosion VHGW: 43.719s.
  Elapsed time erosion Anchor: 44.75s.
Ball radius: 8
  Elapsed time erosion_binary: 9.547s.
  Elapsed time erosion basic: 603.593s.
  Elapsed time erosion HISTO: 299.89s.
  Elapsed time erosion VHGW: 13.062s.
  Elapsed time erosion Anchor: 37.094s.
Ball radius: 16
  Elapsed time erosion_binary: 21.625s.
  Elapsed time erosion basic: too slow
  Elapsed time erosion HISTO: too slow
  Elapsed time erosion VHGW: 17.922s.
  Elapsed time erosion Anchor: 37.5s.
Ball radius: 32
  Elapsed time erosion_binary: 70.391s.
  Elapsed time erosion VHGW: 44.375s.
  Elapsed time erosion Anchor: 57.875s.

where the BinaryErodeImageFilter is single-threaded and the other ones
multi-threaded ( I used 4 cores on my pc).
 
So, as I currently understand the BinaryErodeImageFilter is the fastest
one for this task up till a radius of 8-16, even though it is
single-threaded. After that the VanHerkGilWerman method takes over,
probably due to it's multi-threadedness. Does anyone know of an erosion
filter potentially faster than the BinaryErodeImageFilter, that I
missed? Does anyone have a multi-threaded version of the
BinaryErodeImageFilter lying around?
 
When I set ITK_USE_CONSOLIDATED_MORPHOLOGY to true, the base class of
BinaryErodeImageFilter, namely BinaryMorphologyImageFilter is replaced
by an optimized version. However, this does not seem to change anything,
since the GenerateData() of BinaryErodeImageFilter is not overridden.
Was it supposed to change?
 
Thanks for you advise/comments,
 
 
Marius Staring
Division of Image Processing (LKEB)
Department of Radiology
Leiden University Medical Center
PO Box 9600, 2300 RC Leiden, The Netherlands
phone: +31 (0)71 526 1105, fax: +31 (0)71 526 6801
m.staring at lumc.nl
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090605/034ccd43/attachment-0001.htm>


More information about the Insight-users mailing list