Improving Tumor Detection in X-Ray Images Using Monte-Carlo Simulation-Based Optimization



Radiation therapy is a highly targeted treatment for cancer, the leading global cause of death, contributing to approximately 40% of worldwide cancer cures. X-ray imaging plays a pivotal role in the visualization of radiation therapy, but low image contrast and image graininess can hinder accurate tumor detection and successful radiation therapy planning. In this study we utilized the Opengate python module to model a scenario mimicking a patient positioned within a typical clinical environment and to replicate the interactions of photons traveling through the patient’s tissue and tumor. We used simulated X-ray images to analyze the CNR between image contrast and graininess across numerous distinct images and proposed a numerical procedure to find the solution for any target CNR. In the specific setup of the experiment in this study we determined the optimal amount of X-rays to be ?2.6e6 becquerels for a hypothetical target CNR of 1. The successful demonstration of the methodology may lead to improved tumor detection and enhanced radiation therapy planning.



Cancer is currently the number one leading worldwide cause of death. In 2024, an estimated 2,001,140 new cases of cancer will be diagnosed in the United States and 611,720 people will die from the disease1. Radiation therapy, a highly targeted treatment that accurately isolates the cancer to its precise location in the body (allowing the cancer cells to be killed whilst still protecting vital organs and a majority of tissues in the body), is an extremely effective cancer treatment with wide-ranging uses, contributing to approximately 40% of all cancer cures world-wide2. Radiation therapy relies on the use of imaging technology (namely, X-rays), to visualize and distinguish between tumors and other materials in a patient’s tissue before the administration of treatment can occur3. However, often, the visibility of a tumor is too low due to a combination of low contrast between surrounding materials4 and the graininess of the image5, preventing the production of an accurate, useful image and subsequently preventing the delivery of successful radiation therapy. This study proposed a numerical model that can determine the optimal parameters of amount and energy level of X-rays to reach an acceptable ratio between the contrast (particularly between a tumor and surrounding materials) and grainy appearance of an image to aid in the planning and navigation of radiation therapy.

Image Noise

Consider a digital X-ray detector that is exposed to a uniform X-ray beam where the mean number of photons detected per pixel is 100. Due to the stochastic nature of X-ray emission and detection, not every pixel will detect exactly 100 photons. Some pixels will have more X-rays and appear darker, whereas others that detect less than 100 photons will appear lighter. Additionally, the distribution of these darker and lighter pixels is random, consequently giving the image a grainy appearance dubbed by scientists as noise 6. Quantum noise, or quantum mottle, is the most substantial noise source in plain radiography. It originates from the variations in the number of photons reaching the X-ray detector at different points; thus, exposing the detector would yield an image with a grainy appearance instead of a consistent greyscale7. The sole technical method to mitigate noise across any X-ray imaging modality involves increasing the quantity of X-rays used8.

Image Contrast

The Becquerel (Bq) value represents the amount of X-ray radiation or dose used in medical imaging. It is a unit of radioactivity that measures the rate of radioactive decay of a material. This value serves as a crucial indicator of the beam’s intensity and describes the relative radiation output for an X-ray tube operating at a specific tube voltage. The average photon energy, represented by kiloelectron volts (keV) and dictated by the X-ray tube voltage and beam filtration is the primary determinant of the amount of image contrast. As the average photon energy decreases, the contrast between a lesion and surrounding tissue increases, whereas this contrast will typically decrease with an increase in average photon energy9. In addition to this factor, the atomic number of the lesion, image scatter (secondary radiation that occurs when the X-ray beam interacts with an object, resulting in the scattering of X-rays)10 and the image display also play roles in image contrast. When the atomic number of the lesion deviates from that of soft tissue (approximately 7.5), the image contrast is influenced much more extremely. Additionally, elevated image scatter tends to decrease contrast. Finally, increasing the image’s window width reduces image contrast, and vice versa6

In most cases, increasing the radiation dose is necessary to ensure enough photons go into the patient, randomness of photon interaction inside the patient’s tissue is averaged out, and a visual image contrast is established (CNR as discussed in the next section). On the other hand, overexposure can potentially induce radioactive damage to human’s body. The widely accepted safety principle ALARA (as low as reasonably achievable) states the importance of applying appropriate X-ray doses while avoiding unnecessary harmful radiation received by the patient with the goal of maintaining the balance between detectability and safety, one of the most important considerations of this study.

Contrast-to-Noise Ratio (CNR)

The most straightforward way for radiologists to detect and evaluate a tumor from an X-ray image is to visually assess it with the naked eye. This is only a subjective standard on whether a tumor is detected with certainty and how far the tumor has progressed. Nowadays, scientists typically want to quantitatively distinguish between different objects that appear to have close contrast, such as a tumor and the surrounding, healthy tissue using an objective metric. Commonly quantitative metrics describing this process are the signal-to-noise ratio (SNR), contrast-to-noise ratio (CNR) and modulation transfer function (MTF). Among them, CNR is often used to measure the ratio of lesion contrast to image noise which is the primary factor influencing the detectability of a particular lesion. Without loss of generality we use CNR as our target metric throughout this work to demonstrate the outcome of methodology.

CNR serves as an indicator of the lesion’s comparative image quality. Enhancing the detectability of any lesion always necessitates an increase in its CNR, which can be achieved by elevating lesion contrast, minimizing noise, or employing a combination of both strategies6. Thus, the kiloelectron voltage and Becquerel level settings are the radiographic techniques that can be modified to optimize the CNR ratio of a lesion. Increasing the Becquerel dose value will reduce noise, and can be achieved by increasing the X-ray tube current. As for increasing image contrast, decreasing the X-ray tube voltage will typically amplify contrast. However, while it’s true that image contrast typically decreases at elevated photon energies, it’s important to note that the dynamic range of the resulting image data also diminishes.

CNR has been studied in practice almost exclusively through experimental design and test6. Experiments are straightforward and reliable. However, they are often time consuming and have some disadvantages in consideration of cost and safety. In this paper, we propose a Monte Carlo based approach using computer technology to quantify the optimized dose. Monte Carlo is a computational technique used to model complex systems or processes by simulating random events or variables repeatedly and has been used by professionals in finance, nuclear physics, particle physics, video game, climate systems, and epidemiology models. As will be shown in this study, it is also a valuable tool for optimizing the CNR in X-ray images.

Problem Statement and Goals

Increasing the CNR in X-ray imaging is essential for obtaining high-quality images but is associated with several potential dangers. The most prominent of these risks is excessive radiation exposure, which can occur when increasing X-ray intensity or using high radiation doses in an attempt to reduce noise and increase the CNR. This may lead to higher radiation levels, which can increase the risk of radiation-induced damage to tissues and DNA, an increased risk of cancer11, and increased healthcare costs.

Monte Carlo simulations can simulate the interactions of X-ray photons with the patient’s body tissues and the ensuing signal on the X-ray detector, thus allowing researchers to systematically vary imaging parameters and providing a comprehensive approach to optimize CNR in X-ray images without causing unwanted damage to the patients.

A comprehensive overview of image noise reduction in the field of X-ray imaging can be found in the 2022 study “Contrast Enhancement and Noise Reduction of chest X-ray images.” Moreover, studies regarding the X-ray imaging optimization and CNR enhancement are mostly performed experimentally12,13. The goal of this study is to employ physics-based Monte Carlo simulations to simulate the transport and interaction of realistic X-ray photons for the testing of different X-ray intensities and levels with the goal of generating optimal parameters of X-ray dose and energy to achieve a targeted CNR while preventing potential patient harm. The achievement of this goal was determined by calculating the CNR of images generated from an increasingly specific range of dose and energy values and ultimately checking for 95% accuracy.

It should be noted that the main purpose of this work is to demonstrate a combination of physics and numerical methodology and is not intended for practical application at this stage. For the sake of generality we used the X-ray source strength (Becquerels) instead of the radiation exposure received by the patient’s body as a measure for optimization and discussion. Becquerels are a physics measure of radioactive decay per second and in medical terms of radiation dosage in people the unit of Sievert, the SI unit representing the stochastic health risk of ionizing radiation, is used. A direct relationship between Becquerels and Sievert can only be established with  the specific experimental setup and the specifics of tissues and organs, which is not the scope of this work. This will be one of our future study plans.



This work is done in a Python programming environment that utilized several common numerical python modules including Numpy, Matplotlib14 and the Monte-Carlo simulation framework Opengate. We will use computer programs to numerically determine the optimal combination of dose (radiation amount) and X-ray energy (average photon energy) necessary to achieve an ideal CNR.


The Opengate simulation toolkit is a software suite designed for simulating physics models in medical imaging applications15. Opengate served as the foundation for creating simulations of X-ray imaging processes within realistic clinical settings. Opengate simulations within this research modeled a scenario in which a patient with a tumor was positioned within a typical clinical environment. This setting included a treatment room equipped with a detector plane and an X-ray machine. Opengate, through the integration of physics models, replicated the interactions of radiation as X-rays traveled through the patient’s tissue and eventually generated images for medical and diagnostic use.

Phantom Generation

A central part of this code was the creation of phantoms (through the Opengate python modules), which in this project were hypothetical geometric models representing the patient and the surrounding environment as indicated in Figure 1.

Figure 1 | The geometry of the experiment setup and X-ray photon trajectories in this study. In the schematic, the outer box is defined as the physical boundary of the experiment. The X-ray photon source is placed on the right end of it. The phantom object (larger box in light color) and tumor area (smaller box in light color) are put in the middle. The detector plane is placed on the left surface of the outer box.

The geometric models consisted of a hypothetical room defined by a size of 0.5 by 0.5 by 0.5 meters to house the patient, X-ray source, and X-ray detector. The source of the X-ray uses the electromagnetic physics model G4EmLivermorePhysics16 defined within Opengate modules and specified as a generic photon source with a fixed energy of 40keV in our study. The source was placed on the right side of the room, was characterized as a disk of 15-centimeter radius generating X-rays to penetrate the patient, and the patient and their tumor area were represented by a rectangular phantom object with respective sizes of 40 by 40 by 10 centimeters and 5 by 5 by 2 centimeters.

As defined in G4EmLivermorePhysics16, we chose material specification for the phantom object, including the patient object with material

Body: d=1.00 g/cm3 ; n=2

+el: name=Hydrogen   ; f=0.112

+el: name=Oxygen     ; f=0.888

and ROI object

Bones: d=1.4 g/cm3 ; n=18

        +el: name=Hydrogen   ; f=0.07337

        +el: name=Carbon     ; f=0.25475

        +el: name=Nitrogen   ; f=0.03057

        +el: name=Oxygen     ; f=0.47893

        +el: name=Fluorine   ; f=0.00025

        +el: name=Sodium     ; f=0.00326

        +el: name=Magnesium  ; f=0.00112

        +el: name=Silicon    ; f=0.00002

        +el: name=Phosphor   ; f=0.05095

        +el: name=Sulfur     ; f=0.00173

        +el: name=Chlorine   ; f=0.00143

        +el: name=Potassium  ; f=0.00153

        +el: name=Calcium    ; f=0.10190

        +el: name=Iron       ; f=0.00008

        +el: name=Zinc       ; f=0.00005

        +el: name=Rubidium   ; f=0.00002

        +el: name=Strontium  ; f=0.00003

        +el: name=Lead       ; f=0.00001

The patient receives the X-ray radiation from the source placed on the right side of the room. The scattered photons reach the detector plane on the left side of the room. The detector in the simulation is specified as a Phasespace detector (PhaseSpaceActor defined in Opengate). This is a generic detector model that can record position, energy and direction of scattered photons coming from the patient.

Within the Python environment, the geometry, materials, and physical properties of these phantoms were precisely configured as above using the supported Opengate Python interface. These phantoms formed the basis of the experiments, allowing for the accurate simulation of radiation interactions with anatomical structures.

Data Generation

The generation, processing, and CNR calculations of the X-ray images of these phantoms involved the coding of five custom-designed functions in Python. The generation function utilized the Opengate simulation framework in the Opengate Python module to create photons and simulate interaction with the human body and tumor area mimicked by the two boxed shaped objects. The simulation captured detailed information about the particle interactions, including positions, energies, and other relevant parameters, forming a phase space dataset. Since variations in dose and energy can impact the spatial distribution and characteristics of particle interactions within the simulated human body, the Opengate simulation then generated a corresponding phase space file based on the values of dose and energy defined in the function’s argument. This file contained information about particle positions and energies that would determine the amount of noise and level of contrast in the image the file would later be processed into.

The second function took the phase space file generated by the first function, read it using the uproot Python package, and extracted relevant data such as particle positions and kinetic energies. This data was then filtered to include only positions within a certain range before creating a 2D histogram, or image, representing the distribution of the energy at the detection plane. This image was then saved in a binary file for further analysis.

Data Analysis

The third function calculated the CNR of the generated image. The binary file saved at the end of the second function was loaded and reconstructed back into an array representing the image of X-ray interactions using the pickle Python package. Then, a region of interest (ROI) representing the patient’s tumor was defined, the mean signal intensity within the ROI was calculated, and the mean background intensity outside the ROI was computed as well. The CNR of the image was then calculated as the absolute difference between the mean ROI intensity and mean background intensity divided by the standard deviation of the background intensity.

A fourth function called all three of these functions. It began by taking a dose value (Bq) as the input and fixed the energy value (set to 40 keV), reflecting how an X-ray machine typically only has one energy setting which allows you to tune the dose freely but not the energy. Next, Monte Carlo, postprocess, and CNR calculation functions were called in sequence to generate a raw data file based on these parameters, process it into an image, and calculate the CNR of that image. The formula that calculates the CNR in our study is as follows,

CNR = abs(mean(roi)-mean(background))/std(background)

in which the ROI and background area are well defined by the experiment setup. The function then returned the calculated CNR minus 1, with the objective to find the dose that resulted in an target CNR of 1 using a root-finding method.

A root-finding function is defined to employ the bisection technique to find the solution to a target dose condition. This function iteratively narrowed down a range of doses from 2e6 to 4e6 bq until the difference between the upper and lower bounds of the range reached a specified tolerance of 1e4. Once this was achieved, the dose value closest to producing a CNR equivalent to 1 was returned. This approach ensured that the experiment was methodically designed to fine-tune the radiation parameters, ultimately achieving the desired CNR value of 1.

The primary limitation encountered during the creation of the bisection module was the inherent challenge in capturing the nuanced variability in X-ray images of specific tumors or tissues, even when produced under identical conditions of dose and energy. This limitation stems from the stochastic nature of the interactions between X-ray photons and the X-ray detector, resulting in subtle variations in the number of photons reaching the detector at different points that can lead to slight fluctuations in both noise and contrast levels across images. When utilizing a root-finding technique like the bisection method, it is extremely difficult to be able to account for and predict the potentially varied outcomes of noise and contrast that can be produced each time an X-ray image is generated with the same dose and energy value due to the randomly determined nature of the photon-detector interactions, introducing an element of unpredictability. Thus, this function was written only taking into consideration the generation of a single contrast-to-noise ratio possibility for each combination of dose and energy. This highlights the complex and inherently variable nature of X-ray imaging, emphasizing the need for further refinement and consideration of these variations in the future.

Results and Discussion

In this section, we show in detailed steps of applying the procedure outlined above to obtain the optimized dose value for a target CNR and discuss in depth about the nature of calculated CNR and its dependence on various variables in the experiment.

Utilizing the Monte Carlo Simulation in Image Production

We begin our study by running the Opengate Monte Carlo program to generate images representing hypothetical medical X-ray scans with setup and conditions described previously. The amount of X-ray photons received (known as X-ray signal) by the detector plane on two identically located areas of two images generated by the Monte Carlo simulation are depicted graphically in Figure 2. The curve in orange represents the X-ray signal across a centered, horizontal line cut from an image generated with a dose of 4e6 Bq and an energy of 40 keV. The curve in blue represents the X-ray signal across an identically positioned line cut from an image generated with a dose of 2e6 Bq and an equal energy of 40 keV. These generated images revealed a notable disparity in signal between the tumorous region and the background tissue. The graphical representation of signal amounts at pixel positions 75 to 125 (representing the tumorous area on the image) versus the signal amounts at pixel positions 0 to 75 and 125 to 200 (representing healthy tissue on the image) exhibited a more pronounced difference in the image produced from the larger dose (4e6 Bq) compared to the smaller dose (2e6 Bq). This heightened signal contrast in the tumor versus the surrounding tissue on the 4e6 Bq image is attributed to the reduction in noise associated with increased radiation dose, consequently enhancing the CNR and overall image clarity. The difference in signal variations between pixel positions 75 and 125 and the pixel positions representing background tissue in the two images underscore the efficacy of higher doses in delineating tumorous regions, a critical factor in improving diagnostic accuracy and precision in medical imaging.

Figure 2 | 1-D line cut of the X-ray signal on two identically located areas in images generated with 4e6 Bq versus 2e6 Bq. The corresponding CNR are 1.2 and 0.9. The boundary (1-D) between the tumor area and healthy tissue of the phantom object is marked in the plot.

However, during the transmission of X-rays through the patient’s body and onto the detector plane, a fraction of the energy associated with each individual photon was dissipated, leading to a reduction in their original energy levels. This phenomenon can be attributed to inelastic scattering, a process where in X-ray photons interact with atoms in the patient’s tissues, causing the photons to lose energy. As seen in Figure 3, both of the images generated with 4e6 Bq and 2e6 Bq exhibit a considerable number of photons experiencing energy loss during the imaging process. Consequently, the resulting photons exhibited a range of energies, spanning approximately 21 to 40 keV, instead of retaining their initial energy of 40 keV. Since scattered radiation degrades CNR significantly and may change the optimal parameters, we took into account both of the primary and secondary scattering when tabulating the accumulated energy in the detector plane, where a PhaseSpaceActor object is defined within the Opengate Actor framework. It is noteworthy that despite this energy loss, the image generated with 4e6 Bq utilized a higher total number of photons compared to the one generated with 2e6 Bq, as the increased X-ray dose inherently involves a greater quantity of photons. This underscores the intricate balance between optimizing dose for image clarity and managing the inevitable energy loss during the imaging process.

Figure 3 | Kinetic energy spectrum at the detection plane for two difference doses. Inelastic scattering between the photon and atoms plays an important role in reducing the photon energy exiting the body, thus exhibiting a wide range in magnitude. 

Dependence of CNR on Dose

Figure 4 presents a comparative analysis of the noise and contrast levels in images generated through the Monte Carlo simulation. Under a fixed 40 keV energy, the left image was generated with a 2e6 Bq dose, while the right image was generated with a higher dose of 4e6 Bq.

Figure 4 | Monte-Carlo simulation generated images at 2e6 Bq (left) and 4e6 Bq (right) and 40 keV. The former has a higher amount of image noise and lower CNR of 0.9 while the latter has a higher CNR of 1.2

Quantitatively, the calculated CNR of the image generated with 2e6 is around 0.90, while the calculated CNR of the image generated with 4e6 is around 1.20. The image produced with the elevated dose of 4e6 Bq exhibits a discernibly lower level of noise compared to its lower 2e6 Bq counterpart, agreeing with trends in previous literature6 and with the difference determined to be statistically significant. This reduction in noise contributes to an elevated CNR, providing a visually clearer and more distinct representation of the tumorous area. The higher dose facilitates improved CNR characteristics, enhancing the diagnostic efficacy of the generated images and reinforcing the importance of dose optimization in achieving superior image quality.

A comprehensive analysis of the impact of varying doses on image quality was conducted by generating a series of 10 distinct images with doses ranging from 2e6 to 4e6 Bq, while maintaining a constant energy level of 40 keV. Figure 5 provides a visual representation of this analysis, showcasing the corresponding CNRs for each image: 0.90, 0.99, 1.00, 1.00, 1.00, 1.00, 1.01, 1.03, 1.07, and 1.20. The results underscore a clear dependence of CNR on dose, as illustrated by the discernible increase in CNR with escalating doses. This is consistent with the trends identified in previous literature5 and highlights the critical role of dose in influencing image quality, with higher doses correlating positively with elevated CNR.

Figure 5 | A direct relationship between CNR and dose is depicted, as CNR increases with an increase in X-ray dose. Linear regression: y = 0.00000014557x + 0.625; R-squared = 0.997

Dependence of CNR on Energy

Throughout this study we chose a fixed energy of 40 keV as the X-ray source to reflect the fact that the energy of emitted X-ray photons is largely dependent on the manufacturer design of the instrument and is usually not freely tunable during practical operation. However, it is worthwhile to show that although lower energy is preferable in reducing the CNR there is a lower threshold below which the CNR will deteriorate. This is due to the fact a photon with low energy has a greater chance of being scattered off course thus unable to reach the detector plane, reducing the contrast at the detector plane. In fact, in the following table we show a matrix of calculated CNR by varying the X-ray energy from 30 keV to 50 keV in an increment of 5 keV and dose ranging 1.5e6, 2.5e6 and 3.5e6. In the table, we can see CNR increases monotonically versus the dose for a fixed energy, in line with what we have demonstrated so far. CNR’s dependence on energy, on the other hand, increases from high energy, peaks around 40 keV and starts to drop as energy decreases further from 40 keV.

Dose (Bq)1.5e62.5e63.5e6
30 keV0.550.680.8
35 keV0.710.91.04
40 keV0.80.991.14
45 keV0.770.951.08
50 keV0.740.91.02
Table 1 | Calculated CNR on Energy- Dose matrix

Dependence of CNR on Tumor Size

As another study of the characteristics of CNR we demonstrate its dependence on the size of the object being studied. So far we’ve used a fixed tumor size of 5cm by 5cm for our benchmark study of CNR dependence on the characteristics of the photon source. In Table 2 we explore the impact of varying tumor size on CNR under a fixed energy of 40 keV. The square shaped tumor object has its size varies from 8mm, 12mm, 16mm, 20mm and 50mm.

Dose (Bq)2e63e64e6
8mm x 8mm11.171.31
12mm x 12mm1.061.231.37
16mm x 16mm1.031.241.39
20mm x 20mm1.051.271.43
50mm x 50mm1.061.281.45
Table 2 | Calculated CNR on Dose – Tumor Size matrix for a fixed X-ray energy of 40 keV

We can see a clear trend, if not significant, of decreasing CNR when the object size shrinks under the same dose condition. We postulated a plausible explanation as follows: a certain portion of photons passing through the tumor region are scattered through both elastic and inelastic interaction with the tissue atoms and change directions. As a result, they are less likely to reach the detection plane when such scattering becomes more frequent, giving rise to a noisier image. This actually occurs as the size of the tumor area shrinks. The relative proportion of scattered photons from a smaller object actually increases. This explains a slightly lower CNR for smaller tumor sizes in Table 2.

Utilizing the Bisection Method to find optimal CNR

We have demonstrated the impact of various variables on CNR. Although CNR is among the most common metrics in X-ray imaging, it should be noted that determination of the lesion out of the background noise from a X-ray image with confidence is a highly subjective process and there are no universal CNR numbers established to measure the success of the detection process. In other words, visual threshold for individuals can vary person to person, thus CNR threshold for each individual varies.  Bearing this in mind, we designate a target CNR of 1 just for the demonstration purpose, to apply a numerical algorithm – bisection method, for the purpose of finding the corresponding X-ray dose.

IterationLower Dose (Bq)Lower CNRUpper Dose (Bq)Upper CNR
Table 3 | Iteratively narrowing down an interval of dose, beginning at 2e6 to 4e6, until an ideal dose that produces a CNR of 1 was reached

Under the condition of a 40 keV X-ray and a 5cm by 5cm tumor size, we apply the bisection method that took eight iterations to determine the optimal dose yielding a CNR of 1. The initial interval spanned from 2e6 Bq as the lower bound to 4e6 Bq as the upper bound, with the first midpoint being calculated at 3e6 Bq. The CNR for the midpoint was then obtained, and 1 was subtracted to facilitate the root-finding process. The CNR-1 value for the midpoint (3e6 Bq) exhibited opposite signs compared to the CNR-1 value for the lower bound (2e6 Bq). Consequently, the lower bound was retained at 2e6 Bq, and the upper bound was replaced by 3e6 Bq. This iterative process continued, with midpoint doses successively replacing either the upper or lower bounds. Ultimately, when the absolute difference between the upper and lower bound dose values reached 1e4, the bisection method converged, yielding an optimal dose of 2570312.5 Bq with a corresponding CNR of 1.0002, satisfying the goal of 95% accuracy of a CNR of 1. This result signifies the efficacy of the bisection method in pinpointing an optimal dose for maximizing CNR while minimizing noise.

Statistical Significance of this study

A p-value, or probability value, is a number describing how likely data would have occurred by random chance. In this study we used Opengate scientific software to generate realistic X-ray photon trajectories and simulate photon interactions with the human body tumor tissues. There is an intrinsic randomness involved with the whole study, where the calculated photon energy accumulation on the detection plane is an average of the Monte Carlo procedure. To test the statistical significance, we set our tolerance of error margin as 1% and designate a null hypothesis on calculated CNR as

H0: error(CNR)/mean(CNR) > 0.01

where error is statistics incurred uncertainty for calculated CNR. For any given beam input conditions (dose, energy) we can thus calculate its corresponding p-value by studying the statistics of a collection of samples generated through multiple Opengate runs with the same input condition but different random seed, specified in the program as

opengate.Simulation().user_info.random_seed = time.time()

We used Python’s time function to generate a unique seed number for every independent run of Opengate. In line with the range of input conditions in this study, we chose 40 keV and 2e6, 3e6 and 4e6 Bq doses for demonstration. The resulting p-values for calculated CNR are reported in Table 4. As expected, among the three test dose values the lowest 2e6 gives rise to the highest p-value, while 4e6 is the smallest. This is because higher dose corresponds to more simulated photon trajectories which reduces the statistical uncertainty. Overall, all three test doses gave p-values below 0.001, a small enough number to reject the above null hypothesis. In conclusion, the statistical uncertainty of this study is determined to be small.

Dose (Bq)2e63e64e6
Table 4 | Calculated CNR and their p-values for three typical dose values

Future Considerations

There are two limitations of our study as reported in this paper. Firstly, we chose Becquerels instead of the radiation exposure received by the patient’s body as a measure for optimization and discussion. A further study would be looking into the photon energy received by the phantom object (patient) and calculate the radiation exposure by using a more realistic unit of milliSieverts. Secondly, we didn’t look at the aspect of relating CNR and actual tumor detectability.

We plan to continue our study in these two directions. For both cases we will apply a more sophisticated phantom material model, a realistic photon and environment setup and an extensive Monte Carlo study with improved sampling efforts. Continued studies should also seek broader validation across diverse clinical scenarios by focusing on refining the model to better cater to patient-specific variations, such as curating its functions when encountering tumors located within certain organs, areas of the body, and types of tissue.


This study successfully optimized the CNR in X-ray imaging, affirming our initial engineering goal. The quantitative analysis of CNR’s dependence on dose on the images generated with the Monte Carlo simulation allowed for the establishment of a distinct relationship between CNR and X-ray dose with a fixed X-ray energy as well as the obtaining of an optimal dose value to generate a desired CNR. This study proposes a robust model for future research, offering applications in improved cancer diagnosis, radiation exposure reduction, and enhanced, more accurate treatment planning. By providing a careful, optimized approach to X-ray imaging parameters and achieving enhanced contrast and reduced noise ratios through the model, this study offers promising potential for cancer patients who rely on radiation therapy and indicates a potential paradigm shift toward safer, more effective, and patient-tailored treatment experiences.

About the Author

A junior at Horace Greeley High School, Elizabeth Xiu is passionate about oncology and biomedical research. In addition to academic pursuits, she enjoys playing the piano and hiking in her free time. Elizabeth is dedicated to advancing medical science and aspires to make a meaningful impact in the field.


  1. Cancer Data and Statistics. (2023). []
  2. Benefits and Effectiveness. (2020). []
  3. M.J. Siegel, B. Schmidt, D. Bradley, C. Suess, C. Hildebolt, Radiation dose and image quality in pediatric CT: effect of technical factors and phantom size and shape. Radiology. 233, 515–522 (2004). []
  4. E. Sy, V. Samboju, T. Mukhdomi, X-ray Image Production Procedures. (2022). []
  5. R. Morin, M. Mahesh, Role of Noise in Medical Imaging. Journal of the American College of Radiology. (2018). [] []
  6. W. Huda, R. B. Abrahams, Radiographic Techniques, Contrast, and Noise in X-Ray Imaging. American Journal of Roentgenology, 204(2), W126–W131 (2015). [] [] [] [] []
  7. D. J. Bell, Quantum noise.  (2021). []
  8. R. Sharma, Noise.,mAs%20is%20proportional%20to%20dose. (2024). []
  9. C. J. Martin, The importance of radiation quality for optimization in radiology. Biomed Imaging Interv J, 3(2) (2007). []
  10. M. Maddox, What is Scatter Radiation?,X%2Drays%20to%20be%20scattered. (2019). []
  11. M. Kocak, Risks of Radiation in Medical Imaging. (2022). []
  12. T. Werncke, Comparison of a CNR-driven exposure control?and?a?regular?detector?dose-driven?exposure?control in abdominal imaging in a clinical angiography system. Medical Physics []
  13. P. Doyle, C. J. Martin, D. Gentle, Application of contrast-to-noise ratio in optimizing beam quality for digital chest radiography: comparison of experimental measurements and theoretical simulations. Phys Med Biol (2006). []
  14. G. Van Rossum, The Python Library Reference. (2020). []
  15. D. Sarrut, N. Arbor, T. Baudier, D. Borys, A. Etxebeste, H. Fuchs, J. Gajewski, L. Grevillot, S. Jan, G. C. Kagadis, H. Gyu Kang, A. Kirov, O. Kochebina, W. Krzemien, A. Lomax, P. Papadimitroulas, C. Pommranz, E. Roncali, A. Rucinski, C. Winterhalter, L. Maigne, The OpenGATE Ecosystem for Monte Carlo Simulation in Medical Physics. Physics in Medicine & Biology. 67(18), 184001 (2022 []
  16. K. Tatsumi, G4EmLivermorePhysics. [] []


Please enter your comment!
Please enter your name here