
The Portal Dosimetry workspace is primarily a space for the analysis and review of patient-specific Quality Assurance (QA) images collected with the Electronic Portal Imaging Device (EPID). Increasingly, this EPID-based measurement has proved beneficial in its efficiency for collecting periodic linear accelerator QA.
Therefore, Portal Dosimetry shows promise as a workspace for the organization and analysis of a radiotherapy clinic's linear accelerator QA program.
The generation of Eclipse Scripts outside of using the Eclipse Script wizard is a common way of generating scripts for many developers. Developers generating Eclipse scripts often know the steps required to make a standard WPF application a valid ESAPI script which commonly includes the following steps:
Selecting the correct .NET Framework version for the version of Eclipse being targeted.
Setting the correct build architecture (x64).
Adding reference to the correct ESAPI libraries (VMS.TPS.Common.Model.API.dll and VMS.TPS.Common.Model.Types.dll)
Developing scripts against the Portal Dosimetry Scripting API (PDSAPI) compares well to this process, but with some additional steps that may be important of note. Through this example, a PDSAPI script will be created, in Eclipse Version 16.1, to perform a gamma analysis between two images and plot a gamma image in a WPF application. This blog specifically sets up the building of the application, while the analysis will be performed in a future installment.
Building the Application
Before starting the application, it may be worth checking-- by using the PDSAPI wizard in the tools menu of Portal Dosimetry-- the version of the .NET framework expected for Portal Dosimetry applications. It may not be the same as the current version being used for ESAPI. If this requires the addition of a new .NET framework version to the development environment, that may be added by (1) opening the Visual Studio Installer, (2) clicking modify on the current version of Visual Studio, and (3) selecting the Individual Components tab of the Visual Studio Installer. The components shown below are the .NET Framework 4.6.2 Targeting Pack and the .NET Framework 4.6.2 SDK.

Using Visual Studio, an application is developed with the application type of WPF (.NET Framework) and the newly installed .NET Framework 4.6.2.

As a personal habit, the MainWindow.xaml file is deleted and replaced with a MainView.xaml window in a Views folder and a MainViewModel.cs class in a ViewModels folder.
Making the Application PDSAPI
First, some of the standard scripting API components should be added. In the Projects menu, select the project properties, and select Build from the left side of the IDE. From here, the project platform target can be changed x64.

Next, right mouse click on the project Resources. Click Browse on the left side of the pop-up window and click Browse at the bottom of the window. In the pop-up window, find the API libraries for PDSAPI. This includes the following API libraries:
VMS.CA.Scripting.dll
VMS.PD.DV.Scripting.dll
PortalDosimetry.dll
These libraries can be found in a folder path similar to what's noted in this post, but the actual drive may vary between systems. Here, the path is C:\Program Files (x86)\Varian\Product Line\Workspaces\VMS.PortalDosimetry.Workspace, and there the files VMS.CA.Scripting.dll and VMS.DV.PD.Scripting.dll can be found.

There is another library that must be added in order to perform any gamma analysis work with PDSAPI. Within the same folder there is a library with the name PortalDosimetry.dll.
Additional PDSAPI Requirements
The prior additions to the project would be considered standard for any ESAPI project built outside the wizard, but there are some additional requirements for building a PDSAPI application.
Additional requirements for PDSAPI applications includes the addition of the AssemblyPath attribute to the AppSettings section of the application configuration file, and the addition of VMS.DV.PD.UI.Base.VTransientImageDataMgr.CreateInstance(true); prior to performing any gamma analyses.
PDSAPI uses libraries from the same folder path mentioned above when performing certain operations. Therefore, this folder path must be added as a configuration parameter with a specific name. The key must be AssemblyPath and the value must be the path where the Portal Dosimetry libraries are stored, i.e. "C:\Program Files (x86)\Varian\ProductLine\Workspaces\VMS.PortalDosimetry.Workspace\"

The next step requires some additional work in the application. Since the MainWindow.xaml file was deleted, the application will require a new startup point. Open the App.xaml file and modify the StartupURI="MainWindow.xaml" attribute of the Application object to the following:
Startup="Application_Startup"
Using the intellisense, this should generate an additional method in the App.xaml.cs file. Now, turning to the App.xaml.cs file, add a using directive for PDSAPI.
using pdsapi = VMS.DV.PD.Scripting;
Inside of the Application_Startup method that was created in the step above, add the following code:
private void Application_Startup(object sender, StartupEventArgs e)
{
try
{
using (pdsapi.Application pdApp = pdsapi.Application.CreateApplication())
{
}
}
catch(Exception ex)
{
//TODO: output exception to user or logs.
}
}
This, again, is pretty standard for any scripting application. Finally, the following line should be added to the top of the using statement: VMS.DV.PD.UI.Base.VTransientImageDataMgr.CreateInstance(true);
Now, the application is finally ready to be coded to perform some Portal Dosimetry functions.
Examples of Portal Dosimetry Application Functions
Below are some examples of some Portal Dosimetry applications that can be built to assist with Portal Dosimetry commissioning, and periodic Linear Accelerator Quality Assurance.
Detailed Portal Dosimetry Analysis: Calculate multiple analyses to find the pass limits of a portal dosimetry algorithm.

2. Profile Analysis: Some Portal Dosimetry Commissioning tests give more information when analyzing the profiles through the image. One such test is the Chair pattern as introduced in Anne Van Esche's paper Optimized Varian aSi portal dosimetry: development of datasets for collective use .

3. Field Size Analysis: Many standard Quality assurance plans require analysis of open radiation fields.

4. Winston Lutz Test: A common test to verify linear accelerator isocentricity between gantry, couch, and collimator can be performed using the Electronic Portal Imaging Device. More examples can be found in Yao Hao's paper, Portal dosimetry scripting application programming interface (PDSAPI) for Winston-Lutz test employing ceramic balls.

5. RapidArc QA Analysis: RapidArc Quality Assurance files distributed by Varian Medical Systems, generated by Anne Van Esche and the 7-Sigma team. More examples of QA analyses with PDSAPI can be found in the following manuscript: Application programming interface guided QA plan generation and analysis automation.

In a future blog post, we will explore how to utilize the gamma analysis for many of the tests mentioned above and more... The options are only limited by the developer's creativity!
Comentarios