<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>Hi all
(Gaetan),</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>I am wondering what
is the fastest performing filter for the erosion of 3D
<STRONG>binary</STRONG> data.</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>I have tried the
BinaryErodeImageFilter and the several flavours of erosion filters from the
review directory (</FONT><FONT size=2 face=Arial>OptGrayscaleErodeImageFilter:
BASIC, HISTO, VHGW, ANCHOR</FONT><FONT size=2 face=Arial>), 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?</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>Here are some
performance numbers:</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>Ball radius:
1<BR> Elapsed time erosion_binary: 5.422s.<BR> Elapsed time erosion
basic: 1.875s.<BR> Elapsed time erosion HISTO: 11.86s.<BR> Elapsed
time erosion VHGW: 17.734s.<BR> Elapsed time erosion Anchor:
33.891s.<BR>Ball radius: 2<BR> Elapsed time erosion_binary:
5.704s.<BR> Elapsed time erosion basic: 9.312s.<BR> Elapsed time
erosion HISTO: 26.954s.<BR> Elapsed time erosion VHGW: 13.031s.<BR>
Elapsed time erosion Anchor: 33.484s.<BR>Ball radius: 4<BR> Elapsed time
erosion_binary: 6.453s.<BR> Elapsed time erosion basic: 67.047s.<BR>
Elapsed time erosion HISTO: 82.063s.<BR> Elapsed time erosion VHGW:
43.719s.<BR> Elapsed time erosion Anchor: 44.75s.<BR>Ball radius:
8<BR> Elapsed time erosion_binary: 9.547s.<BR> Elapsed time erosion
basic: 603.593s.<BR> Elapsed time erosion HISTO: 299.89s.<BR>
Elapsed time erosion VHGW: 13.062s.<BR> Elapsed time erosion Anchor:
37.094s.<BR></FONT></SPAN><SPAN class=562091613-05062009><FONT size=2
face=Arial>Ball radius: 16<BR> Elapsed time erosion_binary:
21.625s.</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial> Elapsed time
erosion basic: too slow<BR> Elapsed time erosion HISTO: too
slow<BR> Elapsed time erosion VHGW: 17.922s.<BR> Elapsed time
erosion Anchor: 37.5s.<BR>Ball radius: 32<BR> Elapsed time erosion_binary:
70.391s.<BR> Elapsed time erosion VHGW: 44.375s.<BR> Elapsed time
erosion Anchor: 57.875s.<BR></DIV></FONT></SPAN>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>where the
BinaryErodeImageFilter is single-threaded and the other ones multi-threaded ( I
used 4 cores on my pc).</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>So, as I currently
understand the </FONT><FONT size=2 face=Arial>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?</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>When I set
ITK_USE_CONSOLIDATED_MORPHOLOGY to true, the base class of
BinaryErodeImageFilter, namely </FONT><FONT size=2
face=Arial>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?</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2 face=Arial>Thanks for you
advise/comments,</FONT></SPAN></DIV>
<DIV><SPAN class=562091613-05062009><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV align=left><FONT size=2 face=Arial>Marius Staring</FONT></DIV>
<DIV align=left><FONT size=2 face=Arial>Division of Image Processing
(LKEB)<BR>Department of Radiology<BR>Leiden University Medical
Center</FONT></DIV>
<DIV align=left><FONT size=2 face=Arial>PO Box 9600, 2300 RC Leiden, The
Netherlands</FONT></DIV>
<DIV align=left><SPAN class=sg><FONT size=2 face=Arial>phone: +31 (0)71 526
1105, fax: +31 (0)71 526 6801</FONT></SPAN></DIV>
<DIV align=left><SPAN class=sg></SPAN><SPAN class=sg><FONT size=2
face=Arial>m.staring@lumc.nl</FONT></SPAN></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV></BODY></HTML>