Morphological Operations to Segment a Tumor from a Magnetic Resonance Image
Morphological Operations to Segment a Tumor from a Magnetic Resonance Image
Journal of information and communication convergence engineering. 2014. Mar, 12(1): 60-65
Copyright © 2014, The Korea Institute of Information and Commucation Engineering
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License ( which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • Received : June 25, 2013
  • Accepted : September 12, 2013
  • Published : March 31, 2014
Export by style
Cited by
About the Authors
Kiran, Thapaliya
Goo-Rak, Kwon

This paper describes an efficient framework for the extraction of a brain tumor from magnetic resonance (MR) images. Before the segmentation process, a median filter is used to filter the image. Then, the morphological gradient is computed and added to the filtered image for intensity enhancement. After the enhancement process, the thresholding value is calculated using the mean and the standard deviation of the image. This thresholding value is used to binarize the image followed by the morphological operations. Moreover, the combination of these morphological operations allows to compute the local thresholding image supported by a flood-fill algorithm and a pixel replacement process to extract the tumor from the brain. Thus, this framework provides a new source of evidence in the field of segmentation that the specialist can aggregate with the segmentation results in order to soften his/her own decision.
Segmentation of a brain tumor of magnetic resonance (MR) images is a difficult task that involves various disciplines, including pathology and magnetic resonance imaging (MRI) physics, a radiologist’s perception, and an image analysis based on intensity, shape, and size. There are several issues and challenges in the appropriate segmentation of a brain tumor. According to the data of the World Health Organization, more than 4,00,000 persons undergo the treatment for brain tumors every year. Tumors differ according to their shape, size, and location, and may appear at different places with different intensities. Therefore, it is very difficult to find the exact location of a tumor in the brain. The precise segmentation of brain tumors is of great interest. We can classify brain tumors as primary tumors called benign tumors, which do not spread elsewhere, and secondary, or malignant tumors, which spread from another location of the body to the brain. In order to detect a tumor in the brain, the patients in the hospital undergo diagnoses, such as computed tomography (CT) scans and MRI. Even though a radiologist performs these diagnoses, it is very difficult to distinguish a tumor in the brain due to the involvement of several kinds of abnormalities, noises, and intensities. Manual segmentation of brain tumors has been always time consuming and difficult, and may lead to the death of the patients in the case of improper identification. It is thus dangerous to perform manual segmentation in patients as its success depends on the examiner’s experience and skill. Thus, computer aid or an automatic method that makes it easier for the physician to examine a tumor in the brain needs to be developed.
Different methods and approaches have been proposed for the extraction of a brain tumor. Some of them are based on edge detection, clustering, basic watershed segmentation, region growth, and fuzzy logic. The edge detection technique works well for images that have a high intensity, but fails for low-contrast images due to a poor gradient magnitude as in [1] . Similarly, a clustering-based method such as k-means clustering is fast even in the case of a large dataset, but it does not provide the same result in each run due to the fact that it is dependent on the initial random assignments [2 , 3] . Although watershed segmentation is used vastly in the field of image segmentation, the main drawback is that it produces over-segmentation. In the region-growing approach, the initial value of the seed should be identified; therefore, there might be an error in choosing the seed value and the method suffers from a high time complexity. Hierarchical self-organizing map-based multiscale image segmentation proposed in [4] and the three-dimensional (3D) variational segmentation-based method proposed in [5] was also used for the image segmentation. In [6 , 7] , the researchers used artificial intelligence techniques for automated tumor segmentation. Statistical pattern recognition-based methods [8 - 12] fall short, partly because large deformations occur in the intracranial tissues due to the growth of the tumor and edema. The methods proposed in [8 - 12] detect abnormal regions by using a registered brain atlas as a modality for healthy brains. However, these techniques need to significantly modify the brain atlas to accommodate the tumors, which leads to poor outcomes. Most researchers today are using Markov random fields [12 - 16] , which involve the estimation of the parameters of a parametric model that has one set of parameters to express the probability that each specific vessel is a tumor, and another set to extract the distribution over the labels of a pair of adjacent corners.
Therefore, a method that can efficiently determine a tumor in the brain from MR images needs to be developed. In this paper, we propose an efficient method of extracting a brain tumor by using the morphological gradient and morphological operations [17 - 21] . The rest of this paper is organized as follows: Section II explains the proposed method and shows the stepwise techniques for the detection and extraction of a brain tumor. Experimental results are presented in Section III with the test images and their analysis followed by a conclusion in Section IV.
With respect to practical implementation, it is very difficult to obtain only the tumor part of a different MR image. Therefore, we need a new method to extract the tumor part easily. The proposed method can extract the tumor part of an MR image easily and efficiently. The flow chart of the proposed method is shown in Fig. 1 . The detailed procedure is described below.
- A. Image Preprocessing
Medical images may contain a considerable amount of noise, dirt, and debris, which affects the process of segmentation. Therefore, it is very important to remove the noise from images that a doctor uses to appropriately examine a tumor. Therefore, the first step of image segmentation is the removal of the noises present in an image. A median filter is used here because it preserves the sharp edges of the image.
- B. Morphological Gradient and Image Enhancement
Morphological operations, such as dilation and erosion for grayscale images, are defined in terms of the minima and the maxima of pixel neighborhoods and are used for the computation of the slope of the filtered image. The grayscale equation for the dilation of 𝑓 by structuring element b , denoted by (𝑓 ⊕ b ), is defined as follows:
PPT Slide
Lager Image
PPT Slide
Lager Image
Detailed process of the proposed method
where Db denotes the domain of b and 𝑓(𝑥,𝑦) .𝑓 represents the filtered image. (𝑥 − 𝑥') and 𝑦 − 𝑦' have to be in the domain of 𝑓, and 𝑥' and 𝑦' in the domain of b . Flat grayscale dilation is denoted a local maximum operator whose maximum is computed over a set of pixel neighbors determined by the shapes of Db .
Analogously, the grayscale equation for the erosion of 𝑓 by the structuring element b , denoted by ( 𝑓 ⊕ b ) is defined as follows :
PPT Slide
Lager Image
Flat grayscale erosion is denoted by a local minimum operator whose minimum is computed over a set of pixel neighbors determined by the shapes of Db .
Now, the morphological gradient of the image can be calculated as follows:
PPT Slide
Lager Image
The image enhancement in the proposed method is done with the addition of Morph_gra and the filtered image Filt_img.
PPT Slide
Lager Image
where I 1 denotes the eventuate image after the addition of the Morph _gra gradient image and the Filt_img median-filtered image.
- C. Image Binarization
The image is binarized using the threshold value. In the proposed algorithm, the threshold value is computed using the mean and the standard deviation of image I 1 . The mean and the standard deviation of image I 1 is calculated by using the following equation:
PPT Slide
Lager Image
PPT Slide
Lager Image
where μ and σ are the mean and the standard deviation of image I 1 and Filt _ img ( x,y ). In Eq. (5), we calculate the mean value of each column in image I 1 and choose the maximum mean value.
Again, the mean value is calculated using the morpho-logical gradient image Morph_gra as follows:
PPT Slide
Lager Image
where μ 1 denotes the mean value of the gradient image Mor_gra. After the mean and the standard deviation of the image are calculated, the thresholding value is determined using the following equation:
PPT Slide
Lager Image
where μ and σ denote the mean and the standard deviation of image I 1 and Filt _img ( x, y ) ; μ 1 represents the mean value of the gradient image Mor_gra. T denotes the thresholding value used to binarize the image as an initial step of the proposed algorithm. Now, we can obtain the binarized image by using the thresholding value T as follows:
PPT Slide
Lager Image
- whereTdenotes the thresholding value andI2(x, y) represents the binarized image obtained using Eq. (9).
- D. Calculation of Local Thresholding Value
In the proposed method, closing and opening operations are used to calculate the thresholding value. Closing and opening operations are the two important parts of morphological operations. A closing operation is used to smooth the contour sections. It generally fuses narrow breaks and long, thin gulfs, eliminates small holes, and fills gaps in the contour.
The closing of set I 2 by structuring element B , denoted as I 2 B , is defined as follows:
PPT Slide
Lager Image
The closing of I 2 by B is simply the dilation of I 2 by B , followed by the erosion of the result by B . Denote the result of the closing operation as Iclose .
Opening operations smooth the contour of an object, break narrow isthmuses, and eliminate thin protrusions. Similarly, the opening of set I close by the structuring element B , denoted as Iclose.
PPT Slide
Lager Image
B , is defined as follows:
PPT Slide
Lager Image
Thus, opening Iclose by B is the erosion of Iclose by B , followed by a dilation of the result by B . Denote the result of the above opening result as Iopen .
Now, by using the closing and opening operations, we can calculate the local thresholding value as follows:
PPT Slide
Lager Image
where Iclose and Iopen denote the closed and the opened image, respectively. Ilthresh represents the local thresholding image.
Once the local thresholding image Ilthresh is calculated, we can segment image I 2 that is closed and opened to remove the unnecessary objects present in the image. This process is performed by comparing images I 4 and I 7 .
PPT Slide
Lager Image
where I 3 ( x , y ) denotes the binarized image obtained after comparing image I 2 and the local thresholding image Ilthresh .
- E. Flood-Fill Algorithm and Pixel Replacement
Flood fill, also called seed fill, is an algorithm that determines the area connected to a given node in a multidimensional array. This algorithm takes three initial values: a start node, a target color, and a replacement color.
In the first step, this algorithm looks for nodes in the array that are connected to the start node via the path of the target color and changes them to the replacement color. There are several ways in which a flood-fill algorithm can be structured, but they all make use of a queue or a stack data structure, explicitly or implicitly.
The queue-linear flood-fill algorithm is adopted in our application [12] . We apply the queue-linear flood-fill algorithm to the binarized image I 3 ( x ,y ) . Suppose that the image that we obtained after applying the queue-linear flood-fill algorithm is I 4 ( x, y ) . Finally, pixel replacement is done to get the desired output tumor-segmented image. The pixel replacement is performed as follows:
PPT Slide
Lager Image
where 𝑓( x , y ) is the original image and I 4 ( x , y ) is the extracted tumor image.
The proposed method was tested with different MR images. Images used for the experiment are of brain tumors of different shapes, sizes, and intensities. The new method was tested in comparison with the method proposed by Singh and Dubey [20] for the extraction of a brain tumor. The experimental results proved that the proposed method performs better than the method developed by [20] for the extraction of a brain tumor from the MR images. The proposed algorithm was tested using MATLAB 2010. Fig. 2 shows the different images obtained at different steps of the proposed method. Fig. 3(a) - (h) shows the experimental results obtained in the cases of different images containing a tumor.
PPT Slide
Lager Image
Images at different stages of the proposed method: (a) original image, (b) filtered image, (c) morphological gradient image, (d) enhanced Image, (e) binarized image of I1 obtained using Eq. (9), (f) output image obtained using Eq. (14), (g) image obtained after the execution of the flood-fill algorithm, (h) tumor extracted using the proposed method, and (i) tumor extracted using the method proposed by [20].
PPT Slide
Lager Image
Original image and finally segmented tumor image. (a), (d), and (g) show the original images; (b), (e), and (h) show the tumor image finally extracted using the proposed method; and (c), (f), and (i) show the images extracted using method proposed by [20].
Values of different parameters used in brain tumor segmentation
PPT Slide
Lager Image
SD: standard deviation.
Table 1 presents the values of different parameters. The values of these parameters for different images are used for the extraction of the brain tumor by using the proposed algorithm. Table 2 lists the time consumed to run both the algorithms. It is clear from Table 2 that the proposed method takes less time in comparison to the method proposed by [20] to efficiently extract the tumor. In the entire experimental process, the structuring element used in the morphological operation has a disk shape and a value of 3.
The time complexity of the proposed method and the method proposed by[20]
PPT Slide
Lager Image
The time complexity of the proposed method and the method proposed by [20]
In this paper, an algorithm for the efficient extraction of a brain tumor from an MR image has been introduced. This algorithm is based on mathematical morphology and thresholding. Opening and closing operations helped to reduce some artifacts from the MR image. The thresholding process was used to convert the image into a binary form. The results are presented as images with a brain tumor and images showing the extraction of the affected region of the brain. The proposed method is invariant in terms of the size, shape, intensity, and location of the brain tumor. This method is simple and easy to understand. Experimental results indicated that the proposed method performed well in enhancing and retaining the shape of the original brain tumor and in segmenting the brain tumor from the MR image.
The proposed method can efficiently extract a tumor from the MR images of the brain and paves the way for an expert to decide whether the extracted tumor is benign or malignant on the basis of certain pathological features. This will be the subject of further research.
This study was supported by research funds from Chosun University, 2013.
Kiran Thapaliya received his M.S. degree from Department of Information and Communication Engineering, Chosun University, South Korea, in 2012. He is currently pursuing his Ph.D. at Chosun University. His research interests include biomedical image processing, image enhancement, object recognition, and image segmentation.
Goo-Rak Kwon received his M.S. in Electronic Engineering from Sungkyunkwan University in 1999. He received his Ph.D. in Mechatronic Engineering from Korea University in 2007. Further, he served as Chief Executive Officer and Director of Dalitech Co. Ltd. from May 2005 to February 2007. In 2008, he joined the Department of Information and Communication Engineering at Chosun University, Gwangju, Korea, where he is currently an associate professor. His research interests include A/V signal processing, multimedia communication, and the applications of these technologies.
Health M. D. , Sarkar S. , Sanocki T. , Bowyer K. W. 1997 “A robust visual method for assessing the relative performance of edgedetection algorithms,” IEEE Transactions on Pattern Analysis and Machine Intelligence 19 (12) 1338 - 1359
Murugavalli S. , Rajamani V. 2006 “A high speed parallel fuzzy Cmeans algorithm for tumor segmentation,” ICGST International Journal on Bioinformatics and Medical Engineering 6 (1) 29 - 34
Dewalle-Vignion A. S. , Betrouni N. , Makni N. , Huglo D. , Rousseau J. , Vermandel M. 2007 “A new method based on both fuzzy set and possibility theories for tumor volume segmentation on PET images,” in Proceedings of the 30th Annual International Conference of IEEE Engineering in Medicine and Biology Society 3122 - 3125
Bhandarkar S. M. , Nammalwar P. 2001 “Segmentation of multispectral MR images using a hierarchical self-organizing map,” in Proceedings of the 14th IEEE Symposium on Computer-Based Medical Systems 294 - 299
Jiang C. , Zhang X. , Huang W. , Meinel C. 2004 “Segmentation and quantification of brain tumor,” in Proceedings of the IEEE Symposium on Virtual Environments, Human-Computer Interfaces and Measurement Systems 61 - 66
Clark M. C. , Hall L. O. , Goldgof D. B. , Velthuizen R. , Murtagh F. R. , Silbiger M. S. 1998 “Automatic tumor segmentation using knowledge-based techniques,” IEEE Transactions on Medical Imaging 17 (2) 187 - 201
Fletcher-Heath L. M. , Hall L. O. , Goldgof D. B. , Murtagh F. R. 2001 “Automatic segmentation of non-enhancing brain tumors in magnetic resonance images,” Artificial Intelligence in Medicine 21 (1-3) 43 - 63
Moon N. , Bullitt E. , Van Leemput K. , Gerig G. 2002 “Model-based brain and tumor segmentation,” in Proceedings of the 16th International Conference on Pattern Recognition 528 - 531
Otsu N. 1979 “A threshold selection method from grey-level histogram,” IEEE Transactions on System, Man and Cybernetics 9 (1) 62 - 66
Prastawa M. , Bullitt E. , Ho S. , Gerig G. 2004 “A brain tumor segmentation framework based on outlier detection,” Medical Image Analysis 8 (3) 275 - 283
Stokking R. , Vincken K. L. , Viergever M. A. 2000 “Automatic morphology-based brain segmentation (MBRASE) from MRI-T1 Data,” NeuroImage 12 (6) 726 - 738
Iftekharuddin K. M. , Zheng J. , Islam M. A. , Ogg R. J. 2009 “Fractal-based brain tumor detection in multimodal MRI,” Applied Mathematics and Computation 207 (1) 23 - 41
Iscan Z. , Dokur Z. , Olmez T. 2010 “Tumor detection by using Zernike moments on segmented magnetic resonance brain images,” Expert Systems with Applications 37 (3) 2540 - 2549
Taheri S. , Ong S. H. , Chong V. F. H. 2010 “Level-set segmentation of brain tumors using a threshold-based speed function,” Image and Vision Computing 28 (1) 26 - 37
Corso J. J. , Sharon E. , Dube S. , El-Saden S. , Sinha U. , Yuille A. 2008 “Efficient multilevel brain tumor segmentation with integrated Bayesian model classification,” IEEE Transaction on Medical Imaging 27 (5) 629 - 640
Li C. , Kao C. Y. , Gore J. C. , Ding Z. 2008 “Minimization of region-scalable fitting energy for image segmentation,” IEEE Transactions on Image Processing 17 (10) 1940 - 1949
Kiran T. , Kwon G. R. 2011 “An advanced segmentation using bitplane slicing technique in extraction of lungs region,” in Proceedings of the 2nd Asian Himalayas International Conference on Internet
Kiran T. , Park I. C. , Kwon G. R. 2011 “An efficient extraction of pulmonary parenchyma in CT images using connected component labeling,” International Journal of Information and Communication Engineering 9 (6) 661 - 665
Kiran T. , Kwon G. R. 2012 “Extraction of brain tumor based on morphological operations,” in Proceedings of the 8th International Conference on Computing Technology and Information Management 515 - 520
Singh L. , Dubey R. B. , Jaffery Z. A. 2009 “Segmentation and characterization of brain tumor from MR images,” in Proceedings of International Conference on Advances in Recent Technologies in Communication and Computing 815 - 819
Thapaliya K. , Pyun J. Y. , Park C. S. , Kwon G. R 2013 “Level set method with automatic selective local statistics for brain tumor segmentation in MR images,” Computerized Medical Imaging and Graphics 37 (7) 522 - 537