**2. Treatment planning system (TPS) algorithms**

For understanding TPS algorithms, it is required to know [1]:


By far, medical linear accelerators (linac) are the main devices used in the treatment of cancer patients producing X-rays and electrons in the clinical energy range. In the head of a linac, high energy electrons are accelerated to the near speed of light and are directed to strike a high Z target typically made of Tungsten which has also a high melting point to produce photon. The bremsstrahlung photons produced by a linac have an energy distribution from 0 to maximum energy of the electrons in the beam impinging upon the target. These photons pass through the primary collimator and other parts of the linac head such as jaws, Multi Leaf Collimator (MLC) system, etc. before reaching the patient. All these photons (primary and scattered) will contribute to photon fluence. For example, for a typical Varian linac with a flattening filter, 80–90% of primary photons are directly from the target, 3–5% from the primary collimator, 8–12% originated from the flattening filter [1, 2]. However, in modern linacs which are equipped with flattening filter free (FFF) technology, scatter photon produced in the treatment head has significantly decreased [3, 4]. Therefore, the contribution of primary and scatter photon in photon fluence for FFF is different from the flattened beam [5]. For example for a 40 40 cm<sup>2</sup> field size and a 6 MV FFF beam, the calculated contribution was 84.6% for the primary source, 11.3% for the first scattered source, and 4.1% for the second scattered source [5].

In general, ionizing radiation such as photon, electron, and heavy charged particles interact with matter which depends on the energy of ionizing radiation, type of ionizing radiation, the atomic number, and density of the medium through which they travel. Photons are indirect ionizing radiation and energy deposition of the photon to the material is dominated by three interactions: Photoelectric, Compton scatter, and pair production. In the energy range from 100 Kev to 10 MeV, which is a mostly therapeutic range, the Compton process is dominant for energy absorption in soft tissues. The energy deposition of photons involves two stages: First, partial transfer of their kinetic energy to charged particles (electron, positron) when they interact with material, and second, energy deposition from these charged particles to material through excitation or ionization. The range of charged particles in the therapeutic energy range can be several centimeters so they can travel and pass-through various layers with different densities and atomic numbers in a human body. When charged particle equilibrium (CPE) is achieved, then there is a linear relationship between TERMA<sup>1</sup> (Total energy released per unit mass) and dose, and the two steps can be included in a single calculation. However, this condition does not occur near the edge of the field or in inhomogeneity regions like at tissue interfaces, therefore, this

<sup>1</sup> the production of mass attenuation coefficient and primary energy fluence of photon.

simplification cannot be valid, and the two steps of energy deposition of the photon to medium must be more clearly distinguished [6].

The human body consists of a variety of tissues and cavities that are radiologically different from water, such as lungs, oral cavities, teeth, nasal passages, sinuses, and bones. A treatment planning system uses the electron density derived from CT images of patients to calculate dose in the patient body. Therefore, the dose distribution inside the patient body is affected by these heterogeneities. In this area, the ability of treatment planning systems to calculate dose at the interferences such as lung vs. tissue, bone vs. air cavity, etc. is crucial. Also, using CT images with 3D TPS allows us to design a plan with complex beam arrangements which require more advanced dose computation algorithms. In this section, we will present a summary review of the past and current dose calculation algorithms used in the TPS for radiotherapy.

According to the American Association of Physicists in Medicine (AAPM) Task Group 65 (TG-65, Report No.85) [6], there are four types of inhomogeneity correction algorithms:

Category.1: Linear attenuation, Ratio of tissue air ratio (RTAR), Power law (Batho). Category.2: Equivalent TAR, Differential scatter air ratio (dSAR), Delta volume, Differential TAR, and 3D Beam subtraction method.

Category.3: Convolution (pencil beam) and Fast Fourier transformation (FFT) techniques.

Category.4: Superposition/Convolution, Monte Carlo.

#### **2.1 Category.1**

#### *2.1.1 Linear attenuation*

This is the simplest technique for computation of inhomogeneity correction factor (ICF), which does not include any information regarding electron density and the geometric treatment beam parameters such as field size [6].

$$ICF = (\text{@per } cm) \times inhomogeneous^{\dagger} thickness \ (cm) \tag{1}$$

*2.1.2 Ratio of tissue air ratio (RTAR)*

Only heterogeneity correction applied on the beam path from source to the calculation point.

$$ICF(d,r) = \frac{TAR(d',r)}{TAR(d,r)}\tag{2}$$

where *d* and *d*' are physical depth and water equivalent depth to the calculation point and *r* is the field size at depth d. The main weakness of this method is overcorrection when the density of the medium is less than the density of the water and under correction when the density is greater than the density of water due to compromised modeling of lateral component of the scattered photon [7].

#### *2.1.3 Power law (Batho)*

This is an empirical correction factor method for points lying within water and distal to an inhomogeneity by raising tissue-air ratios to a power that depends on

density. This was first proposed by Batho in 1964 [8] and then modified by Sontag and Cunningham in 1977 [9].

$$ICF = \frac{TAR(d\_1, r)^{\rho\_1 - \rho\_2}}{TAR(d\_2, r)^{1 - \rho\_2}} \tag{3}$$

where *d*<sup>1</sup> is depth to first slab boundary and *d*<sup>2</sup> is depth to second slab boundary from the point of calculation at depth *d*. *r* is field size at depth *d* and ρ<sup>1</sup> and ρ<sup>2</sup> are densities of the medium in which the calculation point is located and relative electron density of the overlying material respectively.

The power law method underestimates the dose when density is less than one and overestimates when density is greater than one [6]. Several studies showed improvement if Tissue Maximum Ratio (TMR) is used instead of TAR [10, 11].

#### **2.2 Category.2**

#### *2.2.1 Equivalent TAR (ETAR)*

It can be considered as the first practical dose calculation method using the full CT data set for computerized treatment planning and was used in early treatment planning systems [6].

$$ICF(d, r) = \frac{TAR(d', \bar{r})}{TAR(d, r)} \tag{4}$$

where *d*<sup>0</sup> and ~*r* represent the "scaled" or "effective" values of depth at interesting point (*d*) and field radius (*r*) respectively for the energy of the radiation being used. This method required excessive computer memory and calculation times; therefore, some adjustments such as the coalescing of adjacent CT slices were applied to reduce 3D calculations to appropriate 2D calculations to make it more practical for use in clinics in the 1980s.

#### *2.2.2 Differential scatter air ratio (dSAR)*

This was a 3D dose calculation in a heterogeneous media that used scatter-air ratios (SAR) to calculate the dose to a point in an inhomogeneous medium. For this purpose, a SAR table was used to determine the scatter contribution that arises from voxels within the irradiation volume [12].

#### *2.2.3 Delta volume (DVOL)*

The primary dose, an analytical first-scatter dose component, and an approximate residual multiple-scatter component were summed to calculate dose at a point in a heterogeneous medium. This method has been examined and justified for Co-60 and succeeds incorrectly calculating the dose to (a) water with a small void and, (b) homogeneous non-water medium.

dSAR and DVOL have never been implemented in clinics due to the long *CPU* time required to run them with no significant improvement in dose calculation accuracy compared to previously used algorithms [7].

#### *2.2.4 Differential TAR*

Kappas and Rosenwald [13] showed that applying K(θ,μ) on dSAR method results in more accurate results.

$$K(\theta,\mu) = e^{\left(\mu\_0 \cos \theta - \mu\_1(\theta)\right)\left(b - b\right)}\tag{5}$$

where *μ<sup>0</sup>* and *μ<sup>1</sup>* are the linear attenuation coefficients in the water of the primary and of the first-order scattered photons arriving at a point after a deflection. *b* is the path length en route to point (in the waterlike medium) and *b* is the corresponding effective path length (in the heterogeneous medium). For very large fields and depths and when the thickness of the overlying tissue is greater than 5 cm, the difference between measurement and calculation is more than 2% and less than 6% [6].

In general, categories 1 and 2 are not applicable when photon energy is greater than 6MV where scatter contribution is less important, and the effects of secondary electrons (delta rays) set in motion can result in very high local dose changes [6].

#### **2.3 Category.3**

#### *2.3.1 Convolution techniques*

This technique is a model-based algorithm which unlike correction-based algorithms uses heterogeneity effects directly to compute the dose in tissue. Kernels are used for modeling the dose distribution in media. The kernels represent the energy spread and dose deposition of secondary particles from an interaction at a given point or line which is not usually accessible through measurements but is very simple to calculate by use of Monte Carlo particle transport codes [12]. Absorbed dose is calculated based on the following equation

$$Absorbed\ Dose = energy\ fluence\ distribution\otimes\,\text{K}\tag{6}$$

This means that the energy fluence distribution is *convolved*<sup>2</sup> with the scatter spread kernel (K) to obtain the dose.

*Energy deposition Kernel (EDK)* is the energy distribution revealed to volume elements (per unit volume) in an irradiated medium, commonly water. There are three different categories for EDKs based on the geometry of the elemental beam that delivers the incident energy: A point kernel, pencil kernel, and planar kernel [7].

*Point Kernel*: This kernel describes the pattern of energy deposition in an infinite media around a primary photon interaction site.

*Pencil Kernel:* This kernel describes the energy deposition in a semi-infinite medium from a point monodirectional beam.

*Planar Kernel:* A planar kernel describes the energy spread from primary interactions located in a plane of an infinite broad beam.

In 1986, Mohan et al. [14] introduced a *differential Pencil beam algorithm* which is a good example of this category. This is the simplest and fastest algorithm for dose calculation because it only considers inhomogeneity corrections in longitudinal

<sup>2</sup> Convolution, ⊗ , is a mathematical operation used to combine functions.

direction in the central beam axis and ignores lateral scatter. Therefore, it does not accurately model the distribution of secondary electrons in heterogeneous media. This limitation causes inaccurate dose calculation in heterogeneous treatment sites such as the lung, bone, or interfaces [15, 16].

### *2.3.2 Fast Fourier transform (FFT) convolution*

This technique reduces computation time greatly because of the invariant kernel assumption for the convolution calculation. Because of this assumption, different kernels at different regions based on the density cannot be used in FFT. Several studies were conducted to circumvent invariant kernel assumptions [17–19]. In 1996, Wong et al. [20] proposed a solution to address problems related to lateral disequilibrium and penumbra in low-density regions because a water kernel was used for entire regions even in low-density regions. The lateral disequilibrium problem was solved by *lateral* scaling of the field size at each depth according to local effective densities to adjust the dose along the central axis in heterogeneities. This technique is based on the ETAR method, by convolving the density at the intersection site with the primary kernel for water. The resultant dose distribution is then inverse scaled according to the effective density to correct the penumbra problem which accounts for the electron transport near the field edge inside a low-density medium with or without lateral disequilibrium.
