Implementation of an Automated Field-In-Field Optimization Algorithm within Eclipse Scripting API Using K-Means Clustering and Linear Programming
Abstract
Purpose
To develop and validate a fully automated, cost-effective Field-in-Field (FiF) planning script within the Varian Eclipse Scripting API (ESAPI) environment. The project aims to improve the plan quality and efficiency for breast radiotherapy by leveraging Eclipse’s native inverse IMRT optimization and dose calculation engines, thereby reducing development overhead and ensuring calculation accuracy.
Methods
A custom C# ESAPI script was developed that utilizes a multi-stage optimization workflow. First, the script executes an inverse IMRT optimization to generate an ideal fluence map. This map is stratified into deliverable subfields using K-means clustering; a centroid respawning technique is applied to eliminate undesirable small clusters within the fluence. Final subfield weights are optimized using a C#-compatible optimization engine (Alignet). A Conditional Value at Risk (CVaR) approach is employed via efficient linear programming to maximize PTV coverage while strictly constraining hotspots. The algorithm was validated on 10 randomly selected breast cancer patients by comparing global hotspots, coverage, and isodose distributions against a standard commercial automated solution.
Results
The script successfully generated clinically acceptable plans with speed and quality matching the commercial comparator. Visual analysis of isodose lines and DVHs demonstrated near-identical dose distributions. Quantitative analysis of the 10 test cases showed that the script achieved global hotspots (average ~110.0%) indistinguishable from the commercial solution (110%). The segmentation logic successfully converted complex fluence maps into deliverable open medial fields and corresponding subfields. The typical running time is less than a minute, including dose calculations and optimization.
Conclusion
We successfully implemented a "friendly-to-deploy" automated FiF algorithm that bridges the gap between inverse optimization and forward planning. By integrating K-means clustering and linear programming directly into the Eclipse environment, this solution provides a robust, low-cost alternative to commercial modules, standardizing plan quality and reducing manual planning time for breast treatments.