Difference between revisions of "Slicer3:Module:Binary Morphological Operations-Documentation"

From Slicer Wiki
Jump to: navigation, search
Line 66: Line 66:
 
For thresholding. itkBinaryThresholdImageFilter class is included. The user chooses lower and upper threshold values.  
 
For thresholding. itkBinaryThresholdImageFilter class is included. The user chooses lower and upper threshold values.  
  
For morphological operations, itkBinaryDilateImageFilter and itkBinaryErodeImageFilter classes are used. In order to create structuring element, ITK classes are also used. BinaryBallStructuringElement, BinaryCrossStructuringElement and Neighborhood classes are included in this project. The radius is given by the user. The eroded and dilated values which are also given by the user indicates the foreground value. If user labels the image as 1 and 0 in the first step,  
+
For morphological operations, itkBinaryDilateImageFilter and itkBinaryErodeImageFilter classes are used. In order to create structuring element, ITK classes are also used. BinaryBallStructuringElement, BinaryCrossStructuringElement and Neighborhood classes are included in this project. The radius is given by the user. If user labels the image as 1 and 0 in the first step, the both erode and dilate value should be chosen as 1. Otherwise, if user wants to just threshold the image by using "BinaryThresholding" module, erode and dilate values should be the same as the upper value of the threshold. The reason is that these values represent the foreground value which is also the inner pixel value of the image.
  
 +
If the user wants to both binarize and label the image before morphological operations, the "LabelBinaryImages"
  
===Known bugs===
+
 
 +
===The problems===
  
 
===Source code & Documentation===
 
===Source code & Documentation===

Revision as of 18:09, 26 August 2008

Home < Slicer3:Module:Binary Morphological Operations-Documentation

Return to Slicer Documentation

Binary Morphological Operations

GENERAL INFORMATION

Module Type&Category

In order to implement morphological operations which are erosion and dilation, the four new modules have been integrated to Slicer 3 by using ITK commands which are explained in Module Description.The types of those modules are CLI and the category of them is Segmentation.

Authors, Collaborators & Contact

  • Author: Bike Kilic, MSc student in Northeastern University
  • Contact: kilicbike@gmail.com

Module Description

The modules in this framework are used in order to segment a given image by morphological operations:

-The first step is to binarize given gray-level image. The inside of the object is white and the outside is black. In order to do binarization, in this project there are two modules integrated into Slicer 3. The one called "LabelBinaryImages" uses general thresholding which makes the inside pixel equal to 1 and outside pixels equal to 0 and then creates a labeled binary image. The other one called "BinaryThresholding" thresholds the gray-level image by given upper and lower values in order to binarize the image. However in this case, the inside pixels values are 255 and the ones which are in the outside of the object have the value 0.

-After having binary image, the second step is performing erode operation to this image in order to make the different objects separate with the module called "BinaryErodeOperations". For instance, in this project I have two intersected spheres which are already binary image. However in order to make them smooth, the spheres are thresholded by general thresholding firstly and then by binary erode operation the spheres are totally separated to specify two different labels. The label map is created by using Editor module of Slicer 3.

-As we have two separate images, the dilation operation is used in order to make them touch each other but not onto each other. The name of the module is "BinaryDilateOperations". The aim of this module is to make the totally separated objects touch each other but not overwritten.

-The final step is to create the label map and make 3D model of touching but different labeled objects. The Editor and Model Maker modules are used in order to achieve this goal.

The output of the algorithms is two different labeled binary image.


USAGE

Examples, Use Cases & Tutorials

The "BinaryThresholding" module can be used in segmentation of foreground and background in an image. The problem might be stemmed from the values chosen for upper and lower threshold. In that case, the histogram equalization or some reconstruction methods can be used beforehand in order to enhance the image.

The "LabelBinaryImages" module is useful in order to find the connected pixels and label the image depending on the connectedness. After thresholding even we see different objects the program does not understand that they are different images so this module helps the program to label the objects in a binary image.

The morphological operations which are "BinaryErodeOperations" and "BinaryDilateOperations" can be used for several aspects such as segmentation, reconstruction, enhancement. What we have to be careful is choosing the best structuring element because both erosion and dilation depends on the structuring element. As I have seen in ITK documentation, there are three different structuring elements which are used for morphological operations. In this project, erosion is made by ball structuring element and the dilation uses neighborhood structuring element. The other included class for structuring element is binary cross structuring element. In addition to choosing structuring element, the properties of them have crucial role in the performance of these operations. For instance, if the radius of the binary ball structuring element is increased, the edge of the image has more square shape so it does not preserve the shape information. Therefore, in order to preserve the shape, some thresholding or smoothing algorithms can be performed.

Quick Tour of Features and Use

In the first step, the binary thresholding uses the gray level image as an input. In this project, our input is two intersected spheres with different radius sizes.

The second step, "BinaryErodeOperations", uses the output of binary thresholding which is a binary image as an input. This module should be repeated until we have two totally separate images because we need to create a label map and mark the different objects with different labels. The input for the repeated erosion is the eroded image from the previous one. User also identifies the radius size of structuring element.

The label map and label images are created by using Editor module. The input for label map is the last eroded image. After creating label map, the tools of Editor module help us to change the labels and create different labels. Then by using Model Maker, we can observe the separate images in 3D surface.

The next step is "BinaryDilateOperations". This module uses the last eroded image which is the output of BinaryErodeOperations as an input. Like erosion case, this module is also repeated until we get touched but not overwritten binary images. At the end of this method, what we want to see is to have different colored images which are touched each other.

The last step is again creating label map and 3D model by using Editor and Model Maker modules in order.

The input and output images of above algorithms are given in the Screen shots part.


DEVELOPMENT

Dependencies

The modules for thresholding and morphological operations are taken from ITK website, [1].

For thresholding. itkBinaryThresholdImageFilter class is included. The user chooses lower and upper threshold values.

For morphological operations, itkBinaryDilateImageFilter and itkBinaryErodeImageFilter classes are used. In order to create structuring element, ITK classes are also used. BinaryBallStructuringElement, BinaryCrossStructuringElement and Neighborhood classes are included in this project. The radius is given by the user. If user labels the image as 1 and 0 in the first step, the both erode and dilate value should be chosen as 1. Otherwise, if user wants to just threshold the image by using "BinaryThresholding" module, erode and dilate values should be the same as the upper value of the threshold. The reason is that these values represent the foreground value which is also the inner pixel value of the image.

If the user wants to both binarize and label the image before morphological operations, the "LabelBinaryImages"


The problems

Source code & Documentation

Screen shots

MORE INFORMATION

Results&Comments

Future work

References