A graphical user interface for calculating the arterial input function during dynamic positron emission tomography

Purpose. Dynamic positron emission tomography (dPET) requires the acquisition of the arterial input function (AIF), conventionally obtained via invasive arterial blood sampling. To obtain the AIF non-invasively, our group developed and combined two novel solutions consisting of (1) a detector, placed on a patient’s wrist during the PET scans to measure the radiation leaving the wrist and (2) a Geant4-based Monte Carlo simulation software. The simulations require patient-specific wrist geometry. The aim of this study was to develop a graphical user interface (GUI) allowing the user to import 2D ultrasound scans of a patient’s wrist, and measure the wrist features needed to calculate the AIF. Methods. The GUI elements were implemented using Qt5 and VTK-8.2.0. The user imports a patient’s wrist ultrasound scans, measures the radial artery and veins’ surface and depth to model a wrist phantom, then specifies the radioactive source used during the dPET scan. The phantom, the source, and the number of decay events are imported into the Geant4-based Monte Carlo software to run a simulation. In this study, 100 million decays of 18F and 68Ga were simulated in a wrist phantom designed based on an ultrasound scan. The detector’s efficiency was calculated and the results were analyzed using a clinical data processing algorithm developed in a previous study. Results. The detector’s total efficiency decreased by 3.5% for 18F and by 51.7% for 68Ga when using a phantom based on ultrasound scans compared to a generic wrist phantom. Similarly, the data processing algorithm’s accuracy decreased when using the patient-specific phantom, giving errors greater than 1.0% for both radioisotopes. Conclusions. This toolkit enables the user to run Geant4-based Monte Carlo simulations for dPET detector development applications using a patient-specific wrist phantom. Leading to a more precise simulation of the developed detector during dPET and the calculation of a personalized AIF.


Introduction
Positron emission tomography (PET) is a nuclear medicine imaging modality used to monitor changes in metabolic activities (Cherry et al 2012). It has a wide range of applications including neurodegenerative disorders such as Alzheimer's and Parkinson's diseases; diagnosis of heart diseases and detection and monitoring of cancer tumors (Eckert et al 2005, de Geus-Oei et al 2006, Mosconi et al 2008, Takesh 2012, Driessen et al 2017, Grkovski et al 2017. Prior to or during the PET scan, a positron-emitting radioactive tracer (radiotracer) is administered to a patient by intravenous injection. Positrons are emitted upon the decay of the radionuclide in the radiotracer. The emitted positrons travel a short distance in the tissue, losing energy by exciting and ionizing nearby tissue atoms and annihilating with an electron. A pair of photons are produced in the annihilation process, departing in opposite directions, each with an energy of 511 keV. PET relies on the coincidence detection of these photons (Cherry et al 2012).
PET images can be acquired by either static or dynamic scanning. In static PET, the radiotracer is injected into the patient's body, and then one or more single-frame images are acquired at different bed positions to Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. monitor the distribution of the radiotracer in the body (Cherry et al 2012, Rahmim et al 2019. On the other hand, dynamic PET (dPET) scans involve injecting a radiotracer into the patient's body and then continuously acquiring a series of images over a set period of time. The time course of the radiotracer distribution is monitored from the moment of injection, allowing researchers and clinicians to observe the dynamics of the physiological and biochemical processes being studied. For cancer patients, by analyzing radiotracer kinetics for each patient, a more accurate assessment of the metabolic response and detailed characterization of the tumor microenvironment is provided, hence the increasing interest in clinical applications for dPET in oncology during the last years (Gunn et al 2001, Bentourkia andZaidi 2007, Rahmim et al 2019). An appropriate tracer kinetic model can be used to account for all the biological factors that contribute to the tissue radioactivity signal. The kinetic analysis fundamentally requires the measurement of the tracer concentration in the patient's arterial blood plasma over the scan time, called the arterial input function (AIF). The gold standard method to acquire the AIF requires sampling blood from the patient's artery (Phelps et al1985, Boellaard et al 2001). This causes significant discomfort to the patient, requires the presence of highly trained personnel capable of arterial cannulation, can cause complications, and is expensive. As a consequence, dPET is currently only acquired at academic centers and is limited to a small group of patients.
In order to make the dPET more accessible and safer for patients, a non-invasive radiation detector (NID) to measure the AIF without withdrawing blood from patients has been developed by our group (Turgeon et al 2019, Carroll et al 2020, Carroll and Enger 2022. The NID is placed on the patient's wrist during the dPET scan and measures the number of positrons and photons leaving the radial artery through the skin. A correction factor needs to be applied to the number of counts obtained with the detector in order to extract the concentration of the radiotracer in the blood plasma (i.e. AIF). The correction factor is a product of a Monte Carlo simulation output and the blood volume covered by the NID (see equation (1)). The simulation output is obtained through an in-house Geant4 (Agostinelli et al 2003) based Monte Carlo toolkit (Carroll and Enger 2022), where it simulates the NID placed on a patient's wrist injected with a PET radiotracer. The output is the number of particles that escape the radial artery and veins, and that are detected by the NID, for each decay event (Carroll and Enger 2022). The division of the detector output by the correction factor (i.e. Simulation Output x Blood Volume) as shown in equation (1), gives the AIF in MBq ml -1 . The original wrist phantom that was used in our simulations was designed as a polyethylene cylinder, 10 cm long and 6.4 cm in diameter with two cylindrical holes simulating the patient's radial artery and vein (Carroll and Enger 2022). The radial artery modeled in our previous phantom had a relatively shallow placement in the patient's wrist (1.99 ± 0.99 mm) based on an average value from a study by Lee et al (2016), where ultrasound evaluation of the radial artery for arterial catheterization in healthy anesthetized patients was performed (Lee et al Lee 2016). However, the size, shape, and depth of the radial artery and the radial veins from the skin are variable among patients and affect the AIF calculation. To obtain a patient-specific correction factor and thereby an accurate AIF, it is important to provide the in-house Geant4-based user code with an accurate model of each patient's wrist with the radial artery and the two radial veins' accurate sizes and positions. .

=
The aim of this project was to develop a workflow and methods to provide our in-house Geant4-based Monte Carlo user code with patient-specific data. First, images of patients' wrists were acquired with an ultrasound. Second, a graphical user interface (GUI) called Radiation Detector Simulation Software hereinafter called RADETSS, was implemented in order to precisely measure the distances between the radial artery and the skin, the two radial veins and the skin as well as the respective surface areas of the radial artery and the radial veins. Third, the developed methodology was combined to perform Monte Carlo simulations. The results were compared with results obtained using a generic polyethylene wrist phantom designed based on the average artery's size and depth measured and reported by Lee et al (2016).

Materials and methods
In this study, a GUI was developed to measure the size of the artery, the veins, and their depth on patients' wrist ultrasound scans. These measurements are then used through the GUI as inputs to an in-house Geant4-based user code to accurately simulate the radioactive source decay in the patient's radial artery and radial veins. The methodology is described in detail in the following sections.

Wrist ultrasound scans
The bk3000 ultrasound from BK medical (bk3000 Ultrasound Machine 2022), the MSK & Nerve Procedural Application, and the 13L4w Wide Linear Array Transducer with a frequency of 12 MHz were used. The ultrasound system was calibrated according to the manufacturer calibration guidelines and the frequency was set to 12 MHz for an optimal resolution (bk3000 and bk5000 Ultrasound Systems-Advanced User Guide 2020). We acquired volar transverse 2D ultrasound scans of healthy participants' wrists recruited at the Jewish General Hospital, McGill University, Montreal, after receiving approval from our institutional research ethics board and consent from the participants. Each participant was asked to rest their arm on a table with their palms facing up. Using a removable marker, three lines were drawn on the participants' wrists; at 2, 4, and 6 cm from the wrist crease. By placing the probe on each of these lines, the wrist was scanned at different levels which allowed us to detect size and depth changes of the radial artery and the radial veins along the wrist. Segmentation of the radial artery and veins was performed on the acquired images using the developed measurement tools as explained below.

Code development and dependencies
The RADETSS GUI elements were built using Qt 5.12. Qt is an object-oriented cross-platform application framework and a widget toolkit, used to build the GUI of software that can be run on different operating systems and hardware platforms (Blanchette andSummerfield 2006, Baka 2019). The ultrasound visualization, manipulation, and measurements were built using VTK 8.2. VTK (Visualization toolkit) is a C++ open-source algorithm library used to read and display DICOM images. We integrated VTK into our code by using headers to create an easy and user-friendly interface. VTK reads DICOM files and allows the user to manipulate the images, perform measurements, and run the Monte Carlo simulation through a window implemented in the GUI (Schroeder et al 2000, Sun and Wu 2013, Glickman et al 2020. All classes containing GUI elements inherit from QObject which is the most basic class in Qt. Widgets and windows inherit from QWidget; QWidget contains all the elements to set the size, the position, and the mouse cursor of a window or a widget (Blanchette andSummerfield 2006, Glickman et al 2020).
Different classes and their dependencies are illustrated in Figure 1 and presented in the following paragraphs.
When the RADETSS is launched, the MainWindow class is instantiated. This class inherits from QMainWindow and establishes the Qt connections between the classes it initializes (Glickman et al 2020).
The first class initialized is InputWindow, designed to browse for the DICOM directory and load the ultrasound scans as shown in Figure 2. The DICOMData class then reads the DICOM data (ultrasound images) using the vtkDICOMImageReader class from VTK and the PlaneViewWidget class displays the first image in the directory. PlaneViewWidget inherits from QVTKOpenGLWidget in order to integrate Vtk-based medical images in the Qt-based GUI (Glickman et al 2020). The 'Next' and 'Previous' QButtons implemented in the GUI help the user navigate through the folder and choose the desired ultrasound image.
The class InteractorStyle was also implemented, which inherits from the vtkInteractorStyleImage. It comprises the control of the mouse movement and the interactive manipulation of the camera by panning and zooming the image, giving the user a better visualization of the artery.
Measurement tools were added to measure the cross-sectional areas and the depths of the artery and the veins. The cross-sectional area is measured by drawing and adjusting an ellipse on the displayed blood vessels as illustrated in Figure 3. In the InteractoryStyle class, the 'DrawEllipse' function uses the vtkEllipseArcSource methods that let the user draw an ellipse, center it on the blood vessel, and change its size to match the displayed size on the ultrasound scan, using the mouse buttons. The software then calculates the surface of the drawn ellipse and extracts its radius by considering that the artery and the veins are circular. Also implemented in InteractorStyle, the depths are measured by drawing a line between the vessel's top border and the skin, the 'DrawLine' function uses the VtkLineSource methods to measure the length of the drawn line. The user has access to these tools through the QButtons placed in the top left corner of the GUI. An instructions tab (bottom right) is added to guide the user through the measurement steps (see Figure 3). Once the measurements are validated, they are displayed on the screen.
The user now chooses the radioactive source that will be simulated in the Monte Carlo user code. From the drop-down menu in the 'Source Tab' as shown in the top right corner of Figure 5, a QWidget implemented in the RadiationDetectionOptionsWidget class, 18 F, 15 O, 11 C, or 68 Ga can be chosen. The users can also customize their own radioactive source by typing the appropriate mass number and the atomic number of the radionuclide in the QLineEdit slots. This feature is possible as the decay spectra of the radioactive sources are not hardcoded in the in-house Geant4-based Monte Carlo code. In contrast, radioactive decay is added to handle explicit simulation of nuclear decay for any radionuclide specified by the user.  Different menus inherit directly or indirectly from QMenu. To run the Monte Carlo simulation, the user clicks on 'Run Simulation' under the 'Simulation' menu, which opens a window implemented in the RunWindow class. This is the interface to the Monte Carlo simulation. The user chooses the Monte Carlo executable file and the output directory; as well as the number of parallel threads, and the number of initial histories (radioactive decays), and add extra macro commands. All the Monte Carlo settings are gathered by the RadiationDetection class and its daughter, the MCRadiationDetection class to set the appropriate macro commands and run the Monte Carlo simulation. The macro commands generated by the software include the radioactive source chosen, the artery's radius and its position, the left radial vein's radius and its position, and the right radial vein's radius and its position, which are all obtained from the measurements. The visualization macro commands are also added in case the user checks the 'Visualize Geometry' box (see Figure 4). Finally, with one click on the 'Run' button, the Monte Carlo simulation is launched and all the output is displayed in the 'Run Monte Carlo Simulation' window.

RADETSS measurement accuracy
In order to quantify the inter and intra-user variability of the measurements, five users were asked to measure the depth of the radial artery from the skin and its surface area, on the same random ultrasound scan taken from our dataset. The scan was uploaded to the RADETSS. The measurements were repeated 10 times by following the instructions provided by the software that appear in popup windows. Each user reported 10 depth values and 10 cross-sectional surface area values that were assessed by calculating their standard deviation.

Wrist phantom simulations
A single ultrasound scan was chosen for further analysis. As shown in Table 1, this scan was chosen such that the radial artery dimensions were similar to the radial artery dimensions' average measured on the wrist ultrasound scans acquired at the Jewish General Hospital, McGill University, Montreal (see paragraph 2.1). The scan was taken on the left wrist of a 46-year-old woman, at 2 cm from the wrist crease.
The 2D-ultrasound scan was imported into the RADETSS. The depths of the vessels and their cross-section surface areas were measured using the measuring tools (see Figure 5). A patient-specific wrist phantom was designed and used in the Monte Carlo simulations as presented in Figure 4. The phantom was modeled as a polyethylene cylinder with a mass density of 0.94 g cm −3 and three holes simulating the radial artery and the two radial veins. The choice of material was based on Carroll and Enger (2022). In the simulations, Geant4 version 10.02 and the parameters listed in Table 2 were used.
The NID used in the simulations consists of 59 single-clad BCF-12 scintillating fibers (BCF-12, St-Gobain 205 Crystals and Detectors, France). The fibers have a polystyrene core 0.97 mm in diameter, an acrylic cladding layer 0.3 mm in thickness around the core, and a 25.4 μm thick poly-lactic acid heat shrink tube around the cladding. They are 10 cm long each and are arranged in two layers around the wrist phantom, where the inner layer consists of 29 fibers and the outer layer of 30 fibers (see Figure 4(a)) (Carroll and Enger 2022).
We simulated 100 million decay events twice, once using 18 F and once using 68 Ga. For each radioisotope, the total efficiency which is the global detector efficiency was calculated and compared to the total efficiency obtained by simulating the wrist phantom modeled by Carroll and Enger (2022).  Furthermore, the arterial counts were separated from the venous counts, using the clinical data processing algorithm developed by Carroll and Enger (2022). From each data set, 10 mixed data sets were generated with different ratios of arterial to venous counts; going from a 1:0.1 to 1:1 ratio with an increment of 0.1 of the venous' portion each time. For each mixed data set, a trained mask of arterial counts' histogram is subtracted from the data set, and the remainder is used as an initial guess to run an expectation maximization maximum likelihood (EMML) algorithm. The algorithm calculates the arterial components of each mixed data set and the percent difference between the calculated components and the true arterial components. The average percent difference obtained using the patient-specific wrist phantom was compared to the values obtained with the original wrist phantom for each radioisotope (Carroll and Enger 2022).

Modeling of a patient-specific wrist phantom
We implemented a toolkit that allows the user to accurately model personalized wrist phantoms characterized by measurements from patient ultrasound images. Figure 2 shows the GUI interface at start-up comprising the Input Window allowing the user to choose the ultrasound image.
The patient-specific radial artery and veins' radii and depth from the skin surface are extracted from ultrasound scans following simple and easy steps (see Figure 3). This allows the user to launch Geant4-based Monte Carlo simulations with accurate dimensions of the patient's wrist (see Figure 4). Figure 5 shows the GUI after loading the ultrasound scan, choosing the radioactive source, and measuring the vessels' surfaces and depths.

RADETSS measurement accuracy
The repeated measurements performed by the five users showed an overall average depth of 3.67 mm and an overall average surface area of 6.74 mm 2 . The standard deviation was 0.057 mm for the radial artery depth and 0.21 mm 2 for the surface area. We also analyzed the values for each user independently to measure the intra-user reproducibility. A deviation varying between 0.020 mm and 0.086 mm was quantified for the depth measurement and between 0.13 mm 2 and 0.27 mm 2 for the surface measurement as shown in tables 3 and 4. Table 5 shows the calculated global detector's efficiency based on the patient-specific wrist phantom for 18 F and 68 Ga. We compared these results to the total efficiency obtained by Carroll and Enger (2022), for the same radioisotopes, using the wrist phantom modeled according to the average radial artery's surface and depth reported by Lee et al (2016). When simulated on the patient-specific wrist, the detector's total efficiency decreased by 3.5% for 18 F and by 51.7% for 68 Ga, the results are reported with type A uncertainties calculated using the history-by-history method (Walters et al 2002).

Simulations on the patient-specific wrist phantom
The separation of arterial counts from venous counts gave an average percent difference between the calculated components and the true arterial components of 1.6% for the 18 F simulation and 1.0% for the 68 Ga simulation.

Discussion
By analyzing the radiotracer kinetics of the patients, dPET provides a better assessment of changes in tumor metabolism compared to static PET. For instance, kinetic measurements better predict pathologic response in locally advanced breast cancer patients and offer advantages over static uptake measurements for breast cancer   (Dunnwald et al 2011). However, dPET is limited to a small group of patients since it requires the measurement of the AIF by arterial cannulation. A non-invasive radiation detector, NID, has been developed by our group to measure the number of photons and positrons escaping the radial artery and the radial veins (Turgeon et al 2019, Carroll et al 2020 and calculate the AIF. To calculate the AIF, the NID output must be multiplied by a patient-specific correction factor extracted by running a Geant4-based Monte Carlo simulation of the radiation escaping a patient's wrist and reaching the detector.
The developed GUI provides a toolkit to create an exact simulation of the patient's wrist, the radial artery, the radial veins, the radioactive source, and its position inside the vessels. It allows clinicians to use a Monte Carlo simulation toolkit without knowledge of programming, Geant4, or Monte Carlo methods. However, the user must ensure that the ultrasound scans are performed at the right positions on the wrist.
The steps required can be summarized in three easy points: 1. Import of the 2D ultrasound scans 2. Measurement of the radial artery and radial veins' surface and depth along the wrist 3. Choice of the radioactive source from the Source drop-down menu The RADETSS is designed to be easy to use and user-friendly. It is a step forward toward the calculation of patient-specific Monte Carlo simulations for obtaining the AIF, where the patient's anatomy is taken into account while modeling a wrist phantom.
A comparison between the simulation results performed by Carroll and Enger (2022) using the original wrist phantom and the simulation results obtained by this study using the RADETSS on a phantom model based on patient ultrasound scans was performed (Carroll and Enger 2022). The original wrist phantom was designed as a 10 cm long polyethylene cylinder, 6.41 cm in diameter containing 2 holes one simulating the radial artery and one the radial vein. The holes have a diameter of 2.30 mm (cross-section surface area of 4.15 mm 2 ) and their depths vary between 2 and 3 mm from the surface (Carroll and Enger 2022). When simulated on the patientspecific wrist, the detector's total efficiency decreased for both 18 F and 68 Ga, this result was expected since the vessels in the patient-specific wrist phantom modeled by our study are deeper than the maximum depth previously simulated. Carroll and Enger (2022) reported a decrease in the detector's efficiency as the artery's depth in the wrist increases, with a higher decrease for 68 Ga. We expect, according to their study, an efficiency lower than 0.035 for F-18 and lower than 0.055 for Ga-68. The results obtained match the expected results.
The clinical data analysis showed a higher percent difference between calculated arterial components and real components when simulated on the patient-specific wrist phantom, compared to the original wrist phantom simulations. Carroll and Enger (2022) reported a percent difference lower than 1% for 68 Ga and 18 F, except for 6 simulations out of the 110 simulations done with 18 F, where the percent difference was higher than 1%. Based on the ultrasound scans, 2 radial veins touching the radial artery were simulated, the presence of more venous counts in our simulation reduced the accuracy of the algorithm separating arterial counts from venous counts.
Our future work will focus on improving the data processing algorithm to reduce the percent difference between calculated arterial components and real arterial components. We will also implement a new feature to import the detector's 3D representation into the software. Currently, the detector is designed as two layers of 10 cm scintillating fibers, parallel and centered on the radial artery. Having the detector in STL format, the user can change the detector design and can place it differently on the wrist to better represent the real placement during the dPET scan, in relation to the radial artery and veins. Simulations with our in-house Geant4 toolkit will be then based not only on an accurate representation of the wrist and the patient's anatomy but also on the actual geometry of the detector and its position on the wrist. Our simulations will be therefore specific to each dPET scan.

Conclusion
We successfully implemented a simulation toolkit that allows any user, without knowledge of C++ or Geant4, to perform patient-specific Geant4-based Monte Carlo simulations and to calculate non-invasive, personalized AIF for dPET acquisitions.