Processing_MRI_Brain_Image_using_OpenMP
Processing_MRI_Brain_Image_using_OpenMP
Abstract— The medical diagnosis of most pathologists short time periods. Parallel computing provides concurrency
requires the analysis of the image studies. Therefore, it is and by this we can use non-local recourses very efficiently. It
important to get the best quality of the images without noise and also removes the limit of serial computing.
highlight the details of tissues. The principal aim of this work is
Medical image processing has experienced dramatic
to apply different algorithms and filters to reduce the noise of
magnetic resonance brain images, due to the noise in these can expansion and has been an interdisciplinary research field
cause to give a difficult diagnosis. The algorithms considered in attracting expertise from applied mathematics, computer
this work are the fast mean filter, fast Gaussian filter, and fast sciences, engineering, statistics, physics, biology and
median filter; also was used parallel programming in OpenMP. medicine. Computer-aided diagnostic processing has already
The results show that the parallel implementation of algorithms become an important part of clinical routine. Accompanied
has more performance in the time processing, localization, and
by the rush of new development of high technology and use
noise reduction than sequential and classic implementation.
of various imaging modalities, more challenges arise; for
Index Terms— MRI brain image, fast mean filter, fast median example, how to process and analyze a significant volume of
filter, fast gaussian 2D, parallel programming, OpenMP. images so that high quality information can be produced for
disease diagnoses and treatment.
I. INTRODUCTION One of the recent innovations in computer engineering has
potential: blood flow imaging and quantification, and Classic and fast median filter
functional neuroimaging based on exploiting dynamic Classic median filter replaces the value of a pixel spectrum
changes in the magnetic susceptibility. by the median of the spectrum levels in the neighborhood of
Additionally, MRI technique has become a critically that pixel.
important tool in diagnosis and differentiation of different Median filtering is a commonly applied non-linear filtering
demyelinating disorders, because it offers high-resolution technique that is particularly useful in removing speckle and
images in a noninvasive and safe method, without exposing salt and pepper noise. It works by moving through the image
patients to ionizing radiation. Thus, MRI uses magnetic field pixel by pixel, and replacing each value with the median
gradients to modify the frequency and phase of the MR signal
in a controlled manner. The images are reconstructed through
mathematical algorithms to convert the collected MR signals
into spatial information [1-12].
2 2
about three standard deviations from the mean. Thus it is OpenMP is an API that implements a multi-threaded,
possible to truncate the kernel size at this point. Sometimes shared memory form of parallelism. It uses a set of compiler
kernel size truncated even more. Thus after computation of directives that are incorporated at compile-time to generate a
Gaussian Kernel, the coefficients must be corrected that way multi-threaded version of program code. OpenMP is designed
that the sum of all coefficients equals 1. Once a suitable for multi-processor/core, shared memory machines [20-24].
kernel has been calculated, then the Gaussian smoothing can Measure PSNR and SSIM
be performed using standard convolution methods. The Any processing applied to an image may cause an
convolution can in fact be performed fairly quickly since the important loss of information or quality. Image quality
equation for the 2-D isotropic Gaussian is separable into y evaluation methods can be subdivided into objective and
and x components. In some cases the approximation of subjective methods. Subjective methods are based on human
Gaussian filter can be used instead of classic version [13-19]. judgment and operate without reference to explicit criteria.
Objective methods are based on comparisons using explicit
numerical criteria, and several references are possible such as
the ground truth or prior knowledge expressed in terms of
statistical parameters and tests.
The next equations show the relationship between the
SSIM (structural similarity index measure) and the PSNR
(peak-signal-to-noise ratio) for grey-level (8 bits) images.
Given a reference image f and a test image g, both of size
M×N, the PSNR between f and g is defined by:
2552
𝑃𝑆𝑁𝑅(𝑓, 𝑔) = 10𝑙𝑜𝑔10 ( )
𝑀𝑆𝐸(𝑓, 𝑔)
where
𝑀 𝑁
1 2
𝑀𝑆𝐸(𝑓, 𝑔) = ∑ ∑(𝑓𝑖𝑗 − 𝑔𝑖𝑗 )
𝑀𝑁
𝑖=1 𝑗=1
𝑇
2
1
𝜎𝑥𝑦 = ∑(𝑥𝑖 − 𝑥̅ ) (𝑦𝑖 − 𝑦̅)
𝑇−1
𝑖=1
Thirdly, luminance, contrast, and structure comparisons
based on statistical values are computed, the structural
similarity index measure between images x and y is given by:
(2𝜇𝑥 𝜇𝑦 + 𝑐1 )(2𝜎𝑥𝑦 + 𝑐2 )
𝑆𝑆𝐼𝑀(𝑥, 𝑦) = 2
(𝜇𝑥 + 𝜇𝑦2 + 𝑐1 )(𝜎𝑥2 + 𝜎𝑦2 + 𝑐2 )
where c1 and c2 are constants [25].
TABLE I. larger than 5×5. Acceleration with the usage of four threads
PSNR EVALUATION_OPTIMIZED FILTERS IN dB
demonstrates reduced efficiency as parts of the CPU
Noise data Kernel Filter
Level PSNR Size Mean Gauss Median resources are spent on background tasks.
3×3 26,4499 26,6162 31,4632
5×5 25,4441 26,3348 26,0941
10% 19,4337 7×7 24,4246 25,9878 24,0914
9×9 23,9051 25,9163 23,5251
11×11 23,4213 25,9019 23,0034
3×3 25,0951 25,2115 31,3586
5×5 24,6368 25,4533 25,7129
15% 17,7498 7×7 24,0103 25,3044 24,1180
9×9 23,5739 25,2658 23,5490
11×11 23,1413 25,2572 23,0291
3×3 23,9026 23,9860 31,0633
5×5 24,0798 24,6117 26,1548
20% 16,4937 7×7 23,5122 24,5513 24,1792 a) b)
9×9 23,1564 24,5395 23,6019
11×11 22,7774 24,5358 23,0754
3×3 23,0048 23,0674 30,8252
5×5 23,4580 23,8787 26,1362
25% 15,6150 7×7 23,0348 24,2929 24,2111
9×9 22,7388 24,1965 23,6280
11×11 22,4073 23,8957 23,1053
TABLE II
SSIM VALUES (%) OPTIMIZED FILTERS
Noise data Kernel Filter
Level SSIM Size Mean Gauss Median
3×3 52,5261 52,9341 98,9732 c) d)
5×5 56,8031 58,4583 96,8460 Fig. 8. Processing image with noise using openMP: (a) original noise image
10% 30,8309 7×7 55,3762 59,2824 94,6519 (b) Mean filter; (c) Gaussian Filter; (d) Median filter.
9×9 52,2012 59,1818 92,5806
11×11 48,9455 59,1173 90,5115 TABLE III
3×3 40,5656 40,9190 98,7282 THE ACCELERATION COEFFICIENT OF FAST FILTERS IN
5×5 45,6737 47,3892 96,3257 PARALLEL MODE RELATIVE TO CLASSIC IMPLEMENTATION FOR
15% 20,3248 7×7 45,0116 48,2220 94,5730 IMAGE 2140×1740
9×9 42,2631 48,1409 92,5113 Kernel size
11×11 39,3629 48,0626 90,4537 Threads 3×3 5×5 7×7 9×9 11×11
3×3 32,5422 32,8148 98,1682 Mean Filter
5×5 38,5104 39,4721 96,6738 2 2,675 4,056 5,713 6,950 8,548
20% 14,6082 7×7 38,5305 40,8086 94,4997 3 3,784 5,334 7,872 10,037 12,173
9×9 36,5191 40,8399 92,4367 4 3,850 6,454 7,737 10,816 11,979
11×11 34,1926 40,7849 90,3801 Gaussian Filte
3×3 27,5511 27,7515 97,3491 2 1,862 3,447 5,517 6,883 9,382
5×5 34,0901 34,7222 96,5549 3 2,379 4,775 7,544 10,080 11,866
25% 11,4076 7×7 34,9439 36,4118 94,4181 4 2,723 5,243 8,101 10,994 13,182
9×9 33,5629 36,5819 92,3665 Median Filter
11×11 31,6682 36,5630 90,3168 2 9,947 21,101 33,756 47,442 64,712
3 13,221 26,773 41,607 68,399 88,632
4 14,220 30,719 47,108 79,472 94,799
Visual results of filtered noise modeled MRI brain image
shown in Fig. 8. To create examples of noise suppression for TABLE IV
fast filters demonstrated on noise map processing, a second THE ACCELERATION COEFFICIENTS OF FAST FILTERS FOR
image was produced at 20% of the original image size for IMAGE 2140×1740
demonstration of filters processing selected (5×5). Kernel size
Threads 3x3 5x5 7x7 9x9 11x11
The overall average acceleration of fast filters (parallel Mean Filter
mode) in comparison with sequential implementation of 2 2,038 2,122 2,083 2,112 1,923
classic filters for model image (size 2140×1740) shown in 3 2,883 2,791 2,870 2,817 2,738
Table III. The data of processing speed acceleration of fast 4 3,134 3,277 3,420 3,336 3,394
Gaussian Filter
filters for model image is presented in Table IV. 2 1,832 1,862 1,867 1,982 1,921
3 2,340 2,410 2,653 2,610 2,698
IV. CONCLUSIONS 4 2,663 2,856 2,742 2,847 2,899
Experiments were conducted to estimate the processing Median Filter
time of fast filtering algorithms (Mean filter, Median filter, 2 2,023 2,002 1,970 1,994 1,930
3 2,689 2,740 2,758 2,745 2,743
Gaussian Filter) and evaluation of noise suppression. The 4 2,892 2,914 3,049 2,951 2,927
experimental results show that the increase in the processing
speed for different kernel sizes is almost the same. Some Since the medical point of view any medical image
stability is observed in the acceleration for two threads as well presents an acceptable amount of noise, however, the
as one can see the increase of the acceleration coefficient in important thing to considerate is that this amount of noise
the case with more than two threads having the kernel size does not affect the quality of the image and especially the
medical diagnosis. [15] A. Lukin, “Tips & Tricks: Fast Image Filtering Algorithms,” 17-th
International Conference on Computer Graphics GraphiCon'2007:
Different medical specialists have interpreted the filters 186–189, 2007.
that were used in this study and depending on the pathology, [16] G. A. Pascal, “A Survey of Gaussian Convolution Algorithms,” Image
they validated the importance of image noise processing. The Processing On Line 3: 286–310, 2013.
[17] S. Perreault, P. Hebert, “Median filtering in constant time,” IEEE
experimental results show that Median filter demonstrates the
Transactions on Image Processing 16(9): 2389–2394, 2007.
best noise reduction, though in some cases it suppresses [18] R.C. Gonzalez, R.E. Woods, “Digital Image Processing,” 3rd edition,
details. Prentice-Hall, 2008. ISBN-13: 978-0131687288, 2008.
In order to the processing, the experimental results show [19] A. Zotin K. Simonov, F. Kapsargin, T. Cherepanova, A. Kruglyakov,
L. Cadena, “Techniques for Medical Images Processing Using Shearlet
that the increase in the processing speed for different kernel Transform and Color Coding,” In: Favorskaya M., Jain L. (eds)
sizes is almost the same. Some stability is observed in the Computer Vision in Control Systems-4. Intelligent Systems Reference
acceleration for two threads as well as one can see the Library, vol 136. Springer, Cham. Chapter First Online: 27 October
2017 DOI https://doi.org/10.1007/978-3-319-67994-5_9.
increase of the acceleration coefficient in the case with more [20] L. Huang, et al., “Parallelizing Ultrasound Image Processing using
than two threads having the kernel size larger than 5×5. OpenMP,” on Multicore Embedded Systems. 978-1-4673-5085 -
Acceleration with the usage of four threads demonstrates 3/12/$31.00 ©2012 IEEE.
[21] S. Patel, “A Survey on Image Processing Techniques with OpenMP,”
reduced efficiency as parts of the CPU resources are spent on © 2015 IJEDR | Volume 3, Issue 4 | ISSN: 2321-9939.
background tasks. [22] R. Chandra, L. Dagum, D. Kohr, D. Maydan, J. McDonald, R. Menon,
Using OpenMP, we made parallel implementation of fast “Parallel programing in openmp,” Academic Press. USA. 249p ISBN
1-55860-671-8, 2001.
algorithms, which gives performance boost up in almost two [23] A. Kiessling, “An Introduction to parallel programming with
times for two threads and around 3, 2 times for 3 and 4 OpenMP,” A Pedagogical Seminar. The University of Edinburgh. UK,
threads. Experimental results demonstrate that the fast 2009.
[24] G. Slabaugh, et al., “Multicore Image Processing with OpenMP,”
version of filter algorithms can well do with the noise
unpublished.
reduction at appropriate minimum processing time compared [25] A. Horé, D. Ziou, “Image quality metrics: PSNR vs. SSIM,” 2010
to classical implementation. The greatest increase of International Conference on Pattern Recognition. 2010 IEEE. DOI
processing speed was gained for the median filter. For quality 10.1109/ICPR.2010.579, 1051-4651/10
processing used SSIM measure with good result, which
showed in table II.
REFERENCES