## 2 Materials and Methods
### Image Processing  
In this stage, the Pydicom and OpenCV Python libraries are used. With Pydicom [42], DICOM files with information compatible to Python were integrated. With the OpenCV library [43], conversion, binarization and filtering operations were performed on the images obtained from Pydicom. To evaluate the CS, the lesions of each slice of the CTCS scan were selected; consequently, the image processing algorithm performs the following functions (Figure 3): (1) open the image set and navigate through the slices, (2) identify pixel areas greater than 130 HU, (3) select lesions of calcium in the arteries, adding labels according to the corresponding coronary artery (LAD, LM, CX, and RCA). The original image is represented in HU and is converted into a grayscale map, so that the user can easily identify the elements that comprise the CT image (Grayscale). Later, this image is represented in RGB format to obtain an image with color. With the original image (HU), two binary images are also generated. In the first, pixels with HU values greater than or equal to 130 HU are labeled with a \"1\", and in the second, pixels with HU values less than 130 HU are labeled \"1\". From the image with pixels \(\geq\) 130 HU, an image (Labeling) with islands of labeled pixels is obtained that is used to obtain information that allows for finding the relationship between possible lesions and the corresponding coronary artery (Selected Calcifications). To obtain the image that is shown to the user (Final Image), areas greater than 130 HU are extracted from the RGB image, and the result is added to the Selected Calcifications image.  
Figure 3: Digital processing of computed tomography images.  
Each time the user points to a pixel island (Figure 4), it is labeled with the selected coronary artery (LAD, LM, CX and RCA), saving the relationship of each of the lesions in a Python list and changing the color of the island of pixels by that corresponding to the artery. The application calculates the area of the selected lesion. If the area is greater than or equal to 1 mm\({}^{2}\), the corresponding density score is calculated. Since there may be variations in the CTCS due to the size of the patient and the calibration of the tomographic equipment, increasing the final value of the CS [44], the application of two additional processing techniques for the attenuation of the variations was proposed, and three different density scores were calculated. The first density score (F1) corresponds to the selected island of pixels as proposed by [PERSON] [9]. The second proposed density score (F2) is calculated after the application of a Gaussian blur filter that was programmed with the GaussianBlur function that is included in the OpenCV library. The third proposed density score (F3) is calculated after applying a classification criterion that checks that the maximal intensity values. Maintaining a minimal mode, the algorithm separates the pixels into three groups according to their intensity level. The first group contains the pixels with an intensity greater than or equal to 400 HU (F = 4), the second group the pixels with an intensity greater than or equal to 300 HU (F = 3), and the third group the pixels with an intensity greater than or equal to 200 HU (F = 2). To obtain the resulting F, it is necessary to examine whether the number of pixels in each group maintains the minimal programmed mode; if more than one group meets the sufficient area, the highest density score is considered to be correct; if none of the groups meets the minimal pixel condition, then F = 1 (default value). Once the F values are obtained for each of the proposed methods (F1, F2, F3), a CS is calculated for each F of the selected lesion, and its value is added to the corresponding total CS as indicated in Equation (1).