DICOM compression and decompression method using double cone

The increase of information in the medical environment caused by digital imaging settings is notable. The search and use of these technological tools aimed at medicine require a greater availability of storage, generating increasing costs. In medicine, together with information technology, there is a format of images used in exams, diagnostics, tomography, among others. This format, entitled DICOM, was created in order to standardize uses in medical devices for exam answers. An open question is the compression of DICOM data, in order to maintain quality, maintaining high rates of compression. This presents a new method for compressing and decompressing DICOM data using a dual cone bijector function and a video codec, called DC (Double Cone). This work offers 3 changes to the DC method (DC1, DC2 and DC3). The results obtained with a new technique show that the compression, although with loss, has a similarity index very close to the original image (SSIM = 0.99), and an accuracy ratio equal to 69.51, in the better case. The better performing version was the DC2.

into two segments: Region of Interest and background. Then, the background of the image is compressed at the maximum compression rate using image pyramid compression, followed by the vector quantization loss compression technique, based on the Generalized Lloyd Algorithm method. Next, the Region of Interest is compressed using the Huffman Code.
Finally, the compressed image is obtained by combining the compressed background and the compressed Region of Interest. However, the authors used only two metrics to measure the quality of compression: normalized cross-correlation (NCC) and the structural similarity index (SSIM), leaving aside important metrics such as PSNR and SNR. It is also worth mentioning that they use the Huffman compression method and the performance of the method is offered in comparison with the Huffman coding only, which makes the real contribution of the research inconclusive.
In the work of Baraskar (N. Baraskar & R. Mankar, 2020), a comparative survey of different types of Wavelets is carried out, (Biorthogonal, Haar, Daubechies, Coiflets, Symlets, Reverso Biorthogonal, Discrete Meyer). In order to analyze the efficiency of different types of Wavelets and determine the best one. The performance of the implemented method is evaluated using some essential criteria: the compression rate obtained, the compression gain and the quality of the reconstructed image using PSNR, MSE and SNR. The generated result showed that Wavelets Biorthogonal offers better compression size, compression rate and compression gain, but image quality parameters such as PSNR and MSE are degraded.
The compression and decompression method proposed in this work is to attend hospitalbased DICOM volumes. The compression combines a transformation based on the double cone, which consists of a growing bi-directional continuous function, and use of codec for high definition video. Decompression is the reverse process. The method contributes to obtaining a high compression ratio with an acceptable level of similarity.
The work defends the hypothesis that a compression method based on a dual cone bijector function and a video codec can produce compression and decompression in DICOM data with better compression rates, signal noise and similarity.
Common to both stages is the process called DC. This process is responsible for performing all the necessary conversions between the color models to encode and decode the images. As it is a key element in the doctoral proposal, it will be presented in detail in the subsection 2.1. As illustrated in Figure 1, compression is a process resulting from combining the Double Cone with a video codec. From a set of DICOM images (16-bit pixels), double cone process converts to 3-channel (RGB) images through the attribution of pseudo colors. A video codec is then used to compress the data, producing a video as the output, which is the combination of all the input images. For inverse process, decompression, is used process illustrated in Figure 2 e detailed in subsection 2.2. Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v9i9.8032  The Figure 2, in turn, illustrates the decompression process. From the compressed data (RGB video of pseudo colors), a video codec is used to decompress the data, which are later converted from RGB to a single 16-bit channel, which form the images of the DICOM standard.
Codecs are elements used to encode and decode media files, that is, they compress the original format, favoring storage, and decompress at the time of reproduction, transforming it again into an image or audio. In this paper, the terms encoding, encoder and decoding, decoder will be adopted interchangeably with the terms compression and decompression to refer to the actions and processes of compression and decompression, respectively.
The subsections 2.2 and 2.3 will describe in detail the compression and decompression processes, while the subsection 2.4 presents 3 versions of the proposed method, each corresponding to the combination of Double Cone function with a specific codec image.

Double Cone
The double cone is the essential part of the compression and reconstruction method Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4. A bijection of the set A to the set B also defines an inverse function f' from B to A. In other words, the double cone allows pixels represented as 16-bit intensities to be converted to a triple RGB and vice versa, with no unpaired elements in both sets. In this work, the process of converting 16 bits to RGB is defined, as a process of attributing pseudo colors. where Lightness L is computed by: where Δ is given by: and max(In) and min(In) represent the largest and smallest pixel among all images In, respectively, and, finally, n is the number of images in the set.
The algorithm 1 describes the process of calculation of the Double Cone f function, which converts 16-bit values to an RGB triple.
The inverse process of the Double Cone, that is, the conversion of the RGB triple into a 16-bit pixel (or the calculation of the f' function) can be described as follows: an RGB triple Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4  The compression process with a video codec is then applied over this image, resulting in the compressed data. (a-f) and 5(a-c)) and the conversion to image pixels, which are integer values. Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v9i9.8032

Compression -Encoding
The process illustrated in Figure 1, is based on the principle of the double cone function presented in the subsection 2.1 where the conversion of each image takes place, pixel by pixel of DICOM images in 3 channels of 8 bits with the application of false colors.
Along with the colorization, all the information present in the tags from the DICOM files is extracted and a file is created containing their respective tags and content without the set of pixels in the image, so that it can later be joined to the resulting video file. After colorization, the images created in a video are added and compressed using a video codec.
In the codec encoding process, the libraries contained in the FFMPEG were used. Its

DICOM compression analysis
The quality of the images stored by health professionals is not always satisfactory. From a statistical point of view, the MSE can present problems when used to compare similarity. The main one is that large differences between pixel intensities do not necessarily mean that the content of the images is dramatically different. It is important to note that an MSE value equivalent to 0 indicates perfect similarity. A value greater than 1 implies less similarity and will continue to increase as the average difference between pixel intensities also increases (Saraiva et al., 2019).
When comparing compression codecs, PSNR is an approximation to human perception of the quality of reconstruction. Typical values for PSNR in compression with loss Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v9i9.8032 In the vast majority of experiments, the metrics SSIM, PSNR and CR, in this sequence, were chosen to select the best performing methods. The MSE, as mentioned earlier in section 3, can present problems when used to compare similarities and its use is not viable.
The CC presents very close values. the CR is more sensitive to changes than the DR. SSIM as a compression metric is more relevant than PSNR, as reported in the section 3.

Experiment 1
In this first experiment, a fixed rate of FPS = 60 was used. The results are presented in the Table 1.  It is observed that the DC2 method presents the best performance. This statement is corroborated by some factors: a) high SSIM value produced by the method, for both JPEG and PNG images and b) high compression ratio (high values for DR metric).

Experiment 2
In this experiment, the number of frames was increased to a fixed rate of FPS = 120.
The results given in JPEG and PNG are shown in the Table 2.

Experiment 3
In this experiment, the number of frames was increased to a fixed rate of FPS = 240.
The results are shown in the Table 3.     Table 3, it can be seen that when using the JPEG format in compression it is possible to make the file relatively smaller. However, there was a notable loss in the similarity of the metrics, whether the methods with or without double cone. On the other hand, in compression with the PNG format it is noticed that the fidelity with the original image increases and the compression ratio tends to decrease. It was noticed that the images in PNG format with double cone obtained a higher similarity rate, being observed in the Figure 5c where it is not possible to visualize the noise.   Figure 7b is noticeable a noise after this process while in Figure 7c reconstruction shows the best result between them.

Proposed method for volume compression on 3mm thick data
In this experiment, the performance of the methods will be evaluated for volumes of 3mm and FPS = 240 only. The dataset is also public (Schmainda & Prah, 2018) and contains 60 DICOM images of approximately 515 KB each, totaling 30.1 MB. The evaluation for FPS = 60 and FPS = 120 were ignored due to the uniform behavior presented by the methods for all of them. The results are presented in the Table 4. In the Table 4 as compared to the experiment with a volume of 1 mm, excellent values are observed for the SSIM metric for images in JPEG and PNG format (SSIM = 0.99). The PSNR values are quite close (PSNR = 46.6) for traditional codecs. The DC1, DC2 and DC3 methods continue to have better PSNR rates, especially for PNG images. The proposed DC1 method again exhibits an increase in the PSNR value as the bitrate rate increases reaching the value of (PSNR = 71.806) to bitrate = 200000. In this experiment, the PSNR of DC1 is slightly more significant than DC2 (PSNR ≅ 67.625). When observing data compression, the best performance methods are H.265, followed by DC2, for both JPEG and PNG images.
However, if we consider the combined values of SSIM and CR, the most efficient method is DC2.

Proposed method for volume compression on 5mm thick data
This last experiment evaluates the performance of the methods for volumes of 5mm and a fixed rate of FPS = 240. As in the previous experiments, a public dataset (B. Erickson, Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.  In Table 5, low values are observed for the SSIM metric for traditional codecs (≅ 0.75) in relation to the proposed methods (≅ 1). The same can be observed for the PSNR metric of double cone methods, especially for images in PNG format. The DC3 method has a high PSNR value (93.524) for PNG images. Still with respect to PSNR, the DC1 method presents considerable values, which grow as the bitrate increases (values between 78.516 and 72.692).
The DC2 method has the lowest PSNR values for PNG images (70.601), still much higher than those presented by traditional codecs.
On the other hand, there is a very high value of the CR metric (18.83) for the DC2 method, in PNG images, when compared to the other double cone methods. The compression ratio for DC2 is about 9 times higher than the best of the other techniques proposed with Double Cone, DC1 with bitrate = 100000 and CR = 1.94. It is also possible to observe a small Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.

Conclusion
After analyzing the results in DICOM images with a thickness of 1, 3 and 5 mm, it was observed that the best lossy compression method is DC2. Among all the proposed alternatives and traditional codecs, it is the one that best presents similarity between the original and compressed data (SSIM metric) and compression rates (CR metric).
The DC2 method combines the proposal of a bijector function called Double Cone for conversion and reconstitution of DICOM data, together with H.265 video codec.
The performance analysis of the proposed methods and comparison with traditional methods, adopted the following metrics, in this order of importance: SSIM, PSNR and CR. As explained earlier, this sequence takes into account the similarity (SSIM) between the original data and the compressed data, as the main factor. This is due to the fact that in medical applications, it is necessary to have information with the least possible error.
The need to have a value of SSIM = 1, or close to it, is relevant. In it, it is possible to observe that for values SSIM = 0.99 there are, qualitatively, no errors visible to the human eye while the values of SSIM = 0.97 already have visual errors. This is of fundamental importance for the medical community, particularly for specialties that perform diagnoses based on images. It appears that in all experiments with the DC2 method, when using data in PNG format, the results for the SSIM metric are in the order of ≥ 0.99. Clinically, this is an acceptable level of similarity for exam interpretation.
When analyzing the CR compression ratio for the DC2 method, it is noted that there is a high value coming from the H.265 codec. Such a property makes it a much more attractive method than DC1 and DC3.
In general, better compression results are also observed when using the PNG format.
In addition, it was observed that by increasing the thickness, the SSIM metric values for the DC1, DC2 and DC3 methods became even more expressive when compared to compression using traditional codecs.
Therefore, it appears that the DC2 method based on a dual cone bijector function and a video codec (H.265) produced results in DICOM data with better compression rates, signal Research, Society and Development, v. 9, n. 9, e882998032, 2020 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v9i9.8032 28 noise and similarity, considering that the combination of such metrics it is indispensable for application in a clinical environment.

Future perspectives
As future work it is proposed to integrate an application to the method, to perform compression and decompression in an automated and simplified way. Additionally, the use of other codecs, such as VP9 and AV1, can be investigated and compared with the proposed method, in order to improve the similarity and increase the compression rate. It is believed that the test on other organs, with and without pathologies, is of relevance, as well as the test in thicknesses less than 1mm.
Measure the processing time of the compacting and unpacking processes. The main concern of this work was to quantitatively evaluate the methods in relation to their capacity to provide compression rate and low loss of information.
Check the tolerance for errors, due to distortions in the compressed data flows, according to specific future legislation in the hospital area.
For a more significant validation of the image compression, it is suggested to perform specificities of the receiver (health specialist in images). As an image analyzer, the human visual system is considered.
For greater security guarantee, developing a compression together with digital