<div>Hi all</div>
<div> </div>
<div>A fast binary erosion algorithm strips layers from the surface structure using a unit cross structure factor multiple times to construct a large effective radius. The dilation adds surface layers. A region iterator or pointer is used for implementation speed.  While the algorithm is very fast, there are facetts in the large structure factor.</div>

<div> </div>
<div>Harvey Cline</div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Fri, Jun 5, 2009 at 10:03 AM, <span dir="ltr">&lt;<a href="mailto:M.Staring@lumc.nl">M.Staring@lumc.nl</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div><span><font size="2" face="Arial">Hi all (Gaetan),</font></span></div>
<div><span><font size="2" face="Arial"></font></span> </div>
<div><span><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><font size="2" face="Arial"></font></span> </div>
<div><span><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 &quot;too general&quot; for my problem. Do you think that assumption is correct?</font></span></div>

<div><span><font size="2" face="Arial"></font></span> </div>
<div><span><font size="2" face="Arial">Here are some performance numbers:</font></span></div>
<div><span><font size="2" face="Arial"></font></span> </div>
<div><span><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><font size="2" face="Arial">Ball radius: 16<br>  Elapsed time erosion_binary: 21.625s.</font></span></div>
<div><span><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></font></span></div>
<div><span><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><font size="2" face="Arial"></font></span> </div>
<div><span><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&#39;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><font size="2" face="Arial"></font></span> </div>
<div><span><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><font size="2" face="Arial"></font></span> </div>
<div><span><font size="2" face="Arial">Thanks for you advise/comments,</font></span></div>
<div><span><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><font size="2" face="Arial">phone: +31 (0)71 526 1105, fax: +31 (0)71 526 6801</font></span></div>
<div align="left"><span></span><span><font size="2" face="Arial"><a href="mailto:m.staring@lumc.nl" target="_blank">m.staring@lumc.nl</a></font></span></div>
<div><font size="2" face="Arial"></font> </div></div><br>_____________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br><br></blockquote></div><br>