From Slicer Wiki
Jump to: navigation, search
Home < Slicer3:Module:BinaryDilateOperations-Documentation

Return to Slicer Documentation

Binary Dilate Operations


Module Type&Category

This module is for performing dilation on binary images. The type of this module is CLI and is in the category of Segmentation of Slicer 3.

Authors, Collaborators & Contact

  • Author: Bike Kilic, MSc student in Northeastern University
  • Contact:

Module Description

This module aims to perform dilation method in order to make two different labeled separate objects closer to each other after erosion. At the end, we want to see these objects touched but not overwritten.

This method uses a structuring element in order to cover the object border with given foreground value. It grows the object with this structuring element. For this project, the structuring element is neighborhood structuring element with a radius size which is defined by the user.

For example, the results given in Screen shots part, the structuring element is neighborhood structuring element with radius 2. It took 7 iterations in order to get closer images with different colors.

The input of this module is the output of BinaryErodeOperations module at the beginning. For the following iterations, the input is the dilated binary image from the previous iteration.


Quick Tour of Features and Use

The GUI panel for BinaryDilateOperations Module after binary dilation

In this case, the eroded image which is the input for BinaryDilateOperations Module has the pixel value 255 inside and 0 outside.



The BinaryDilateOperations Module uses four ITK classes. One of them is for binary dilation, which is called itkBinaryDilateImageFilter [1]. Three of ITK classes which are included are used to create structuring elements. For ball structuring element, itkBinaryBallStructuringElement[2]; for cross structuring element itkBinaryCrossStructuringElement[3] and for neighborhood structuring element itkNeighborhood[4] are added.

In this project, for dilation the neighborhood structuring element has been chosen.

The Problems

In this module, the problems were stemmed from the choices of structuring element, the radius size of them. The performance of dilation depends on the properties of structuring element. The reason is that sometimes the shape of the binary image can not be preserved after dilation. For instance, the spheres data I used became had like a square shape if I used other structuring elements instead of neighborhood structuring element. Therefore, neighborhood structuring element was used in BinaryDilateOperations Module. However, if user wants to try others, the default value for structuring element should be changed from the code file. I could not also do it interactive.

Another problem which was encountered with is stemmed from being unable to use labeled images in dilation. Since the binary images are used in dilation, after more than 7 iterations, the spheres become overwritten again and so they can not be labeled differently at the end of the dilation if I use Editor module. Therefore, I lose the connectedness information between spheres which makes me unable to differentiate the different objects. However, even they become overwritten, the labels remain the same as I had after performing LabelBinaryImages module on the last eroded image( background is labeled as 0, the first sphere is labeled as 1 and the second one is labeled as 2).

The results can be observed as seen in the Screen shots section.

Screen shots

Binary Dilate Iterations with Neighborhood structuring element with radius 2
Binary Dilate with Ball Structuring element with radius 5
Binary Dilate with Cross Structuring element whose radius is 10

Although the above figure shows three steps in dilation, it took 7 steps in order to make them be closer to each other. The neighborhood structuring element with radius 2 was used in dilation process. In the second figure, the dilation result with ball structuring element which has the radius 5 can be seen. In comparison to the previous case, it took 5 steps in order to get the last dilated image. The third figure shows the dilation result with cross structuring element whose radius is 10. After 25 iterations I get the last dilated image. In this screen shots, we see the first, the 25th and the last dilated image. In the case of using cross structuring element,the shape of the image is damaged more than the dilation with neighborhood and ball structuring elements.


Future work

In this module, what we should improve is using effective structuring element. ITK has four different structuring elements which I have tried three of. A structuring element which stores an information of the shape of the whole image may be effective in this goal. On the other hand, if the data is noisy, any smoothing or enhancement method should be performed before erosion.

On the other hand, although BinaryDilateImageFilter class has been used for this project, another ITK class which is called itkFastIncrementalBinaryDilateImageFilter [5] can be used in order to make the dilation faster. I did not use that one because when I make it faster the spheres become overwritten, which I don't want to have in the conclusion.


  1. Gu L., Seminar Series on Advanced Medical Image Processing, Mathematical Morphology(1), 2002.
  2. Ibanez L.,ITK Architecture, ITK Basic Filters, 2006.
  3. Ibanez L.,ITK Architecture, ITK Segmentation Methods, 2000.
  4. Ibanez L., Schroeder W.,Ng L. & Cates J., The ITK Software Guide Second Edition Updated for ITK Version 2.4, 2005.
  5. Lehmann G., Binary Morphological closing and opening image filters, 2006.
  6. Lehmann G., Improving features and performance of binary erode and dilate filters, 2006.
  7. Vleeschouwer C., Morphology, 2007.[6]