Medical Image Enhancement Using Morphological Transformation

Medical imaging includes different modalities and processes to visualize the interior of human body for diagnostic and treatment purpose. However, one of the most common degradations in medical images is their poor contrast quality and noise. The existence of several objects and the close proximity of adjacent pixels values make the diagnostic process a daunting task. The idea of image enhancement techniques is to improve the quality of an image. In this study, morphological transform operation is carried out on medical images to enhance the contrast and quality. A disk shaped mask is used in Top-Hat and Bottom-Hat transform and this mask plays a vital role in the operation. Different types and sizes of medical images need different masks so that they can be successfully enhanced. The method shown in this study takes a mask of an arbitrary size and keeps changing its size until an optimum enhanced image is obtained from the transformation operation. The enhancement is achieved via an iterative exfoliation process. The results indicate that this method improves the contrast of medical images and can help with better diagnosis.


Introduction
The field of digital image processing refers to processing digital images by means of a digital computer.In image processing operations, both the input and the output are images.Medical Image Processing and its applications in Computer Assisted Diagnoses (CAD) and therapy (e.g.Computer Assisted Surgery-CAS) are of in-creasing importance in modern medicine.Medical Image Enhancement is the art of examining images for identifying objects and judging their significance.
Most of the medical images (X-ray, CT, and MRI) have very low contrast and the challenge is to sharpen them.The effort on medical image enhancement has been focused mostly to improving visual perception of images that are unclear because of blur.Edges are the representations of the discontinuities of image intensity functions.For processing these discontinuities in an image, a good edge enhancement technique is essential.
Medical images enhancement is an important work for object recognition of the human organs such as lungs and ribs, and it is an essential pre-processing step in medical image segmentation [1] [2].The work of contrast enhancement decides the result of the final processed image.Conventionally, edge is detected according to some early brought forward algorithms like Sobel algorithm, Prewitt algorithm and Laplacian of Gaussian operator [3], but in theory they belong to the high pass filtering, which are not fit for noise medical image edge detection because noise and edge belong to the scope of high frequency.In real world applications, medical images contain object boundaries and object shadows and noise.Therefore, they may be difficult to distinguish the exact edge from noise or trivial geometric features.Mathematical morphology is a new mathematical theory which can be used to process and analyze the images [4]- [7].It provides an alternative approach to image processing based on shape concept.
Medical image enhancement technologies have attracted much attention since advanced medical equipments were put into use in the medical field.Enhanced medical images are desired by a surgeon to assist diagnosis and interpretation because medical image qualities are often deteriorated by noise and other data acquisition devices, illumination conditions, etc.Also targets of medical image enhancement are mainly to solve problems of low contrast and the high level noise of a medical image.Medical image enhancement technologies have attracted many studies [8].The basic color space (RGB) conversion to other color spaces is important mainly concentrated on the edges enhancement of medical color image.
In the mathematical morphology theory, images are treated as sets, and morphological transformations which derived from Minkowski addition and subtraction are defined to extract features in images [9].As the performance of classic edge detectors degrades with noise, morphological edge detector has been studied [10].In this paper, a novel mathematical morphology edge detection algorithm is proposed based on using multi shape approach whose information at various shapes is integrated to detect medical image edge.MATLAB was used here as the image processing tool like other research article [11].

Medical Image Enhancement
Medical imaging is the technique and process of creating visual representations of the interior of a body for clinical analysis and medical intervention.Medical imaging seeks to reveal internal structures hidden by the skin and bones.It also makes possible the identification of abnormalities.
Medical imaging encompasses different imaging modalities and processes to image the human body for diagnostic and treatment purposes and therefore plays an important role in initiatives to improve public health for all population groups.It is crucial at all major levels of health care.In public health and preventive medicine as well as in both curative and palliative care, effective decisions depend on correct diagnoses.
Image enhancement is a process principally focuses on processing an image in such a way that the processed image is more suitable than the original one for the specific application.The word "specific" has significance.It gives a clue that the results of such an operation are highly application dependent.In other words, an image enhancement technique that works well for X-ray topographic images may not work well for MR images.
Image enhancement approaches fall into two broad categories: spatial domain methods and frequency domain methods.The term spatial domain refers to the image plane itself, and approaches in this category are based on direct manipulation of pixels in an image.Frequency domain processing techniques are based on modifying the Fourier transform of an image.The process can be expressed as: g(x, y) = T[f (x, y)], where f(x, y) is the input image, g(x, y) is the processed image, and T is an operator on f defined over some neighborhood of (x, y).The principal approach in defining a neighborhood about a point (x, y) is to use a square or rectangular subimage area centered at (x, y).The center of the subimage is moved from pixel to pixel starting, say, at the top left corner.The operator T is applied at each location (x, y) to yield the output, g, at that location.The process utilizes only the pixels in the area of the image spanned by the neighborhood.
One method to enhance a medical image is wavelet transformation [12].In this method, the high-frequency sub-images are decomposed using the Haar wavelet transform.Then, noise in the high-frequency sub-bands is reduced using soft-thresholding.Finally, the enhanced image is obtained using inverse wavelet transformation.
Another common method for medical image enhancement is histogram equalization [13] that enhances the contrast of image by increasing distribution of gray levels.This method does not necessarily obtain good results for all areas of an image because contrast enhancement may damage the image and the border areas.Because of this, there are different generalizations of this method to improve its performance [14] [15].An algorithm for improving abdominal ultrasound images is proposed based on combination of histogram equalization and wavelet transformation in [16].This algorithm improves edges and surroundings of abdominal walls and has real time performance in dynamic applications.Another method for medical image enhancement is Gamma correction [17].In this method, Gamma values of individual pixels are locally optimized by minimizing the homogeneity of co-occurrence matrix of the original image.The Gamma correction method enhances dynamic range and improves the image.
Morphological filters [18] are used for sharpening medical images.In this method, after locating edges by gradient-based operators, a class of morphological filter is applied to sharpen the existing edges.In fact, morphology operators, through increasing and decreasing colors in different parts of an image, have an important role in processing and detecting various existing objects in the image.Locating edges in an image using morphology gradient is an example that has comparable performance with that of classic edge-detectors such as Canny and Sobel [19].

Morphological Transform
Methods of mathematical morphology act based on the structural properties of objects.These methods use mathematical principles and relationships between categories to extract the components of an image, which are useful in describing the shape of zones.Morphological operators are nonlinear, and two sets of data are their input.The first set contains the original image and the second one describes the structural element (mask).The original image is binary or in gray level and the mask is a matrix containing zero and one values.
It is after applying the final image to the morphological operators that a new value for each pixel is obtained through sliding the mask on the original image.Value 1 in each mask indicates effectiveness and value 0 indicates ineffectiveness in the final image.Different formats can be selected to form a mask.Figure 1 shows a disk-shaped mask with radius of 4 (9 * 9 matrix).

Morphological Operators
If A (x, y) and B (u, v) describe the gray-level image matrix and the structural element matrix respectively, erosion and dilation operators are defined as (1) and ( 2): The erosion operator reduces the size of objects.This operator increases the size of holes in an image and removes very small details of that image.Removing bright areas under the mask makes the final image looks darker than the original image.The dilation operator acts in reverse; in other words, it increases and decreases the size of objects and holes in the image respectively.The opening operator is equivalent to the application of the erosion and dilation operations on the same image respectively (Equation ( 3)) while the closing operator acts in reverse (Equation ( 4)): ( ) The opening operator removes weak connections between objects and small details while the closing operator removes small holes and fills cracks.

Selecting a Proper Mask
Selecting a mask in proper shape and size to take morphological actions has a key role in achieving desired results and reducing calculation time.In general, the shape and size of a mask are arbitrarily selected; however, the selected mask should be in appropriate shape and size for various diagnosis purposes.Disk-shaped masks (Figure 1) are more commonly used for medical images than other masks.As stated before, since disk-shaped masks are independent of changes in rotation, they are chosen for medical images.Since big or small masks strengthen or weaken various parts of an image, it is impossible to gather detailed information on the contrast of different images using only one structural element.This is why one mask in a particular shape and size may not appropriate for other applications [9].In the proposed method, the change in shape and size of the mask continues until an appropriate result obtained.It should be mentioned that past experiences have key roles in selecting proper masks to take morphological actions.

Top-Hat Transforms
These transforms are used to enhance the contrast of images through morphological methods and are in two general types: Top-Hat transform is obtained by subtracting the opening of the original image from the image itself (Equation ( 5)) and Bottom-Hat transform is obtained through subtracting the original image from its closing (Equation ( 6)) [20]: itself [22].It is possible to add the bright areas (the results of the opening operator) to the image and subtract the dark areas (the results of the closing operator) from it.As a result, there will be an enhancement in the contrast between bright and dark areas:

Methodology
In the research Morphological Transform was implementing in MATLAB.At first we read the original image and calculate its CNR.We will require this CNR value to compare in the next steps.
In the next step, we set an arbitrary structural element.We transform the original image and calculate CNR and PSNR values and store them.We compare this CNR value with the original image CNR value and if latter is larger we increase the size of structural element.Then we transform and calculate CNR and PSNR again and compare the current CNR value with the previous one.If the current value is larger we increase the size of structural element again.This goes on like a loop until we reach a point where the last CNR value is smaller than the previous one.We then set a structural element that is smaller than the last one and also set new end value and step of the loop to find out the structural element for whom the image has largest CNR value, meaning the image enhancement is optimum.The value we get at last is the size of our structural element for whom the original image is getting enhanced most.The number of steps and time taken to complete the operation is dependent on a few factors like size of the image, image source, initial condition, amount of noise etc. Figure 3 shows the flowchart of the whole process.

Results and Discussion
From Figure 4(a) and Figure 4(b) we can see that optimum enhanced image is much clearer than the original image.This enhancement in contrast is the result of morphological transform carried out on the original image.We tried several masks and mask with a radius of 46 yielded the best result in this scenario.From Figure 4(c) and Figure 4(d) we can see that these have enhanced contrast than the original image but none of them are optimum.Optimum enhanced image is clearer than both of them.Also, image enhanced with mask radius 70 has more darker spots along the edges although it worked better than mask with radius 30.
From Figure 5 we can see that optimum enhanced image has more uniform intensity distribution than other images.It has its darker pixels optimized and distributed over the whole image as a result of morphological transform carried out on the original image.We also see that mask with a radius of 46 provided best results.Figure 6 represents the CNR values at different sizes of the structuring element.The highest CNR value is achieved when the structuring element has a radius of 46.
Figure 7 demonstrated IVU bilateral elongated nephrograms with minimal irregularity of the renal outline.There is complete bilateral duplication of the renal collecting system to include duplication of the renal pelvis and uterus.The bilaterally duplicated uterus independently enters the bladder, and thus 4 UVJs are demonstrated.A small ureterocele of the right lower pole uterus is demonstrated at the confluence with the bladder.From above two images we can see that optimum enhanced image is much clearer than the original image.This enhancement in contrast is the result of morphological transform carried out on the original image.We tried several masks and mask with a radius of 16 worked best for this particular image.
From Figure 7(c) and Figure 7(d) we can see that both images are clearer than the original and transformed image-2 shows better contrast than Transformed image-1 but has started growing darker pixels and hence it is not accepted as the final image.The morphological transform carried out on the original image increased the overall contrast and in the way also created some dark pixels which made portions of the second image opaque and hard to determine the actual structure.
From Figure 8 we can see that optimum enhanced image has uniform intensity distribution than other images.It has its darker pixels optimized and distributed over the whole image as a result of morphological transform carried out on the original image.We also see that mask with a radius of 46 provided best results.There are less number of peaks indicating that overall contrast is increased (Table 1).
We can see from Figure 9 that all three transformed images are clearer than the original but only one of them is optimum.Other two images have either less contrast than the optimum image or increased amount of dark    spots which make it harder to see the internal structure.This enhancement in contrast is the result of morphological transform carried out on the original image.We tried several masks and mask with a radius of 36 worked best.
From Figure 10 we can see that optimum enhanced image has uniform intensity distribution than other images.It has fewer amounts of dark pixels and increased number of bright pixels.This enhancement in contrast is the result of morphological transform carried out on the original image.We tried several masks and mask with a radius of 36 yielded the best result (Table 2).
From Figure 11 we can see that all three processed images better contrast than the original image but optimum enhanced image has its edges preserved which is important.Transformed image-2 is also enhanced but it has dark pixels along the edges of the left ear which has blurred its edge (Table 3 and Table 4).
From Figure 12 we can see that optimum enhanced image has uniform intensity distribution than other images.It has its darker pixels optimized and distributed over the whole image as a result of morphological transform carried out on the original image.There is less number of peaks indicating that overall contrast is increased.We tried several masks and mask with a radius of 154 worked best in this scenario.

Conclusion
We observed the application of morphological transform in image manipulation.Contrast of various medical images can be enhanced using this method.We implemented this technique using Image Processing Toolbox in MATLAB.The processed images are created by adding the Top-Hat transformation of the original image to the original image and then subtracting the Bottom-Hat transformation from it.For both these transforms, we used a structural element of arbitrary size at first and then increased it stepwise to achieve a value that gave optimum contrast enhancement for the image that we were working with.We also calculated contrast-to-noise ratio to compare two processed images.The newly created images show better contrast as we see than the original images.This is due to the morphological operations carried out on the pixels.This technique can be used to enhance various medical images that can help medical practitioners with better diagnosis and treatment which are invaluable to improve public health.

Figure 2 .
Figure 2. General idea in Top-Hat transform.(a): Cross-section of the transform; (b): Parameters of the transform.

Table 1 .
Showing CNR and PSNR values after transforming the image with various sized structural elements.

Table 2 .
Showing CNR and PSNR values after transforming the image with various sized structural elements.

Table 4 .
CNR and PSNR values after transforming the image with various sized structural elements (110 to 170).