Introduction
Cancer is a leading cause of death worldwide. According to cancer statistics from the National Cancer Center (NCC) of China, 4.82 million new cancer patients and 2.57 million deaths are expected in China in 2022 [1]. Cancer is a major problem affecting national health. Currently, cancer treatment modalities include surgery, chemotherapy, and radiation therapy. Almost 50% to 70% of cancer patients in China receive radiation therapy during treatment, which has been playing an increasingly important role in cancer treatment. Among these, boron neutron capture therapy (BNCT), a state-of-the-art tumor radiotherapy technology based on neutron radiotherapy, has been developed in various countries worldwide. The main principle is to inject boron-containing drugs (boronophenylalanine, BPA, and sodium boronophenylalanine, BSH) with tumor specificity into the patient’s body. After a period of metabolism of the boron drug in the patient’s body, the drug is enriched in the tumor area, and then the tumor is irradiated with a neutron beam generated by the neutron source. Owing to the very large thermal neutron absorption cross-section of 10B, a large amount of 10B undergoes the 10B(n,α)7Li reaction, which releases two high Linear Energy Transfer (LET) particles, α and 7Li. Through these two particles, energy is deposited in the range of approximately 12-13 μm, causing irreparable damage to cellular DNA in the area of the deposited energy and ultimately killing tumor cells [2]. The BNCT reaction formula and a basic schematic are shown in Fig. 1.

BNCT treatment is based on the calculation and analysis of the distribution of irradiation doses in the patient’s body, which is used to determine the optimal treatment plan for the duration and angle of orientation of neutron beam exposure, while observing the dose limitations that jeopardize normal tissues and organs. The tissue dose in BNCT comprises the following four parts [3]:
Boron dose. It is produced by the 10B(n,α)7Li reaction, and because the absorption cross-section of boron for thermal neutrons is very large (3840 b), the reaction releases much energy; thus, the boron dose contributes significantly to the total dose and is the main component [4].
Thermal neutron doses. Thermal neutrons react with the 14N atom in the human body to generate recoil nuclei 14C and protons, and this dose is generated by the deposition of energy in the cells of the human body.
Epithermal and fast neutron doses. Dose resulting from energy deposited by epithermal and fast neutrons (En>0.5 eV) through elastic scattering with various nuclides. Over 90% of this dose arises from the elastic scattering contribution of neutrons with 1H, whereas the remaining portion is contributed by scattering from nuclides such as 12C and 16O.
Photon dose. There are three main production pathways: γ rays produced by the accompanying incident neutron beam, rays produced by the boron neutron capture reaction, and γ rays produced by the thermal neutron capture reaction with H atoms in the human body.
The calculations of these four dose components are complicated, and no empirical formula for accurate dose calculations has been reported to date. At this stage, Monte Carlo (MC) simulations are mainly used in the BNCT Treatment Planning System (TPS) to calculate the radiation dose distribution of patients [5]. Moreover, the TPS of BNCT is significantly different from the photon or electron TPS of conventional radiotherapy. In conventional radiotherapy, only a single dose from a primary photon or electron must be calculated, and a simple numerical-model-based approach is applied to accelerate the calculation. For the calculation of the dose of BNCT, many factors are involved, such as the neutron source, boron content, distribution of the neutron energy in tissues, and the total dose composed of different doses with different biological effects, which makes its TPS more complicated than traditional methods and requires greater accuracy and technical support to ensure the effectiveness and safety of the treatment. Currently, the international TPS technology for BNCT is maturing, and a variety of BNCT treatment software programs have been developed, including NCTPlan and SERA in the United States [6, 7], BDTPS in Italy [8], JCDS-FX, TsukubaPlan, and NeuCure in Japan [9-11], and NeuMANTA, THORPlan, and MCDB in China [12-14]. The characteristics of each BNCT treatment planning system are presented in Table 1 [15].
| TPS | Country/Institution | Geometry | Dose program | Cross section |
|---|---|---|---|---|
| NCTPlan | USA/Harvard-MIT | voxel | MCNP4B/5 | Continuous energy |
| SERA | USA/INEEL-MSU | univela | seraMultigroup | Multigroup |
| BDTPS | Italy/University of Pisa/JRC | voxel | MCNP | Continuous energy |
| JCDS-FX | Japan/JAEA | voxel/multi-voxel | MCNP5 | Continuous energy |
| TsukubaPlan | Japan/Tsukuba University | voxel | PHITS | Continuous energy |
| NeuCure | Japan/Sumitomo Heavy Industry | voxel | PHITS | Continuous energy |
| NeuMANTA | China/Neuboron | voxel | COMPASS | Continuous energy |
| THORPlan | China/Tsing Hua University | voxel | MCNP4C | Continuous energy |
| MCDB | China/IAPCM,Beijing | voxel | MCNP4C | Continuous energy |
The TPS of BNCT consists of three parts: pre-processing, post-processing, and dose calculation (Fig. 2), in which pre-processing is used to read and display the CT/MRI medical image data (including the body geometry and material) and cooperates with the neutron irradiation conditions to generate the input file required for dose calculation, which will process the output of the dose calculation and display the results in graphs, which is convenient for users to analyze the results of the calculation. The dose calculation is the core part of the whole TPS, and the MC method is usually used to simulate the dose of particles produced by neutron beams. As shown in Table 1, MCNP has been widely used as a TPS dose calculation program for BNCT because it supports neutron-photon multiparticle simulation, is relatively easy to use, provides flexible source definitions, has a large number of users, and has been fully validated by experiments. However, the MCNP program system is enormous, and its application is limited not only to the field of nuclear medicine but also to the fields of nuclear energy, nuclear engineering, nuclear technology, and other related theoretical calculations. MCNP, as commercial software, is subject to strict licensing restrictions, especially in certain countries (e.g., China) or specific application areas, while Fortran programming has weak support for object-oriented programming, which is not as comprehensive and flexible as C++ and is not conducive to the subsequent development of specific areas of need. Therefore, a program specifically for dosimetry computation in BNCT is required, which should be characterized by a small program size, a high degree of autonomy, and friendly extensibility.

In this study, MagicDose, a dose calculation program for BNCT treatment planning, is developed using MC particle transport and C++. Compared to MCNP, it features compact size, specialization, and autonomy, with modular design enabling independent development and maintenance of functional modules. It provides functions like fine-voxelization phantom construction, a human tissue composition library, a Kinetic Energy Released in Matter (Kerma) factor library, and spatial plane rotation for BNCT dose calculation. It supports server parallel computing and results visualization for efficient analysis. To validate MagicDose, this paper: (1) Prepared voxel phantom of modified Snyder head with 16 and 8 mm resolution as benchmark, verifying that neutron and photon dose rates calculated by MagicDose and MCNP are consistent, with MagicDose showing better computational efficiency; (2) Using material-located method with central point algorithm, constructed voxel phantom of modified Snyder head with tumor at 16-, 8-, and 1-mm resolutions to analyze the influence of model voxel sizes through depth-dose-rate curves and spatial distribution maps. The parallel computational efficiency was analyzed across different spatial resolutions and thread numbers; (3) Applied MagicDose to a clinical BNCT case using a patient’s CT head model.
Material and method
MagicDose program development & framework
Dose calculation is the core part of the whole BNCT treatment planning system, which is based on the MC particle transport method. MagicDose, a dose calculation program dedicated to the BNCT treatment planning system, is developed in C++, which is convenient for future development and maintenance of the BNCT treatment planning system. The MagicDose program consists of seven functional modules, including the Geometry module, Source module, Database module, Particle Transport module, Tally module, Output module, and Auxiliary module. Figure 3 illustrates the MagicDose development framework.

Geometry module: In the BNCT treatment planning system, the 3D voxel phantom is the most commonly used geometric modeling technique and is usually constructed based on image information from computed tomography (CT) or magnetic resonance imaging (MRI). According to statistics, when MC particle transport simulations are performed, approximately 30–80% of the computational time is spent on geometry processing; therefore, the MagicDose program combines the characteristics of CT/MRI image information and the advantages of the lattice structure geometry processing method, which has a better average efficiency compared to the constructive solid geometry (CSG) method. First, based on the CSG method, each tissue is defined as a cubic universe according to the surface equation; then, multiple universes are arrayed and discharged to form a repetitive lattice structure, which is then combined with the database module to fill in the nuclide composition and ratio of the corresponding tissue region to construct a complex dose calculation model. Figure 4 shows a lattice mapping of the geometric model [16].

Source module: It is important to determine the source of BNCT irradiation in TPS because it involves a 5-dimensional (X, Y, Z, E, Ω) probability distribution that accurately describes the spatial, energy, and angular characteristics of the neutron beam. The MagicDose program supports a variety of commonly used source terms, including the point source of monodirectional angular distribution, point source of isotropic angular distribution, spatial source of isotropic angular distribution, and spatial plane source with translation and rotation. It is capable of simulating neutrons, photons, and neutron-photon coupled transport and supports a variety of probability distributions (discrete, continuous, histogram, and mixed distribution) for the corresponding source parameters, thus providing an effective tool for simulating complex source beams for BNCT [17-19].
Figure 5(a) shows the schematic of an in-hospital neutron irradiator type I reactor (IHNI-I), which is the first prototype in the world that meets the requirements of the IAEA-specialized neutron source device BNCT [20]. The site selection is located approximately 2 kilometers from the Beijing Nuclear Industry Hospital rather than being directly installed within the hospital premises. This decision stems from the consideration of various uncertainties, such as the distribution and control of radiation dose levels, with the aim of accumulating experience and establishing a technical foundation for the future construction and application of BNCT neutron sources [21]. The IHNI-I has a “tank-pool” structure with a rated power of 30 kW and two beam holes for thermal and epithermal neutrons. To avoid the significant computational time required to track particles from the reactor core for simulating the dose distribution in the human body, MagicDose establishes equivalent surface sources at the exits of the two beam flow orifices of IHNI-I to facilitate rapid dose calculations. The equivalent surface source, denoted as φ(R, E, μ), is a function of the spatial position, energy, and direction, where R represents the radial distance (cm), E denotes the energy (MeV), and μ is the cosine of the scattering angle (ranging from -1 to 1). Given that the collimator aperture diameter of IHNI-I is 12 cm, to more accurately capture the particle information emitted from the beam ports in constructing the equivalent surface source, this study divides the radial direction R into three intervals: 0<R<6, 6<R<10, and 10<R<15, as shown in Fig. 5(b) [22, 23]. The energy spectra shown in Fig. 5(c) originate from an equivalent surface source at the thermal neutron beam port of IHNI-I, whereas the energy spectrum in Fig. 5(d) originates from the equivalent surface source at the epithermal neutron beam port of IHNI-I [21].

Database module: In the particle transport calculation, the microscopic cross-section and angular distribution data of nuclear reactions induced by particles of various energy segments and nuclides are involved. Because a low-energy neutron contributes significantly to the dose of BNCT, when the neutron energy is reduced to a few eV, the thermal motion of the scattering target nucleus has a strong effect on the collision, which affects the energy of the emitted neutron and the exit angle, eventually leading to errors in the results. MCNP provides an S(α,β) thermal scattering model for this case, which directly calls the S(α,β) thermal scattering model data from the corresponding nuclides [24]. The MagicDose program also saved the same S(α,β) thermal scattering data for the thermal neutron scattering of H in the voxel phantom material. The MagicDose program stores the physically relevant data of each reaction cross section in particle transport based on the ENDF/B-VIII.0 evaluation database using the HDF5 data format, which has the advantages of a hierarchical structure and can handle large datasets [25]. The actual tissue components must be simulated in the calculation of the BNCT dose, according to the ICRU46 and ICRU63 reports [26, 27], a material library including 106 human tissue components (Table 2), and the corresponding Kerma factor library (Fig. 6) with functions that support the addition, modification, and editing of the related data. In the Kerma factor library, the neutron energy range spans from 0.0253 eV to 29 MeV, divided into 117 energy groups, while the photon energy range extends from 0.01 MeV to 100 MeV, divided into 33 energy groups. In the boron dose calculation of MagicDose, a Kerma factor of 1 ppm is adopted. The Kerma factor library is constructed according to Eq. (1) and Eq. (2).

| Tissue | Density (g/cm3) | Elemental composition (mass percentage %) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| H | C | N | O | Na | P | S | Cl | K | … | |||
| Brain (whole) | Fetus (14weeks) | 1.02 | 10.90 | 3.30 | 0.70 | 84.20 | 0.20 | 0.20 | 0.00 | 0.30 | 0.20 | … |
| Newborn | 1.03 | 10.80 | 5.50 | 1.10 | 81.60 | 0.20 | 0.30 | 0.10 | 0.20 | 0.20 | … | |
| Infant (18months) | 1.03 | 10.70 | 9.10 | 1.60 | 77.60 | 0.20 | 0.30 | 0.10 | 0.20 | 0.20 | … | |
| Adult | 1.04 | 10.70 | 14.50 | 2.20 | 71.20 | 0.20 | 0.40 | 0.20 | 0.30 | 0.30 | … | |
| Lung | Fetus (17-40 weeks) | 1.04 | 10.60 | 7.60 | 1.80 | 79.20 | 0.20 | 0.20 | 0.10 | 0.20 | 0.10 | … |
| Adult (healthy) | 0.26 (Inflated) | 10.30 | 10.50 | 3.10 | 74.90 | 0.20 | 0.20 | 0.30 | 0.30 | 0.20 | … | |
| Adult (congested) | 1.04 | 10.50 | 8.30 | 2.30 | 77.90 | 0.20 | 0.10 | 0.20 | 0.30 | 0.20 | … | |
| Heart | Fetus (17-40 weeks) | 1.04 | 10.60 | 7.50 | 1.80 | 79.30 | 0.20 | 0.10 | 0.10 | 0.20 | 0.20 | … |
| Child (2 years) | 1.04 | 10.50 | 8.80 | 2.20 | 77.70 | 0.10 | 0.20 | 0.10 | 0.20 | 0.20 | … | |
| Child (4-18 years) | 1.04 | 10.50 | 10.40 | 2.50 | 75.70 | 0.10 | 0.20 | 0.10 | 0.20 | 0.30 | … | |
| Adult (healthy) | 1.05 | 10.40 | 13.90 | 2.90 | 71.80 | 0.10 | 0.20 | 0.20 | 0.20 | 0.30 | … | |
| Adult (fatty) | 1.04 | 10.30 | 18.20 | 3.10 | 67.40 | 0.10 | 0.20 | 0.20 | 0.20 | 0.30 | … | |
| … | ||||||||||||

Particle transport module: BNCT dose calculation is the neutron-photon coupled transport process, and this module deals mainly with the MagicDose program to simulate the particle production-to-disappearance process. Neutron–matter interactions mainly involve elastic scattering, inelastic scattering, and absorption, in which absorption contains the dose-dependent reactions of interest to BNCT (n,α), (n,p), and (n,γ). During this process, the photons generated by a neutron are stored in the particle bank for subsequent photon transport. With respect to the photon-matter interactions, the photoelectric effect, electron pair effect, coherent scattering, and Compton scattering are primarily considered [28]. Figure 7 shows a particle transport flow diagram.

Tally module: After particle transport is completed, users can set different statistical parameters to invoke the tally module according to their own needs, among which the parameters include selection of the region of interest. The program supports two ways of statistics—cell statistic and virtual superposition mesh statistic—and supports setting of energy region and particle type, etc. The corresponding quantity of flux ϕ is obtained in various statistical ways, and the data for each dose component can be obtained by combining Eq. (3) and the Kerma factor library in the database module.
Output module: The data counted by the tally module are transferred to the output module, through which the data of boron dose, thermal neutron dose, epithermal and fast neutron dose, and photon dose of interest in BNCT treatment are exported. As different types of ionizing radiation cause different biological effects in living organisms, and BNCT involves mixed-field irradiation of several different radiation dose components, for BNCT treatment, it is necessary to measure the relative biological effectiveness (RBE) of each dose component and assess its killing effect on normal tissues and tumors. The RBE experimentally measured is used to characterize the high or low biological effect dose of the thermal neutron dose, epithermal and fast neutron dose, and photon dose. To convert the local high LET radiation dose produced by 10B(n,α)7Li into an equivalent dose, the use of a compound biological effect (CBE) factor is required to more accurately assess its actual biological effects on biological tissues, especially tumors and normal tissues [30, 31]. Multiplying each of the above four dose components by their corresponding weighting factors yielded the total relative biological effect dose H (Eq. (4)).
Auxiliary module: The auxiliary module is used to enhance the main functions and improve program maintainability and user-friendliness, including the provision of related function libraries, such as mathematical libraries related to each mathematical probability sampling in source sampling (Math) and file manipulation functions, to improve code reusability. Simultaneously, the program stability is enhanced by the exception-catching mechanism (fatal error, warning), which detects and handles abnormalities during operation to prevent the whole program from crashing. The visualization tool in the auxiliary module shows the results of the output module, which presents the results of each BNCT dose field in 2D/3D form. The interface information outputs provide key information to the user, including run status, progress reports, run date, and number of threads, to facilitate user interaction with the program.
The MagicDose program adopts the particle transport module as the core, interconnects with the upstream geometry, source, and database modules, and simultaneously supports the downstream tally and output modules. Each module is independent of the others, and module functions are realized by messages passing through the interface, which is conducive to the maintenance and expansion of the program.
Calculation conditions and models
To verify the accuracy and efficiency of MagicDose, three models are selected for testing. First, because the MCNP program can be used as a standard for all types of MC calculations and is often used to calibrate the correctness tests of other MC programs, the results of MagicDose calculations are compared with MCNP. The two programs select the voxel phantom of a modified Snyder head with 16 and 8 mm resolution, which is commonly used internationally. Under the same irradiation conditions, we compare the calculated spatial neutron and photon dose rates to see if they are consistent and count the computational efficiency of both. Subsequently, to explore the influence of voxel phantom on the calculation results under different spatial resolutions, the MCNP computational analytical model is used as the reference result. The voxel phantom of the modified Snyder head with a tumor having three different spatial resolutions of 16, 8, and 1 mm was constructed using MagicDose combined with the material-located method using the central point algorithm. The depth-dose-rate curves and spatial value distribution plots are used to analyze the effect of model voxel size on the results and to statistically calculate the computational efficiency of MagicDose with different resolutions and the number of threads. Finally, based on the CT head model of a patient given by DICOM data, we initially verify whether MagicDose can be applied to the clinical case of BNCT.
All the calculations in this study are performed on an Intel (R) Core(TM) i7-10700 K CPU @ 3.8 GHz with 32 GB RAM and 16 threads. To minimize the impact of the results from the deep penetration of the MC program, the number of particles is set to 1 × 108 for both MagicDose and MCNP to ensure that the number of samples is adequate [32, 33]. In the actual BNCT treatment, some photons are produced by the accompanying neutron source, which cannot be avoided. We assume the absence of accompanying photon contamination from the neutron source and only discuss the induced photons produced by the reaction of neutrons with nuclides in the voxel.
(1) Voxel phantom of the modified Snyder head with 16 and 8 mm
Currently, the benchmark problem commonly adopted internationally for BNCT dose calculation is the modified Snyder head phantom, which consists of three ellipsoidal surfaces to define the boundaries of different tissues, dividing the head from inside to outside into three parts: brain tissue, skull, and scalp tissue. The whole head is surrounded by air, which is usually called the analytical model (Fig. 8). The densities of air, scalp, skull, and brain tissue are 0.001293, 1.09, 1.61, and 1.04 g/cm3, respectively, and the corresponding elements of the human tissue are obtained from the MagicDose database module with the specific parameters listed in Table 3.

| Elemental composition | Tissue (mass percentage %) | |||
|---|---|---|---|---|
| Air | Scalp | Skull | Brain | |
| H | 0.00 | 10.00 | 5.00 | 10.70 |
| C | 0.01 | 20.40 | 21.20 | 14.50 |
| N | 75.53 | 4.20 | 4.00 | 2.20 |
| O | 23.18 | 64.50 | 43.50 | 71.20 |
| Na | 0.00 | 0.20 | 0.10 | 0.20 |
| Mg | 0.00 | 0.00 | 0.20 | 0.00 |
| P | 0.00 | 0.10 | 8.10 | 0.40 |
| S | 0.00 | 0.20 | 0.30 | 0.20 |
| Cl | 0.00 | 0.30 | 0.00 | 0.30 |
| K | 0.00 | 0.10 | 0.00 | 0.30 |
| Ca | 1.28 | 0.00 | 17.60 | 0.00 |
The surface analytical equations for the modified Snyder head phantom with tumor at each interface are expressed as follows:
Boundary surfaces of the scalp and air
Boundary surfaces of the skull and scalp
Boundary surface between brain and skull
In clinical treatment, owing to the different shapes, locations, and sizes of patients’ tumors, it is not possible to use analytical equations to describe the phantom; therefore, it is common to use a continuous and uniform cubic mesh to approximate the phantom structure in international clinics, which are generally called voxel phantoms. Goorley et al. [3] constructed 16 and 8 mm voxel phantoms as an international benchmark problem based on the modified Snyder’s analytical model, which is mixed with four basic materials (brain, skull, scalp, and air); the volume share of each basic material in the mix is a multiple of 10% to produce the mixed materials and corresponding mixing densities, and a total of 286 hybrid materials are derived. Therefore, to verify the accuracy of MagicDose, identical 16 and 8 mm voxel phantoms are constructed based on MagicDose and MCNP respectively (Fig. 9).

For the irradiation condition, in this paper, the international wide-spectrum epithermal mixed neutron beam proposed for the modified Snyder head phantom is adopted, in which the thermal neutron with energy less than 0.5 eV accounts for 10%, the epithermal neutron with energy between 0.5 eV and 10 keV accounts for 89%, and the fast neutron with energy between 10 keV and 2 MeV accounts for 1%. The overall neutron source spectra obeyed the distribution according to the energy-dependent probability function 1/E, uniformly distributed on a disk surface with a radius of 5 cm and a source strength of 1010 n/cm2 ·s [3]. Figure 10 presents the energy spectrum of the neutron source.

(2) Voxel phantom of the modified Snyder head with tumor based on the material-location method with a central point algorithm
To study the influence of the voxel phantom on the calculation results under different spatial resolutions and to simulate the situation of glial tumors in the brain in the clinic. Based on the model illustrated in Fig. 8, a sphere with a radius of 1.5 cm is added to the brain tissue as the tumor boundary, and the coordinate origin is at the center of the entire analytical model. Fig. 11 shows the modified Snyder head phantom with tumor [34, 35], in which the equation for the boundary surface of the tumor and brain is given by Eq. (8).

For the analytical model, the materials can be accurately described, but the voxel phantom will be difficult to deal with because the voxel mesh may be at the interface of the two substances. The traditional way to deal with this is to fill by obtaining the exact volume ratio of different materials inside each cubic mesh (Fig. 9), which is extremely time consuming and results in bias when the number of voxel meshes is large. As described above, the model material was derived 286 from 4 materials as the hybrid materials. In this study, to reduce the complexity of the simulation problem, the material of the center point of the mesh is used in the phantom construction of MagicDose, and the material density of the whole mesh is determined according to the location of the center point of each mesh, which is reduced from the original 286 kinds of material to four types of materials [36], Fig. 12 shows the material-location method with a central point algorithm. In Fig. 12, (Xm, Ym, Zm) denotes the center point position of each voxel mesh, and f1(Xm, Ym, Zm), f2(Xm, Ym, Zm), f3(Xm, Ym, Zm) and f4(Xm, Ym, Zm) denote the boundary equations Eq. (5)–(8) as follows: When the position of the center point is substituted in the boundary equations with a value less than 1, it is “True”, the mesh material is the tissue component inside the boundary equation, otherwise it is “False”, the mesh material is the tissue component outside the boundary equation.

Based on the material-located method with the central point algorithm, MagicDose constructed three voxel phantoms of the modified Snyder head with tumor of different spatial resolutions (16, 8, and 1 mm), and the corresponding voxel mesh numbers of Mx×Ny×Lz are 2744, 21952, and 11239424, respectively [37]. As shown in Fig. 13 show transverse views of different voxel phantoms.

In this study, MCNP is used to construct a modified Snyder head analytical model with a tumor. The results of the MCNP computation are used as the reference result, which is compared and verified with the results of MagicDose under different resolutions, and are used to explore the influence of voxel phantom on the computational results under different spatial resolutions. The tissue compositions of the voxel phantom of the modified Snyder head with tumor and the modified Snyder head analytical model with tumor are shown in Table 3. The tissue compositions of the tumor are consistent with that of normal brain tissues, except for the different boron contents, according to the relevant literature [38]. According to the current clinical trials requirements, the 10B content (T) of the tumor must be higher than the 10B content (N) of the normal tissue by a factor of 2.5 or more (T/N > 2.5), and the calculations in this paper set the boron concentration of scalp tissue and normal tissue in the brain at 10 ppm and the boron concentration within the tumor tissue at 30 ppm, with no boron in the skull [39]. MagicDose and MCNP both utilize the wide-spectrum epithermal mixed neutron beam spectrum shown in Fig. 10 for the simulated dose calculations. To make the calculated results comparable to international BNCT dose results, according to Eq. (4). The RBE and CBE factors are selected with reference to the values obtained from the MIT and BNL in BNCT clinical trials [40, 41], as shown in Table 4.
| BNCT dose components | Healthy tissue (brain, skull, scalp) | Tumor |
|---|---|---|
| 10B(n, |
1.35 | 3.8 |
| 14N(n, p)14C ( |
3.2 | 3.2 |
| Epithermal and fast neutron ( |
3.2 | 3.2 |
| Photon ( |
1 | 1 |
(3) CT head model of a patient based on DICOM data
In a preliminary application, MagicDose was used to construct a voxel phantom based on DICOM data from a patient’s head (Fig. 14 shows coronal, transverse, and sagittal CT images [42]. The dimensions of the phantom in the X-, Y-, and Z-directions are 18, 18 and 16.5 cm, respectively, and the size of the constructed voxel is 1 mm×1 mm×1 mm. An equivalent source of the epithermal neutron beam plane of the IHNI-I reactor with the MagicDose source module is used for the irradiation conditions (Fig. 5(d)), and the irradiation direction was vertical to the back of the head (Fig. 14(g)).

Result and discussion
Correctness testing of MagicDose
Figure 15 shows comparison plots of the thermal neutron dose rate, epithermal and fast neutron dose rates, and induced photon dose rate values for all voxels in the voxel phantom of the modified Snyder head at spatial resolutions of 16 and 8 mm for MagicDose and MCNP. Using MCNP as a reference result [3], the slope ratio method is used in this study to distinguish how close the dose rate results calculated by MagicDose are to the MCNP results. For any voxel n in the model, the dose rate result of MCNP is taken as the horizontal coordinate value Xn, and the dose rate result of MagicDose is the vertical coordinate value Yn, and the points (Xn, Yn) are labeled sequentially on the coordinate system, and it is observed that all the images formed by scattering the points are scattered near the straight line equation of y=x. As illustrated in Fig. 15, the number of model voxels with a spatial resolution of 16 mm is fewer than that of the 8 mm model voxels. Consequently, the number of coordinate points in the 16 mm model are lower than that in the 8 mm model. However, the points (Xn, Yn) generated by MagicDose and MCNP are predominantly concentrated near the line y=x. Furthermore, the locally magnified graphs of the respective dose rates reveal that the deviation of the dose rate results from y=x is minimal. This observation indicates that the results computed by MagicDose and MCNP are in strong agreement, thereby validating the accuracy of MagicDose.

In the model calculations, both MagicDose and MCNP are performed under the same conditions, as listed in Table 5. At a spatial resolution of 16 mm, the calculation times for MCNP and MagicDose are 1373 and 944 s, respectively, with MagicDose achieving an efficiency improvement of approximately 31.24% compared to MCNP. At a spatial resolution of 8 mm, the calculation times for MCNP and MagicDose are 2042 and 1457 s, respectively, with MagicDose demonstrating an efficiency improvement of approximately 28.65% over MCNP. The numerical results demonstrate that MagicDose outperforms MCNP in terms of computational efficiency, while ensuring the accuracy of the BNCT calculations.
| Resolution size | Time for different calculation programs (s) | |
|---|---|---|
| MCNP | MagicDose | |
| 16 mm | 1373 | 944 |
| 8 mm | 2042 | 1457 |
Exploration of MagicDose at different spatial resolutions
The result of each dose rate of the modified Snyder head analytical model with tumor simulated by MCNP calculation is used as the reference in this section. In the comparative validation calculations, using the parameter setup described above (including material and source terms, etc.) as well as the nuclear cross-section database, MagicDose is used to construct voxel phantoms with three different spatial resolutions of voxel sizes of 16, 8, and 1 mm, and to compare the variability in the results of the phantom-depth correlation dose-rate curves along the Z-axis computed by the two MC particle transport programs. Simultaneously, the relevant spatial dose rates of the head phantom at different voxel resolutions are statistically calculated to explore the effect of the voxel size of the voxel phantom on the results and to provide reference opinions for the optimization of the voxel phantom design for clinical treatment.
Figure 16, 17, 18 show the boron dose rate, thermal neutron dose rate, epithermal and fast neutron dose rates, induced photon dose rate, total relative biological effect dose rate, relative deviation with depth, and spatial dose rate distributions at different voxel resolutions. The relative deviation is the percentage of deviation obtained by comparing the MagicDose voxel phantom results with the MCNP analytical model results as the reference result, and the ICRU24 report suggests that the relative deviation between the actual treatment and the planned dose of BNCT should not exceed 5%; otherwise, the risk of tumor recurrence persists, and radiological complications increase in normal tissues [43].



As shown in Fig. 16(a), the boron dose rate calculated by MagicDose at different resolutions of the voxel is compared with the reference result, which is consistent with the results at 1 mm. However, the variability of the results is more obvious with an increase in the resolution of the voxel. Fig. 16(b) shows that the relative deviations of 1 mm are within ±5% of the clinical allowable for BNCT, whereas 8 and 16 mm have greater relative deviations between depths of 0.5–1.5 cm, 5.4–8.2 cm, and 14.2–18.2 cm. By integrating the phantoms depicted in Fig. 13 with the spatial dose-rate distribution derived from Fig. 16(c)–(e), it becomes evident that significant relative deviations can be ascribed to the depth ranges of 0.5–1.5 cm, 14.2–18.2 cm, which corresponds to the skull, and 5.4–8.2 cm, which pertains to the tumor. The phantoms with dimensions of 8 mm and 16 mm lack high-resolution representation of tissues in these specific regions, ultimately resulting in inaccuracies in the dose rate calculations. Figure 16(c)–(e) demonstrate that the results derived from the voxel phantom at high resolution exhibit greater accuracy. Analysis of the spatial dose rate values clearly indicates that the skull does not contribute to the boron dose rate, as it lacks boron content. Conversely, in the tumor region, the elevated boron content leads to a substantial increase in the boron dose rate, thereby facilitating more precise tumor localization in clinical settings.
From Fig. 16(f)–(j) and Fig. 17(f)–(j), we observe that the thermal dose and induced photon dose rates for 1 and 8 mm are consistent with the reference result, and the relative deviations are limited to ±5%. However, the calculated results are biased owing to the large resolution of the 16 mm voxel. The distribution curves of the thermal dose rate and induced photon dose rate exhibit the same trend, because the induced photon comes from the neutron capture reaction and the γ-ray is generated by the capture reaction between thermal neutrons and H-atoms in the body; the photon is generated in place of the higher neutron dose, and the greatest damage is produced in the superficial tissues of the head.
This is shown in Fig. 17(a), (c), (d), and (e), because 89% of the neutron source radiation is epithermal neutrons, neutrons slowing down to thermal neutrons occur initially and the dose rate gradually decreases as the depth increases. From Fig. 17(b), it is understood that when the depth is less than 12 cm, the relative deviations of both 1 mm and 8 mm are basically kept within 5%; when the depth is greater than 12 cm, it will cause the problem of deep penetration, at which time the MC program calculates the number of particles arriving at the depth to be less, resulting in the statistical results of the relative deviation to be larger.
The dose rates are shown in Fig. 16-17 are combined according to the corresponding factors of CBE or RBE to obtain the total dose rate of the relative biological effect, as shown in Fig. 18. As shown in Fig. 18(a)(b), the total dose rate at 1 mm is consistent with the reference result, and the relative deviations are kept within 5%; the discrepancy of the results at 8 mm and 16 mm is due to the boron dose as the main dose component, and the effect of the resolution of the voxel phantom on the boron dose, which ultimately leads to the deviation of the total dose rate. Overall, Fig. 16, 17, 18 show that the dose rates and relative deviations of the high-resolution voxel phantoms calculated from MagicDose are consistent with the reference result and remain within ±5%, indicating that as the size of the constructed voxel mesh gets smaller, the better it converges to the analytical model, the better the computed results match, highlighting the effect of the voxel size of the voxel phantoms on the results
Because the boron concentration of BNCT changes rapidly with the body’s metabolism after boron injection, BNCT is highly demanded owing to its speed of dose calculation, which ensures that the dose calculation can be completed in a very short period of time (<3600 s). The number of voxels also affects the efficiency of the calculation. Therefore, to verify the computational efficiency of MgaicDose, simulations are performed using 1, 4, 8, and 16 threads for the voxel phantom of the modified Snyder head with tumor at 16, 8, and 1 mm, respectively, to test the computational efficiency of the program at different spatial resolutions and with different numbers of threads. Figure 19 compares the computation time (s) for different mesh scales and different numbers of thread 3D histograms. Evidently, under the same computational conditions, the smaller the voxel size, the longer the simulation computation time. However, with an increase in the number of parallel threads, the time used for the simulation becomes increasingly shorter, with increasingly obvious acceleration effects.

Initial application of MagicDose based on DICOM data
MagicDose constructes a voxel phantom of the head using DICOM data, and Fig. 14 shows that the schematics of MagicDose in the coronal, transverse, and sagittal planes are consistent with the CT images of the corresponding locations. Based on the irradiation from an equivalent surface source at the epithermal neutron beam port of IHNI-I, as shown in Fig. 15(d), Fig. 20(a), (b), (c), and (d) show the boron dose rate, thermal neutron dose rate, epithermal and fast neutron dose rates, and induced photon dose rate, respectively. The total relative biological effects of the dose rate (Fig. 20(d)) is derived by integrating Table 4 with the aforementioned dose-rate values. The spatial distributions of the boron and thermal neutron dose rates are similar to those shown in Fig. 20(a), and (b) because both doses are related to thermal neutrons, and the boron dose rate is significantly higher than the contribution of the epithermal neutron dose rates presented in Fig. 20(c) is mainly located in the shallow region of the posterior cerebral epidermis. Figure 20(d) shows that the induced photon dose rate is distributed throughout the space and presents the complete human head profile; combining the CBE and RBE factors, the total relative bioeffect dose rate shown in Fig. 20(e) is obtained, and the highest dose region appears in the irradiated region of the back of the head.

Conclusion
To further develop the TPS-dedicated dose calculation program for BNCT, this study presents the BNCT MC dose calculation program MagicDose, which was developed using the MC particle transport method. Compared to MCNP, MagicDose features a small program size due to its exclusive focus on BNCT, in contrast to MCNP’s extensive applications across nuclear medicine, reactor design, and detection, which result in a larger codebase; it exhibits enhanced specialization through a modular design tailored to BNCT needs, such as a source module preconfigured with the IHNI-I reactor’s equivalent surface beam sources and a database module optimized with Kerma values for 106 human tissue materials; MagicDose exhibits greater autonomy. Unlike MCNP, which is subject to stringent licensing restrictions—including an embargo on China—and is developed in Fortran, limiting its capabilities in object-oriented programming and hindering extensions for BNCT’s future needs, such as GPU-based MC particle transport, MagicDose is independently developed in C++. This license-free approach, coupled with a modular, reusable, and easily maintainable design, significantly enhances developmental flexibility and enables independent operations without relying on external tools. MagicDose involves seven functional modules: geometry, source, database, particle transport, tallies, output, and auxiliary. With particle transport as the core, connected upward with the geometry, source, and database modules and supported downward by the tally and output modules, the program adopts a modular design so that each functional module can be developed and maintained independently, facilitating the secondary development of the BNCT’s subsequent needs. To test the correctness of MagicDose, two international benchmark voxel phantoms, i.e., the voxel phantom of modified Snyder head with 16 and 8 mm, are first selected in this paper, and the neutron and photon dose rates computed by MagicDose and MCNP are compared with each other, which are used to validate the correctness of the program; Subsequently, based on the material-located method with central point algorithm, three different spatial resolutions (16, 8 and 1mm) of voxel phantom of modified Snyder head with tumor are constructed using MagicDose, and the depth-dose rate curve results and spatial value distribution plots are used to explore the influence of the voxel phantoms on the calculation results under different spatial resolutions; Finally, based on the CT head model of a patient given by DICOM data, MagicDose is used to construct a voxel phantom with a voxel size of 1 mm×1 mm×1 mm, and the corresponding dose rate values are calculated and obtained, demonstrating the application of the program in clinical cases of BNCT. Based on these three models, the following conclusions were drawn:
For the modified Snyder head voxel phantom with spatial resolutions of 16 mm and 8 mm, taking the dose rate values calculated by MCNP as the reference, denoted as Xn, and those computed by MagicDose as Yn, a comparison of their relationship relative to the y=x linear function reveals that the two-dimensional coordinate points (Xn, Yn) are consistently distributed near the y=x line. Thus, the results of MagicDose are well-consistent with those of MCNP calculations, validating MagicDose. According to Table 5, at spatial resolutions of 16 and 8 mm, MagicDose reduced the computation time by 31.24% and 28.65%, respectively, compared with MCNP, demonstrating its overall superior computational efficiency over MCNP.
For the voxel phantom at high spatial resolution, the boron dose rate, thermal neutron dose rate, epithermal and fast neutron dose rates, induced photon dose rate, and total relative biological effect dose rate calculated by MagicDose align closely with MCNP reference results, with a relative deviation of less than 5%. This consistency confirms the computational reliability of MagicDose, although its applicability to clinical treatment requires further validation using experimental data. The results show that the variability of the results decreases with increasing spatial resolution, which provides reference opinions for optimizing the design of voxel phantoms for clinical treatment. In tests at different spatial resolutions and with different numbers of threads, it is concluded that the smaller the size of the voxel constructed by MagicDose, the longer the simulation computation time. However, with an increasing number of parallel threads, the time used for the simulation becomes increasingly shorter, and the acceleration effect becomes increasingly obvious.
MagicDose can be used to construct an appropriate voxel phantom based on DICOM data, and the results of the calculations provide a preliminary validation of the use of the program in clinical cases, particularly its ability to develop high-resolution CT-based phantom dosimetry calculations.
Given the potential for further optimization of the MagicDose program, future efforts will focus on developing a set of four-dimensional dynamic MC programs specifically for BNCT pharmacokinetics. This development will be undertaken alongside the investigation of time-dependent MC particle transport methods to enhance the efficiency and accuracy of dose calculations.
Cancer incidence and mortality in China
. J. Natl. Cancer Cent. 4, 47–53 (2024). https://doi.org/10.1016/j.jncc.2024.01.006Advances in boron neutron capture therapy
. (Reference dosimetry calculations for neutron capture therapy with comparison of analytical and voxel models
. Med. Phys. 29, 145–156 (2002). https://doi.org/10.1118/1.1428758Analysis of influencing factors on the method for determining boron concentration and dose through dual prompt gamma detection
. Nucl. Sci. Tech. 32, 35 (2021). https://doi.org/10.1007/s41365-021-00873-3Monte Carlo optimization of an epithermal neutron flux monitor for BNCT
. J. Nucl. Sci. Technol. 54, 1118–1122 (2017). https://doi.org/10.1080/00223131.2017.1344582NCTPlan, the new PC version of MacNCTPlan: improvements and verification of a BNCT treatment planning system
. (BNCT Rtpe and sera dose planning programs: phantom and patient studies
.An overview on the developments and improvements of a treatment planning system for BNCT
. IEEE Trans. Nucl. Sci. 53, 1333–1338 (2006). https://doi.org/10.1109/TNS.2006.872501Verification of the computational dosimetry system in JAERI (JCDS) for boron neutron capture therapy
. Phys. Med. Biol. 49, 3353 (2004). https://doi.org/10.1088/0031-9155/49/15/003Verification for dose estimation performance of a Monte-Carlo based treatment planning system in University of Tsukuba
. Appl. Radiat. Isot. 166,Evaluation of a treatment planning system developed for clinical boron neutron capture therapy and validation against an independent Monte Carlo dose calculation system
. Radiat. Oncol. 16, 243 (2021). https://doi.org/10.1186/s13014-021-01968-2Introduction to the Monte Carlo dose engine COMPASS for BNCT
. Sci. Rep. 13, 11965 (2023). https://doi.org/10.1038/s41598-023-38648-yDevelopment and verification of THORplan—A BNCT treatment planning system for THOR
. Appl. Radiat. Isot. 69, 1878–1881 (2011). https://doi.org/10.1016/j.apradiso.2011.03.025MCDB Monte Carlo code with fast track technique and mesh tally matrix for BNCT
. J. Nucl. Sci. Technol. 44, 1518–1525 (2007). https://doi.org/10.1080/18811248.2007.9711401Recent research progress of BNCT treatment planning system
. Nucl. Eng. Technol. 57,GPU-accelerated three-dimensional reconstruction method of the Compton camera and its application in radionuclide imaging
. Nucl. Sci. Tech. 34, 52 (2023). https://doi.org/10.1007/s41365-023-01199-yFPGA-based position reconstruction method for neutron beam flux spatial distribution measurement in BNCT
. Nucl. Sci. Tech. 35, 56 (2024). https://doi.org/10.1007/s41365-024-01417-1Evaluation of neutron beam characteristics for D-BNCT01 facility
. Nucl. Sci. Tech. 33, 12 (2022). https://doi.org/10.1007/s41365-022-00996-1Design of beam shaping assembly for boron neutron capture therapy based on D-T neutron source
. Nucl. Tech. 45,Study on quality parameters of neutron beams in IHNI-I reactor ducts
. Prog. Rep. Nucl. Sci. Technol. China (Vol. 4). Proc. Acad. Annu. Meet. China Nucl. Soc. 2015, No. 7–Nucl. Phys. sub-volume. (2016). (in Chinese)Neutron capture therapy (NCT) & in-hospital neutron irradiator (IHNI)——a new technology on binary targeting radiation therapy of cancer
. Eng. Sci. 7, 2–21 (2009). https://www.osti.gov/etdeweb/biblio/21463381Numerical calculation for the equivalent surface source of the thermal neutron duct of in-hospital neutron irradiator mark 1 reactor
. Strateg. Study CAE. 14, 56–59 (2012). (in Chinese)Study on the optimal incident proton energy of 7Li(p, n)7Be neutron source for boron neutron capture therapy
. Nucl. Sci. Tech. 35, 60 (2024). https://doi.org/10.1007/s41365-024-01420-6MCNP users manual - Code version 6.2. Los Alamos National Laboratory, Report LA-UR-17-29981
(2017). https://mcnp.lanl.gov/manual.htmlOpenMC: A state-of-the-art Monte Carlo code for research and development
. Ann. Nucl. Energy. 82, 90–97 (2015). https://doi.org/10.1016/j.anucene.2014.07.048Photon, electron, proton and neutron interaction data for body tissues. ICRU Report 46
,Nuclear data for neutron and proton radiotherapy and for radiation protection. ICRU Report 63
,THUDosePD: a three-dimensional Monte Carlo platform for phantom dose assessment
. Nucl. Sci. Tech. 34, 164 (2023). https://doi.org/10.1007/s41365-023-01315-yCalculation of photon mass energy-transfer and mass energy-absorption coefficients
. Radiat. Res. 136, 147–170 (1993). https://doi.org/10.2307/3578607Deterministic parsing model of the compound biological effectiveness (CBE) factor for intracellular 10B distribution in boron neutron capture therapy
. J. Cancer Ther. 5, 1388 (2014). https://doi.org/10.4236/jct.2014.514140A review of planned, ongoing clinical studies and recent development of BNCT in mainland of China
. Cancers 15, 4060 (2022). https://doi.org/10.3390/cancers15164060Density-extrapolation global variance reduction (DeGVR) method for large-scale radiation field calculation
. Comput. Math. Appl. 143, 10–22 (2023). https://doi.org/10.1016/j.camwa.2023.04.024Pointing probability driven semi-analytic Monte Carlo method (PDMC) - Part I: Global variance reduction for large-scale radiation transport analysis
. Comput. Phys. Commun. 291,Computational aspects of treatment planning for neutron capture therapy
. Ph.D. dissertation,Conceptional design of an adjustable moderator for BNCT based on a neutron source of 2.8 áMeV proton bombarding with Li target
. Nucl. Eng. Technol. 56, 1813–1821 (2024). https://doi.org/10.1016/j.net.2023.12.038Research on Monte Carlo simulation method and software development of BNCT
. Master’s thesis,Evaluation of the medical staff effective dose during boron neutron capture therapy using two high resolution voxel-based whole body phantoms
. Nucl. Eng. Technol. 49, 1505–1512 (2017). https://doi.org/10.1016/j.net.2017.06.011Boron neutron capture therapy dose calculation for tumor modified Snyder head phantom using MCNP
. Atom. Energy Sci. Technol. 44, 89–94 (2010). https://doi.org/10.7538/yzk.2010.44.01.0089 (in Chinese)Analysis of absorbed dose distribution in head phantom in boron neutron capture therapy
. Nucl. Instrum. Meth. A 440, 446–452 (2000). https://doi.org/10.1016/S0168-9002(99)00827-XA Monte Carlo dosimetry-based evaluation of the 7Li(p, n)7Be reaction near threshold for accelerator boron neutron capture therapy
. Med. Phys. 27, 192–202 (2000). https://doi.org/10.1118/1.598884Monte Carlo-based treatment planning for boron neutron capture therapy using custom designed models automatically generated from CT data
. Int. J. Radiat. Oncol. Biol. Phys. 35, 383–397 (1996). https://doi.org/10.1016/0360-3016(96)00084-3Development and verification of a novel system for computed tomography scanner model construction in Monte Carlo simulations
. Nucl. Eng. Technol. 54, 4244–4252 (2022). https://doi.org/10.1016/j.net.2022.07.004Assessment of dose inhomogeneity at target level by in vivo dosimetry: can the recommended 5% accuracy in the dose delivered to the target volume be fulfilled in daily practice? Radiother
. Oncol. 25, 242–250 (1992). https://doi.org/10.1016/0167-8140(92)90243-NThe authors declare that they have no competing interests.

