{'fraction_non_alphanumeric': 0.03543882978723404, 'fraction_numerical': 0.013563829787234043, 'mean_word_length': 4.8616523772408415, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Clinical Decision Support System for Patients with Cardiopulmonary Function Using Image Processing

Clinical decision support system for chest X-ray images was proposed in this paper, which is based on image processing and analysis methods to evaluate the normality of X-ray images. To segment lung regions from the chest X-ray images, threshold and morphological methods were applied. The feature selection and image measurement were performed to evaluate the normality of chest X-ray images. The results demonstrate that the segmentation results differ only marginally from the actual contours of lung regions and provide similar results with actual lung regions. Moreover, based on the measurement and feature selection, the interpretation of normality was facilitated, and the results of interpretation were similar with the diagnosis made by clinical experts. Clinical Decision Support System for Patients with Cardiopulmonary Function Using Image Processing Hee-Joon Park1*, Seok-Tae Seo2 and Byung-Seop Song3 1Department of Biomedical Engineering, School of Medicine, Keimyung University, Daegu, Korea; hjpark@kmu.ac.kr 2Daegu-Gyeongbuk Medical Innovation Foundations, Daegu, Korea; kenneth78@dgmif.re.kr 3Department of Rehabilitation Engineering, School of Rehabilitation Science, Daegu University, Daegu, Korea; bssong@daegu.ac.kr


Introduction
After the X-ray was discovered by Wilhelm Conrad Rontgen in 1895 1 , this radiation has been widely using in diagnostic medicine. Various examination tools including Computed Tomography (CT) and Magnetic Resonance Imaging (MRI) have been developed and have supplanted the X-ray for some purposes. However, X-ray imaging is still the most common examination tool.
Despite the long history and popularity of X-ray technology, interpretation of X-ray images remains challenging due to image complexity and variation. Many studies have been undertaken to refine X-ray analysis. These include segmentation and enhancement [2][3][4][5][6] , and detection of image abnormalities 2,7-10 . Especially, a variety of Clinical Decision Support Systems (CDSSs) or Computer-Aided Diagnosis (CAD) systems have been reported as aids to the clinical decision process 2,7,9,10 . Most of the proposed systems are limited to the detection of suspicious features from medical images. Moreover, the methods for lung region segmentation based on learning or landmarks, such as the those based on Active Shape Models (ASMs) [2][3][4][5][6] , Neural Networks (NNs) 2,10 , and knowledge 2 require an image-based experiential learning process. Despite the learning process, the methods all suffer from the difficulty in segmenting the lung region, which can display widely varying lung shape with a badly defined edge 11 .
Even clinical experts are challenged to distinguish between normality or abnormality of lung field such as blood vessels and nodules 2 . Thus, a method which is robust and possible to support the clinical decision is needed. The present study proposes a support system to evaluate normality from chest X-ray images.
The proposed two-stage method consists of image segmentation to detect lung regions from chest X-ray images followed by measurement and texture analysis to evaluate normality of the given image. Using threshold and morphological processing, the lung regions are segmented from X-ray images. Moreover, measurement and texture analysis enables the distinction of normality and abnormality of cardiomegaly and lung.

84
To show the effectiveness of the proposed method, we performed segmentation and measurement experiments on various chest X-ray images with diagnosis results by clinical experts, and compared the results between experimental results and the expert-derived diagnosis.

Object of Study
In this paper, 10 chest X-ray images, shown in Figure 1, were used. The diagnosis results according to images are summarized in Table 1.
where, g and z represent gray levels [0, L -1], n is the total number of pixels of image, and h(z) is occurrence frequency of the gray level z. Moreover, the normalization parameter b is set as the variance, and smoothing parameter p is obtained by correlation comparison between H p and H p+1 [13][14][15] . That is, the optimal parameter p is selected using Eq. (2).  To show the effectiveness of the proposed method, we performed segmentation and measurement experiments on various chest X-ray images with diagnosis results by clinical experts, and compared the results between experimental results and the expert-derived diagnosis.

Object of Study
In this paper, 10 chest X-ray images, shown in Figure 1, were used. The diagnosis results according to images are summarized in Table 1.  To show the effectiveness of the proposed method, we performed segmentation and measurement experiments on various chest X-ray images with diagnosis results by clinical experts, and compared the results between experimental results and the expert-derived diagnosis.

Object of Study
In this paper, 10 chest X-ray images, shown in Figure 1, were used. The diagnosis results according to images are summarized in Table 1.  From the image in 4b, the CTR is defined as follows.
where, (A + B) represents the transverse cardiac diameter and C represents transverse thoracic diameter. In general, if the CTR is around 0.5, then the size of heart is normal. However, in an image measurement system, there could be an error between actual contour and computed contour of lung regions. Therefore, we applied another evaluation method to detect cardiomegaly, in which we evaluated cardiomegaly based not only on CTR but also on the ratio of pixel density of lung regions as follows: Step 1. Project each lung regions according to the x-axis and y-axis.
Step 2. To divide segmented lung contour into apex, costal, hemi-diaphragm, and mediastinal part, compute the angle between projected axis and the candidate points.
Step 3. Select the points which have maximum distance from mid line of the thoracic spine.
where, RD and LD represent the right lung pixel density and left lung pixel density, respectively. Step 5. A HR >1.5 is diagnostic of cardiomegaly.
The reason for the use of the pixel density ratio of the right and left lung is to compensate for the error of segmentation regions from actual lung regions. Moreover, to evaluate the overall normality of lung from a chest X-ray image, the co-occurrence texture analysis method is applied.
Co-occurrence matrix is a statistical approach to analyze texture. The co-occurrence matrix used in this study was defined to four directions (0°, 45°, 90° and 135°) at distance 1. The co-occurrence matrix of given image is determined by using Eq. (6), and the normalized co-occurrence matrix p ij is obtained using Eq. (7). The example of co-occurrence matrix is shown in Figure 4.
where, cor p denotes the correlation between H p and H p+1 , and e is an error criterion and we set e as 10 -4 .
Step 2. Based on smoothed histogram, the threshold value is selected by entropy maximization method 13,16 .
When the probabilities of the partitions have the same value, entropy is maximized. Therefore the optimal threshold value is selected by Eq. (3).
where, A j denotes j th partition, which consists of Step 3. Perform dilation and erosion morphological processing with an adaptive mask 12,17 .
Step 4. Detect lung region. An example of a segmentation is shown in Figure 2.

Image Measurement and Texture Analysis for the Diagnosis Support System
To evaluate the cardiomegaly and overall normality of chest X-ray image, size measurement and texture analysis methods [18][19][20] were applied. To evaluate cardiomegaly, the Cardiothoracic Ratio (CTR) was used. The features of lung region and example of CTR measurement based on the features are shown in Figure 3.
where, g and z represent gray levels 0, 1 L , n is the total number of pixels of image, and h z is occurrence frequency of the gray level z . Moreover, the normalization parameter is set as the variance, and smoothing parameter p is obtained by correlation comparison between p H and 1 p H [13][14][15] . That is, the optimal parameter p is selected using Eq. (2).
where, p cor denotes the correlation between p H and 1 p H , and is an error criterion and we set as 4 10 .
Step 2. Based on smoothed histogram, the threshold value is selected by entropy maximization method 13,16 . When the probabilities of the partitions have the same value, entropy is maximized. Therefore the optimal threshold value is selected by Eq. (3).
where, j A denotes j th partition, which consists of gray levels Step 3. Perform dilation and erosion morphological processing with an adaptive mask 12,17 .
Step 4. Detect lung region. An example of a segmentation is shown in Figure 2.

Image Measurement and Texture Analysis for the Diagnosis Support System
To evaluate the cardiomegaly and overall normality of chest X-ray image, size measurement and texture analysis methods [18][19][20] were applied. To evaluate cardiomegaly, the Cardiothoracic Ratio (CTR) was used. The features of lung region and example of CTR measurement based on the features are shown in Figure 3. . Feature points selection and CTR measurement in a chest X-ray image. mage in 4b, the CTR is defined as follows.
B represents the transverse cardiac diameter and C represents transverse thoracic diameter.
l, if the CTR is around 0.5, then the size of heart is normal. However, in an image measurement system, there an error between actual contour and computed contour of lung regions. Therefore, we applied another method to detect cardiomegaly, in which we evaluated cardiomegaly based not only on CTR but also on the el density of lung regions as follows: Clinical Decision Support System for Patients with Cardiopulmonary Function Using Image Processing where I(x, y) denotes the gray level of image of size M × N at coordinate (x, y), S is a set of coordinates of direction (0°, 45°, 90° and 135°) with distance 1 at the center (x, y), and i, j represent the gray levels [0, L -1]. From the co-occurrence matrix, ten Haralick texture descriptors (Entropy, Energy, Contrast, Homogeneity, Sum Average, Variance, Correlation, Maximum Probability, Inverse Difference Moment, and Cluster Tendency) 19,20 are computed to analyze the lung texture.
where, u r , u c , s r 2 , s c 2 are the mean and variance of row and column of co-occurrence matrix, and are defined as follows: Based on the computed Haralick features, we evaluated the normality between the right lung and left lung using cluster tendency. A marked difference between cluster tendencies of the lungs is indicative of differing lung characteristics, which could indicate a lung problem. Therefore, we evaluated the difference ratio from Eq. (9) where, CR and CL represent the cluster tendency of the right lung and left lung, respectively. If the ratio is out of the range 1.0 ± 0.2, the chest X-ray image of the lung is judged abnormal.

Experimental Results
To show the effectiveness of the proposed method, we applied it to 10 chest X-ray images with various characteristics ( Figure 1). Some of the segmentation results are shown in Figure 5, and the parameter used in segmentation stage and the measurement results are summarized in Tables 3 and 4, respectively.  .

Entropy
Measures the randomness of gray-level distribution  From the co-occurrence matrix, ten Haralick texture descriptors (Entropy, Energy, Contrast, Homogeneity, Sum Average, Variance, Correlation, Maximum Probability, Inverse Difference Moment, and Cluster Tendency) 19,20 are computed to analyze the lung texture.

Entropy
Measures the randomness of gray-level distribution om the co-occurrence matrix, ten Haralick texture descriptors (Entropy, Energy, Contrast, Homogeneity, Sum rage, Variance, Correlation, Maximum Probability, Inverse Difference Moment, and Cluster Tendency) 19,20 are puted to analyze the lung texture.

Entropy
Measures the randomness of gray-level distribution   Measures the randomness of gray-level distribution   Table 3 show the segmentation results and the parameter values according to images. Figure 5a and 5b exemplifies the similarity of the different detected contours of lung regions by the proposed method with the difference from the actual contours of the lung regions. Although the proposed method does not always provide the best segmentation results, the similarity with the actual contours is compelling. Based on the segmented images, measurement and interpretation can be performed. Table 4 shows the measurement results of CTR, texture, and lung ratio. Based on the measurement results, the interpretation was performed; the results are summarized in Table 5.
While the data from Tables 5 and 6 indicate that the proposed method provides accurate results for most, but not all, all cases of X-ray images. In particular, for Images 9 and 10, the proposed method did not provide accurate results, because of the difference between segmented contour and actual contour. Further improvement of segmentation accuracy for chest X-ray images is required

Conclusion
The chest X-ray is the most common and widely-used examination method in medicine. A plethora of studies

Experimental Results
To show the effectiveness of the proposed method, we applied it to 10 chest X-ray images with various characteristics (Figure 1). Some of the segmentation results are shown in Figure 5, and the parameter used in segmentation stage and the measurement results are summarized in Tables 3 and 4,   have been directed at improving the analysis of X-ray images; the approaches have included segmentation, edge detection, and nodule detection. However, analyzing an X-ray image in a CDSS remains several challenges. In this study, we propose a chest X-ray diagnosis support system based on image processing. We segmented lung regions of a given image based on threshold and morphological methods. Moreover, feature selection and image measurement were performed to evaluate the normality of chest X-ray images.
The results demonstrate that the segmentation results differ only marginally from the actual contours of lung regions and provide similar results with actual lung regions. Moreover, based on the measurement and feature selection, the interpretation of normality is facilitated, and the results of interpretation were similar with the diagnosis made by clinical experts.
However, we manually adopted a morphological mask size for dilation and erosion, and only cardiomegaly and normality were evaluated based on the proposed image measurement and feature selection. A segmentation method for chest X-ray images with more non-standard and complicated shape is needed, as are methods to evaluate more diseases such as pulmonary, pleural effusion, and pneumothorax diseases.

Acknowledgement
This research was supported by the MOTIE (Ministry of Trade, Industry and Energy), Korea, under the Inter-Economic Regional Cooperation program (R0002625) supervised by the KIAT (Korea Institute for Advancement of Technology).