Use of convolution and ﬁltration to extract information from the DCM graphic ﬁles

– The paper describes the problem of using digital ﬁlters on the DICOM graphic ﬁles. An attempt has been made to improve the process of extracting information from graphic ﬁles generated by medical measuring instruments.


Introduction
Nowadays Computers are used in many fields of science and technology, as well as in image processing being one of such fields. We take photographs [1], tape or acquire information from medical devices and irrespective of graphic images quality all we want to get is as much information as possible [2]. The operation of extracting desired information and rejecting unnecessary data is the basis of all filtration types.
The paper presents the issue of converting and adapting the images in the form of graphic files usually generated by medical devices. The image in the file is not always adapted to our needs. By applying adequate mathematical and filtering operations it is possible to emphasize details of the image or improve its quality. The example of using the adaptation filter described in the paper indicates that sophisticated filtration techniques are effective.

44
Use of convolution and filtration to extract information...

The basis of Digital Filters utilization in Image Analysis
The filters taking into account the surrounding of the analysed " pixel " [3] are believed to be one of the most useful tools in image processing.
Unfortunately, such filters perform mathematical operations on each pixel separately and hence the process is very time-consuming. The filter which takes the surrounding into account is a matrix, which by means of the coefficients included in it, describes the influence of neighbouring pixels on the analysed one. Such a matrix can be also called a filtration window or a convolution matrix because the filters perform the convolution operation. Such filters make it possible to change the " brightness" [4,3] of the pixels according to the mathematical formula known as convolution. The mathematical formula of convolution is as follows [5,6,7]: For discrete signals, this formula can take the following form [5,8]: The signal after the convolution has a different size from that of the input signals. For example, if the first input signal has the size N and the second has the size M , the output signal has the size N + M − 1. The convolution can be performed in one or two dimensions, indicated by the abbreviations 1D and 2D respectively. For the one-dimensional case [9]: where x and h are the input signals (for programming, they can be vectors, tables, containers), y defines the output signal, and n is the position in the signal. This means that x[n] is the n-th sample in the input signal x[n]. The convolution fulfils the superposition principle which means that the convolution operation is linear. Consequently, for any numbers a and b, the following equation is fulfilled [10, 7]: For convolution of two-dimensional signals, we have [10]: For two dimensions, the position is determined by two variables. In such case, the convolution is simply the multiplication and subsequent summing of the values from both input signals.
A discrete convolution can be also written as the Cauchy product c n of two sequences a n and b n [11]: Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 13/08/2023 08:39:56 Each pixel receives a new brightness value based on the brightness of the surrounding pixels. Depending on the applied parameters, this operation allows various filtration (image blurring and sharpening is possible). The pixel surrounding and the method of its processing are determined by using the filter mask, by means of applying suitable weights of these pixels. Next, the brightness of all surrounding pixels is multiplied by their weights and summed, and later it is divided by the scale parameter. The offset parameter is added to the final result. Hence, the new value of each pixel is calculated as follows: The new pixel value is calculated on the basis of coefficients in the filter matrix and information on the neighbouring pixels. The 2D convolution is simply an extension of the 1D convolution in two directions, instead of one.
An example of such filter is a 3x3 matrix [12]   0 0 0 A similar effect can be obtained with a 5 × 5 matrix The only difference is that this matrix is larger and consequently more operations must be performed on the image pixels as the analysed surrounding is broader and a larger number of neighbouring pixels are included in the calculation of the new pixel value. It must be emphasized that this form of the matrix and the filter do not make any changes in the filtered image. Only the value of the pixel is taken into account, so the result of the conversion will include only the converted pixel. The filter can also blur the image. A typical blur filter in the form of a 3 × 3 matrix is presented below [13]   1 1 1 final results than the neighbouring pixels. Higher gain is then applied to the selective field in the convolution matrix. An example of such a matrix is presented below [12]   1 1 1 The final effect is a reduced image deformation. Such a filter has, however, one significant defect: all surrounding pixels are treated in the same way. It is known that the filtering can be smarter and more selective.
A sharpening filter is based on increasing the contrast around the edge. It can be assumed that the edges in an image are dark pixels next to the bright ones. To increase contrast, one has to increase the brightness of the bright pixels and darken the dark ones even more. Then sample convolution filter with a 3x3 matrix will be as follows [13]: When such a filter is used, the brightness values of the neighbouring pixels are subtracted from each other. A simple relationship is formed: a dark pixel surrounded by bright pixels becomes darker, and vice versa, a bright pixel surrounded by dark pixels becomes brighter. The filter effectiveness can be adjusted by applying a suitable weight to the central matrix element (the larger the weight, the lesser the impact of the neighbouring pixels on the final result). Edge detection is another problem which can be solved by filtration. A sample image fragment with edges is presented in Figure 1. The squares in the figure are the image pixels, and the numbers inside the squares are the "colour" [4,3,14] values coded according to the" RGB" [4,3] standard. In Figure 1  The determined pixel will have a new colour, close to dark grey (10,10,10). Similarly, for a bright area adjacent to a dark area, the following calculation can be performed: As the new colour component value is 295 and it is outside the 0-255 range specified for the 8-bit colour representation, it is changed to the highest possible value (255) which corresponds to white. Unfortunately, this method is applied on the whole area of the image, and not only on the edges, so it increases the noise and interference. It is also impossible to determine the image sharpening strength easily. The final effect of this operation is presented in Fig. 2. It is a simple contract increase which does not always yield satisfactory results. In order to obtain better results, more complicated operations and resulting selective sharpening called the USM (unsharp mask) should be used. This filter subtracts the blurred copy of the image, the unsharp mask, from the original image. The resulting copy is compared with the original and if differences are found which are greater than a predefined threshold, the images are subtracted from each other. In this filter, a threshold can be set, beginning from which the filter will act as a sharpening filter. Therefore, it is possible to choose a fragment of the image for processing and consequently, it is possible to avoid the noise amplification from a specified threshold. If the threshold is not exceeded, the image fragment will not be changed. It must be mentioned that if a fragment in the blurred version is darker than its original counterpart, the sample is brightened. If the blurred sample is darker, the procedures are the opposite. The result is a sharpened image. Usually, such filters have three settable parameters: amount, radius and threshold. Amount determines a percent value which is added at the image edges. Radius is responsible for the size of the edges to be sharpened (generally for the Gaussian blur which is used in these filters). A small radius value results in sharpening of small details. Threshold controls change in the neighbouring tonal values for which the filter will be used. By applying a suitable threshold value one can select sharpening of distinct edges, while the softer edges will be left unchanged. Another type of filter that can be used is based on the Gaussian curve defined by the following equation [5,9,15]: where u is the pixel horizontal distance from the kernel centre, v is the pixel vertical distance from the centre, and sigma is the standard deviation. The standard deviation can take any value. Based on the analyses of many images, the standard deviation equal to 3 has been applied, r is the kernel radius.

Using the GSM Filtration on the Computer Tomography Images
The paper presents the results of the analysis of a CT image performed by means of the Gaussian filtering. The analysis was based on the Gaussian curve defined by equation (16).
The numbers given in (17) are the filter mask weights. The radius defines the number of neighbours on each side of the source pixel which are included in the calculations. Hence, σ = r/3.
The Gaussian filtering process is performed by means of the convolution of the image function F with the mask G(u,v) which is a discrete approximation of the Gaussian function.
The filter mask weights depend on the sigma parameter (standard deviation). This parameter is responsible for image blurring -the greater it is, the larger is the smoothing effect and the noise reduction. Image blurring can be achieved by many methods, but thanks to the Gaussian distribution the kernel of this filer is circular. Shape of the blurring kernel influences the final blurring results. In the case of a circular kernel, the visual affects are the best, better than with a square kernel. The calculations were performed for the assumed radius of 3 and the results are given below. The central value, represented by 0.399, is typed in bold. One can easily see that the central value is the highest, the kernel is perfectly symmetrical, and the values decrease with the increasing distance from the centre.
The blur is used in a USM (unsharp mask) filter [6, 16]. The figure presents a half of the sharpening filter operation which first blurs the image a bit. Blurring the first half of the operation is shown in Fig. 3. The final effect is presented in Fig. 4. Fig. 5 shows the input image for the filter.
Further analysis was performed on a sample image from a "dcm" file -an original image according to the DICOM standard (Fig. 6). Unfortunately, as seen in the figure, a direct display of the image from the file does not yield the expected results (good sharpness and recognition of image fragments). All necessary information is included in the image, but it is not sufficiently legible for a human. Consequently, the image parameters must be adapted (additionally processed by filtration). After application of the colour filter, more individual elements are visible in the same image (Fig. 7).
Such filtration can often show the details which are blurred in greyscale images.     8 shows the image after brightening and colour map conversion. Unfortunately, as we can see in the sharpened image, artefacts have appeared, i.e. the image noise has been amplified (Fig. 9). It is an undesirable phenomenon and should be avoided during the image contents analysis.
By using an adaptive filter with the coefficients given above, it was possible to sharpen the image without a noticeable degradation, achieving a so-called selective sharpening (Fig. 10). The result was an optimum image details legibility at the acceptable noise level.

Summary and Conclusions
The paper has attempted to solve the problem related to the reading of the dcm files in the DICOM standard. The graphic files generated by measuring instruments often require additional processing to yield more information (including also legibility improvement). Such processing involves mathematical operations, filtering, and emphasizing desirable image features. Not all image quality improvement methods give Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 13/08/2023 08:39:56 U M C S  acceptable results. The method applied by the author yields significantly better results (better detail legibility) than other commonly used methods.