[Insight-users] erosion performance for binary images

M.Staring at lumc.nl M.Staring at lumc.nl
Fri Jun 5 12:46:19 EDT 2009


Hi Dan and Gaetan,
 
First of all: thanks for your feedback.
 
I forgot about the importance of the specific choice of the kernel. That makes sense of course. In my test code I used the line
 
    erosionFilter->SetRadius( radii[ i ] );
 
and assumed it would be give a ball. Now I use:
 
    erosionFilter->SetKernel( itk::FlatStructuringElement<Dimension>::Box( radius ) );
or
    erosionFilter->SetKernel( itk::FlatStructuringElement<Dimension>::Ball( radius ) );
 
Then the VHGW filter indeed did not run for the Ball, because it is not decomposable.
 
The new performance results for ball and box are in the attachments. For the box the binary erode still seems to be faster up till a radius of 8, after which the VHGW takes over. The latter is not constant for increasing radius though.
 
I added the source code in the zip, so you can reproduce the results. You can also find the binary image on which I did the test in the zip.


________________________________

	From: Gaëtan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr] 
	

The algorithm used in BinaryErodeImageFilter can't be easily 
constrained to a zone, and so it is difficult to multithread it.
If you want to perform an erosion with a radius of 1 (on all the 
dimension), BinaryContourImageFilter followed by a SubtractImageFilter 
would be a lot faster (really) especially on a multicore system, as 
they are both multithreaded. Some timings are available in section 3 
of http://insight-journal.com/download/viewpdf/217/2
  
I just assumed it would be, since there were multi-threaded versions for grayscale images. But it's an entirely different algorithm I guess.
Regards,
Marius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090605/fd6a2508/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erosion.zip
Type: application/x-zip-compressed
Size: 47760 bytes
Desc: erosion.zip
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090605/fd6a2508/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ball.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090605/fd6a2508/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: box.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090605/fd6a2508/attachment-0003.txt>


More information about the Insight-users mailing list