Also available in 简体中文
X-ray imaging modalities are widely used in medical diagnostics, such as cancer screening and staging, and also play a significant role in radiotherapy for treatment planning and response monitoring. Although research and trials resulted in substantial efficiency improvements in the past decades, accurate simulations and virtual prototyping can further accelerate the advancement of existing modalities as well as the development of new imaging technologies. This article demonstrates how to simulate X-ray medical imaging in Zemax OpticStudio.
Authored By Csilla Timar-Fulep
Introduction
X-ray and optical technologies are the two main pillars for medical imaging. The main advantages of X-rays are deep tissue penetration, and the ability to image with both robust transmission projection and Computed Tomography (CT) methods. While kilovolt (kV) X-ray modalities can image all parts of the body including internal organs with a high resolution, MegaVolt (MV) X-rays allow precise therapeutic energy delivery to the target tissue. In order to study the working principle for research and development purposes and to improve the device capabilities, there is a growing demand for computer simulations. This article discusses how to use Zemax OpticStudio for X-ray medical imaging with custom human body model and biological tissue materials.
Basic Concept
Zemax OpticStudio is most often used for optical modeling in the visible, infrared, and ultraviolet regimes, but if geometrical optical approximations are valid and accurate material data is available, Zemax OpticStudio can also be used to model propagation at any part of the electromagnetic spectrum, including X-rays. The use of ray tracing for X-ray medical imaging applications is reasonable as diffraction effects can be neglected for the typical object and sample sizes as well as for free-space propagation over a few meters scale. That said, due to the distinctive features of X-ray sources and material properties in this region, special considerations must be applied for the simulations.
In this use case, we demonstrate a planar kilovolt transmission projection X-ray for basic radiographic imaging of the chest. This modality works by launching X-rays from a tube to pass through the subject's body, where tissues attenuate the beam differently based on their density and atomic number. The transmitted X-rays are captured on a detector to produce a two-dimensional projection image representing the cumulative attenuation along each ray path. The basic setup is illustrated on the image above. To simulate this, we implemented a realistic X-ray source together with an accurate human body and biological tissue model based on data published in the literature.
X-ray source
First, to accurately model a typical source for planar kV imaging applications, we used a custom spectrum file (.spcd) to describe the broadband spectral distribution. For demonstration purposes, in this example an 80 kVp source was used with the following spectral distribution. The photon spectrum was calculated from the energy and depth distribution of electrons in tungsten, also accounting for the heel effect in planar X-ray imaging along the cathode-anode direction based on the literature.
For simplicity, in this model the Source Two Angle source type is used to mimic the spatial and angular distribution of the X-ray source. The source has a uniform spatial distribution over a rectangular shape with X and Y Half Width of 1 mm, and Uniform Angle distribution with X and Y Half Angle of 5 degrees.
Custom material definition
The comprehensive definition of the optical properties of different materials is crucial in case of X-ray medical imaging applications due to the nature of these modalities. In the X-ray wavelength range, unlike in the visible spectrum, the refractive index values are close to 1, thus transmission-based imaging modalities rely on the differences in the bulk absorption/internal transmission of materials. In this setup the optical properties, i.e the wavelength-dependent refractive index and bulk absorption coefficient, are calculated from the atomic scattering factors based on the literature. The complex refractive index at a given wavelength is computed based on the following equation:
$$ n = 1 - \dfrac{r_0 \lambda^2 N_A \rho}{2 \pi M} \sum_{i} x_i f_i(0)$$
where r0 is the classical electron radius, λ is the wavelength, NA is the Avogadro number, ρ is the material density, M is the molar mass, xi the are atomic concentrations (coefficients in the chemical formula), and fi(0) are the complex atomic scattering factors for the forward scattering.
Then, the linear absorption coefficient in cm-1 unit is derived from the imaginary part of refractive index:
$$ \mu = 2 \Im(n) k$$
The corresponding custom bulk materials are implemented in Zemax OpticStudio using the Zemax Table Glass (.ZTG) file format, which enables an accurate description based on numerical data. The Zemax Table Glass format provides a text listing of the sampled wavelengths in microns followed by the corresponding index and internal transmission data for the material. Further details and the syntax of the Zemax Table Glass file can be found in this knowledgebase article:
How to enter glass data at specific wavelengths
To associate and store all these specific X-ray ZTG material files in an easily accessible project-based location, we converted the Zemax model to a Lens Project by using the Project Directory feature in Zemax OpticStudio. Further details about how the Project Directories help in organizing Zemax files on a project-by-project basis are discussed in this article:
Using Project Directories to organize OpticStudio files
Human body model setup
In order to realistically simulate X-ray imaging of a subject, we implemented a detailed human body model in Zemax OpticStudio, which authentically represents both the structure of the body and the geometry of the organs, as well as the material properties of the corresponding biological tissues. As this use case demonstrates chest X-ray imaging, which investigates the upper body, the model is focused on accurately representing the vital organs in and around the chest too. Although the model is built based on published data that represent an average male subject, it is important to note that the properties may vary significantly across the population. Therefore, modifications might be required for specific subject groups, and if more accurate data are available for a specific group or application, then the model can be customized accordingly.
Structural model of the internal organs
The structural representation of the male subject is based on the Ansys Human Body Model, which contains a set of projects with geometry and material properties that describe the human body. The full Ansys Human Body model is available for purchase in the Ansys App catalog:
The original models were developed for HFSS, Q3D or Maxwell, where the geometrical and material properties can be edited as with any geometry, and setups are transferable between designs. The full set includes detailed adult male and female models with three different levels of resolution, down to geometric accuracy of millimeters. The original models consist of over 300 body parts including organs, muscles and bones, where each tissue object is a strictly 2-manifold triangular mesh with no non-manifold faces, no non-manifold vertices, no holes, and no self-intersections. Besides, no tissue mesh has triangular facets in contact with other tissue surfaces, i.e. there is always a small gap between different tissue surfaces representing thin membranes separating distinct tissues. These membranes are numerically characterized as average body soft tissue and guarantee the compatibility with CAD formats. At the same time, there are organs fully enclosed within each other that neither touch nor intersect.
In order to use the average adult male Ansys Human Body Model in Zemax OpticStudio, we leveraged the CAD exchange capabilities between Ansys software. For simplicity, in case of this demonstration, the male standing setup was exported to STEP files on a tissue-by-tissue basis, which resulted in 19 CAD objects in total. In Zemax OpticStudio, these 19 parts were imported directly as CAD Part: STEP/IGES/SAT objects. For more details and guidance about how to efficiently import CAD objects, take a look at the following knowledgebase articles:
Tips and tricks for successful CAD import
As there are some organs fully enclosed within each other in the human body setup, the Zemax OpticStudio model was set up carefully considering the Nesting Rule for volumes. According to the Nesting Rule, if a ray strikes more than one object at the exact same location in space, then the last object listed in the NSC Editor determines the optical properties of the volume at that point. This means that the inner objects, which are located inside others, are positioned later in the NSC Editor.
Biological tissue materials
Although the Ansys Human Body model contains certain material information on biological tissues, since its primary target was to address high-frequency applications in HFSS, thus the material data is valid from 10 Hz to 10 GHz, so unfortunately that does not cover the required optical properties in the visible or X-ray region. Therefore, we built the X-ray tissue material database based on different literature resources.
For demonstration purposes, we followed the general approach and calculated the optical properties (refractive index and bulk absorption) for tissues in the X-ray and visible range based on the atomic scattering factors. In order to achieve high accuracy and to best match simulations to real-world measurements, the specific material library for biological tissues is generated as compositions from elements based on ICRU (International Commission on Radiation Units), CIRS (Computerized Imaging Reference Systems), and NCATS (National Center for Advancing Translational Sciences) resources for tissue phantoms. This means that for each organ the material properties are calculated as the weighted average based on their composition from elements according to the standards.
All the tissue properties were calculated and then exported to ZTG file format in an automated way in Python. Thanks to the Project Directory feature, these custom material files are available in the GLASSCAT subfolder under the project folder, and can be easily used in the Zemax OpticStudio simulations, as shown below.
The Internal Transmission vs Wavelength analysis tool provides a detailed overview on the bulk absorption of the different biological tissues, which serves as the basis of transmission-based X-ray imaging modalities. For demonstration purposes, the transmission through 10 mm thickness of Bone Cancellous (blue), Bone Cortical (green), and Muscle (red) materials are visualized as a function of wavelength in the image below.
Radiographic imaging simulation
In order to simulate X-ray medical imaging based on robust transmission projection via ray tracing, Use Polarization must be turned on in Zemax OpticStudio to accurately track bulk absorption inside biological tissues through the propagation. Besides, since Fresnel reflection at the different tissue boundaries is negligible in the X-ray regime due to the very small changes in the refractive index, Split NSC Rays is turned off in the model. This means that each ray traced have only one branch with multiple segments going from the source through the body, inside the different organs, and to the detector. The entire human body model with biological tissues and light propagation through it is shown in the Shaded Model below.
Transmission projection imaging
To accurately model chest X-ray imaging, the simulation is set up with the standard 1.8 m source-to-detector distance. In Zemax OpticStudio, a Detector Rectangle object is used to model the X-ray detector and acquire transmission projection images. An extra detector with the same type and settings is used in the simulation to review and visualize the beam parameters before the subject. The picture below illustrates X-ray transmission projection imaging of the upper body in both linear (right) and logarithmic (left) scales. As expected, bones, such as ribs and vertebrae, appear bright on the images due to their low internal transmission in the X-ray regime, compared to soft tissues, which appear darker. The lung, which is filled with air in the model, appears the darkest according to its highest internal transmission. The results are in good agreement with expectations based on the literature.
Radiation dosage estimation
To provide further insights into the imaging procedure, a Detector Volume objects is also added into the design to measure the incident and absorbed flux inside the human body. To comply with the Nesting Rule for volumes, the Detector Volume object is placed in the NSC Editor above the CAD parts representing the human body. Further details and enhanced visualization capabilities with the Detector Volume object and scripting are discussed in this knowledgebase article:
How to show Detector Volume data in 3-D
The Detector Volume allows for flux measurement inside the voxels, based on which one can estimate the radiation dosage in the different organs. This means that ray tracing simulation can be used to predict the dose load of the subject during the procedure, so that optimal screening frequency can be determined considering both benefits and risks of the radiation. Similarly, in case of radiotherapy treatments, simulations and dose estimations play a crucial role in designing the ideal radiation dose for diseased tissues. The image below demonstrates the absorbed dose in the chest in a coronal plane in both linear (right) and logarithmic (left) scale. The absorbed radiation dosage is the larger in the vertebrae, due to the low transmission and high absorption of its material, so these areas appear darker on the images. On the other hand, the absorbed flux is the smaller inside the lungs, filled with air, due to the high transmission in these areas visualized in bright color.
Conclusion
In this article, we demonstrated how to simulate X-ray medical imaging via ray tracing in Zemax OpticStudio. The model relies on a realistic human body setup supplemented with an accurate biological tissue description in both the visible and X-ray wavelength ranges. This example design showcases in-silica modelling capabilities and advantages for healthcare applications including medical diagnostics, e.g. cancer screening and staging, as well as radiotherapy for treatment planning and response monitoring.
References
- B. Pogue, B. Wilson. Optical and x-ray technology synergies enabling diagnostic and therapeutic applications in medicine. Journal of Biomedical Optics, 23(12):121610 (2018).
- J. Wilde, L. Hesselink. Modeling of an X-ray grating-based imaging interferometer using ray tracing. Optics Express, 28(17):24657-24681 (2020).
- G. Landry, F. Blois, F. Verhaegen. ImaSim, a software tool for basic education of medical x-ray imaging in radiotherapy and radiology. Frontiers in Physics, Biomedical Physics, 1(22):1-7 (2013).
- K. Klementiev, R. Chernikov. Powerful scriptable ray tracing package xrt. Proceedings of SPIE - Advances in Computational Methods for X-Ray Optics III, 9209(92090-A):1-16 (2014).
- M. Wu, P. FitzGerald, J. Zhang, W. Segars, H. Yu, Y. Xu, B. De Man. XCIST – An Open Access X-ray/CT Simulation Toolkit. Physics in Medicine and Biology, 67(19):1-36 (2023).