[Insight-users] itkBinaryMorphologicalClosingImageFilter speed

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Jun 17 16:40:03 EDT 2008


Le 17 juin 08 à 21:08, Margaret Zhao a écrit :

> Hi, Gaetan -
>
>
>  A question for itkBinaryMorphologicalClosingImageFilter -
>
>
>  What is the current status for this filter in ITK 3.6 release? I  
> want to do a dilation followed by erosion for a binary image, what  
> is the best filter in ITK to use?
>
>  I used your itkBinaryMorphologicalClosingImageFilter for my  
> 271x276x1 binary image, and I set the ball radius as 15, and the  
> computation time is about 85 sec. for this filter alone. I am using  
> Dell Optiplex 755 with Duo CPU 3GHz & 1.97 GHz and 3.25 GB of RAM.  
> And I know I am using the debug version of ITK, so, the speed will  
> be slower than release version. But still, 85 sec, is too long. And  
> I set SetSafeBorder as true. Any idea I can speed up the closing  
> filter?


Hi Margaret,

This filter is in the Review directory in the release 3.6, so you  
should use it if you need the safe border. If you don't need it, a  
dilation followed by a erosion is the same.

I see 4 things in your mail about performance:

  i. build the filter in release mode would highly improve the  
performance. You should retry in Release mode.

  ii. process a 2D image with a 3D structuring element makes the  
filter spend most of its time outside the image. You should try with a  
2D structuring element. I think that a structuring element of size of  
[15, 15, 0] would produce the same result than a size of [15, 15, 15].  
If your image is always 2D, using a real 2D structuring element and 2D  
filter is a better alternative.

  iii. the performance of that filter is very dependant of the content  
of the image. If you have many pixels on the border of the object, it  
can be quite inefficient. If you can, you may want to change the order  
of your filters to give an image as simple as possible as input to  
that filter.

  iv. the SafeBorder option set to true would avoid the border effect,  
but decrease the performances.

Please let me know if any of these hints makes any difference.

Regards,

Gaëtan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080617/69cc4d0a/attachment.pgp>


More information about the Insight-users mailing list