Development of a GUI for automating quality control of dose calibrators using Python

. Quality control of dose calibrators is essential to evaluate the accuracy of the instrument response. In this work, a GUI (Graphical User Interface) has been developed to facilitate performing and recording quality control tests of dose calibrators. The interface is capable to automate several tests which include routine checks, accuracy test, linearity test, reproducibility test, repeatability test, concordance MBq/mCi test, and geometry test. In principle, the program computes correction factors that should be applied to minimize the uncertainty of measurements and the determining factors for success or failure of each test, then visualizes the results as tables and curves into a pdf file. Therefore, this interface can be considered as an efficient tool for performing quality control tests of dose calibrators thought it is still unable to offer the correction factors for the geometry test without experiment which will be achieved by integrating Monte Carlo simulation into the GUI.


Introduction
Dose calibrators (DC) are widely used in nuclear medicine to assay the activity of a radioactive source administered to the patient in a diagnostic or therapeutic process. The objective of this assay is to assure that the patient receives the minimum absorbed dose compatible with obtaining a high-quality diagnostic image or with achieving a desired therapeutic outcome. This instrument is a well-type ionization chamber filled with pressurized gas. When radiation emitted by the assayed radionuclide was absorbed into the gas, an ion pair will be created and collected with two electrodes maintained at voltage difference. The produced current will be amplified and measured by an electrometer [1]. The displayed response on the screen represents the source activity after the conversion of measured current using a calibration coefficient which is critical in the instrument performance assurance: an appropriate calibration coefficient should be associated with a particular radionuclide in a specific source geometry since the response of DC depend on several factors such as the type and the energy of radiation emitter, the source activity, the source geometry, and the source position [2].
Unfortunately, manufacturers supply calibration coefficient for a specific number of sources, thus, the calculation of other sources' correction factors is indispensable to assure the accuracy of the DC response. This task can be performed using various methods such as Monte Carlo Method and some experimental methods that should be selected in accordance with the accuracy required for the assay [3,4,5]. The significance of these factors depends strongly on the radionuclide type: studies suggest that the beta emitters are more sensitive to the container material, as the self-absorption phenomenon is more important for this type of radiation [6,7,8]. Moreover, the efficiency for those radionuclides increases with the energy [9]. For gamma emitters, the uncertainty due to the geometry factor is inversely proportional to the source energy. The relative response increases when the horizontal position of the source is farther away from the standard position for high and medium energy, whilst it decreases for low energy emitters [5]. For the volume effect, several studies observed that the significance of the deviation of measurements increases with the filling volume, which can be explained by the variation of the angle solid that determines the available sensitive volume for detection [5,6,10]. In summary, the variation of one of those factors mentioned previously can greatly affect the reading activity. Hence, it is recommended to perform quality control tests regularly in order to update those factors and, consequently, provide an adequate result for the activity assayed.
Avoiding any overestimate or underestimate of the dose administered to the patient is vital to achieving the principles of radiological protection that were implemented to protect the person and the environment against the harmful effects of ionizing radiations [11]. These principles involve the justification which imposes that the benefit expected (the diagnostic information or the therapeutic effect) must exceed the risk associated with the radiation exposure, the optimization which requires a balance between the administered activity and the desired effect of the exposure, and the limitation of dose which states that the absorbed dose should remain less than the limits recommended by the ICRP (International Commission on Radiological Protection) [12].
Because of the widespread influence of the estimating of the true activity on the public health and the environment, quality control tests of dose calibrators were established. Manufacturers must provide procedures for all tests that should be performed as well as the testing frequency. Moreover, the International Atomic Energy Agency (IAEA) has given recommendations on performing routine activity measurements and quality control testing that include voltage check, zero adjust, background test, constancy, accuracy test, linearity test, reproducibility test, and geometry test [13]. The aim of this work is to develop a GUI enabling to automate a common quality control testing of dose calibrator. The GUI has been built using python programming language that includes all necessary libraries for carrying out requisite operations related to those tests. In this paper, the working process of the GUI will be described and quality control testing will be applied to a MEDI404 dose calibrator as an example.

The program structure
The GUI was created using python 3.8 that required multiple libraries. The first one is PyQt5 which was used to build the GUI. For carrying out mathematical operations, statistics and math modules were called.
Pandas, an open source Python package, was used to analyze data gathered in several tests. Data can be saved as csv files (Comma Separated Values file) using os and csv libraries then plotted by matplotlib (a comprehensive library for creating static, animated, and interactive visualizations in Python). Finally, reportlab library was called to create a pdf file that has combined all results.
The program was constituted of five classes: a class for the main window building, three classes for making modal dialogs, and the last one to create a canvas that figures render into. Each of these classes involves its own methods which can be divided into five groups depending on its functions. The first group gets information entered by the user, stores it in variables, and saves it into files. The second extracts data from files and displays it on the screen. Two principal groups help to obtain results, one for analyzing data and the other to visualize it on graphs. The last group calls all variables, data, and figures and assembles them into one file.

Quality control tests
The GUI permits the user to perform common tests of DC which involve routine checks (high voltage, current check, zero adjust, and contamination check), accuracy test, linearity test, reproducibility test, repeatability test, concordance MBq/mCi test, and geometry test. To highlight the working process of this tool, a MEDI404 dose calibrator was used for carrying out some of these tests. The 57 Co, 137 Cs and 99m Tc sources were utilized in accuracy test, linearity test, and reproducibility test.

Routine checks
In these tests, the user should give parameter values associated with each test to be compared with the manufacturer tolerance which can be modified according to the DC model.

The parameter entered in the voltage test is the polarizing voltage of the ionization chamber while the current test parameter is related to the background [14].
For zero adjust, two parameters that compensate for the amplifier deviation should be provided [15]. Table 1 presents default values of tolerance limits for these tests in the program. The contamination check is established to assure that the instrument is not contaminated: measurements with and without the sample holder are taken in the absence of the radioactive source, and the difference between them must be less than 100 kBq.
The success or failure of each test can be determined by pressing the button "Go" and the results that include parameter value and decision taken for each test will be assembled into a table and displayed on the part "result" of the GUI (Fig.1).

Accuracy test
This test is designed to ensure the stability of the DC response. Long half-life solid sources whose energies cover the range of routine usage were used. 57 Co, 137 Cs and 99m Tc sources are commonly used to evaluate the DC response for low, medium, and high energy range respectively [2]. The measured activity of each source was compared with the reference activity supplied by a national or international standard radioactivity laboratory or from a secondary standard laboratory 1 . The relative bias b should be with ±5% after the decay correction [13].
Where is the measured activity and is the reference activity.
The developed program gets characteristics of each source and the activities values, calculates the correction factor and the relative bias to decide if the test has passed or not, then visualizes the results into a control chart. Input data are saved as csv files to be involved in the final report.

Linearity test
The linearity test evaluates linearity response of the instrument over the range of activity used in routine practices. There are three methods to perform this test: time decay method based on the decay phenomena to cover the entire activity range, shield method that depends on attenuation shields, and graded method that use samples with different activity [16]. The decay method is the most precise. It consists in measuring a short half-life source activity at regular intervals, covering about 10 half-lives, until the activity is less than 1MBq [13]. The relative standard deviation of bias between measured activity and reference activity should be less than 5% [14].
The program calculates the reference activity Aref corrected for decay, the bias for each measurement, and the relative standard deviation of the calculated bias; then deduces the status of test which will be stated on the status bar.
Where Aref is the reference activity at the time t, A0 is the activity at the reference time and λ is the decay constant.

Reproducibility test
The reproducibility test examines the deviation of a sequence of measurements from the average when measure conditions are changed. A series of measurements are taken using a long half-life source. The program calculates the average of measured activities and the relative standard deviation RSD that must be less 1 A laboratory providing "standardized radioactivity samples that has established measurement traceability to a national metrology institute" [13]. than 5%, then shows the status of the test and plot a control chart that illustrates the distribution of the activity.
Where n is the number of measurements and Ai the individual measured activity.

Repeatability test
In contrast to reproducibility, repeatability test should be performed without removing the source from the ionization chamber for each measurement. The rest of the process is similar to that of reproducibility.

As its name implies, this test confirms the concordance between measurement activity in MBq and mCi. The ratio between them should remain constant and equal to 37
MBq/mCi. Once the results of several measurements in MBq and mCi were registered in the program, the conversion factor Fconv and its relative standard deviation RSD are calculated. If RSD is less than 1%, the test is considered successful [14].
Where is the standard deviation of .

Geometry test
The geometry test is implemented to ensure that effects of container and sample volume are integrated into the reading activity. The procedure consists of measuring the sample activity in standard volume Aref , then diluting this activity with a fixed volume of water and assay it several times until the volume of the container is 67% full. The measured activity for each volume is compared with the activity Aref, and a correction factor should be applied if the bias between them is more than 5% [1]. Performing of routine checks, accuracy test, linearity test, and reproducibility test are set out in Fig.2, Fig.4, Fig.5, and Fig.6 respectively.    The report which includes data entered and tests outcome will appear if the user presses the icon "print". In the section of accuracy test, the resulting report contains a table that includes measured activity, expected activity, and bias between them for each measurement (Fig.6); a table that summarizes the test outcome (Fig.7); and control charts which reveal the tolerance range and the position of each measurement relative to this range (Fig.8).   Data of linearity test was combined in a table and visualized in a graph as it is show in Fig.9 and Fig.10. This data presents the activity of 99 over time and the bias between measured activity and expected activity. Fig.11 is plotted to illustrate deviations of measured activity from the linear fitted curve and final results of the test are shown in a table at the end of the section (Fig.12).     Table that includes results of linearity test in the pdf file.

The GUI calculates correction factors related to the volume
Results of the reproducibility test recorded on the pdf file are shown in Fig.13, Fig.14, and Fig.15. The control chart presents the activity of each measurement and the limits of acceptability for this test.     Table that includes results of reproducibility test in the pdf file.
Results of quality control tests of MEDI404 using this GUI confirm the robustness and the accuracy of the program since this one gives the same results provided using Excel 2010. However, it is not possible to estimate the uncertainty associated with measurements of a particular dose calibrator and to evaluate the instrument response without referencing to the experiment. Therefore, further work will be carried out to redress this lack. Monte Carlo method will be integrated into the GUI to estimate uncertainty. Furthermore, FLUKA Monte Carlo code will be merged with the GUI to simulate the response of DC and to assess sources of error and calculate correction factors that should be applied. An effective performance testing process is critical to assure the accuracy of results provided by dose calibrators. This work offered a reliable and convenient GUI that enables to automate carrying out the major quality control tests of dose calibrators. The working process of this tool which is built using python 3.8 is described in this paper as well as results provided by the program of tests for MEDI404. Further work will attempt to cover sources of error that can affect a dose calibrator outcome and to establish a novel approach that avoids the complexity of determining correction factors using traceable sources.