[Insight-users] itkBinaryDilateImageFilter speed 4D data

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Sep 3 10:15:21 EDT 2013


Hello,

Here are some things you can try.

1) Use the current filter but separate it by decomposing the structuring element. run it 3-times with 1-D lines in each direction.
2) If your image is just 0s and 1s you can try the grayscale algorithms.

Plug: exploring the performance difference between your current method and the two above is something that SimpleITK in python would be very quick at doing.

3) A while ago I prototyped a parallel and more optimized algorithm for dilation and closing of 1-D lines. So it only works with Flat structuring elements. I haven't had a chance to get back to it to polish it up. So I am not sure what the state is, but I was able to use it on my data set and get something like 100X speed up between the parallelization and the different algorithm.

Here is my ITK external module where I did the work:
https://github.com/blowekamp/itkBinaryMorphologyPerformance
I'd write a test a verify the results before I used it.

Good luck and let us know what works for you,
Brad

On Sep 3, 2013, at 9:59 AM, Jose Ignacio Prieto <joseignacio.prieto at gmail.com> wrote:

> Hi, I need your advice for a dilate filter I am using. I have cine 3d images (3d+time) loaded as a 4d matrix on itk. They are 25 phases of heart MRI images. So my matrix dimensions are 128,128,65,25. Following the "connected threshold" example, I apply a CurvatureFlowImageFilter for smoothing and then ConnectedThreshold for segmenting the heart and aorta. Then I use Binary dilate over the mask to close the holes (for example between the vessels). 
> The question is that the dilate operation takes too much time (around 6 min) and I have noticed that is single-threaded. As the structuring elemente I was using binary ball and now I changed to a FlatStructuringElement(box) to speed up (as I could read in a forum), but it takes the same time. Given that kind of image, what variation could I make to have a fast dilation? What about gpu based methods? I have noticed that the radius 8 ball is the problematic, when I try 4 or 2 pixel radius it works much faster. 
> Thank you very much.
> 
> -- 
> José Ignacio Prieto
> celular(nuevo): 94348182
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list