Add CVaR upper constraint helper in Optimization#15
Add CVaR upper constraint helper in Optimization#15gourav3017 merged 3 commits intoPortPy-Project:devfrom
Conversation
There was a problem hiding this comment.
Thank you for adding it. It looks good. I think it would be more cleaner to have constraint_def[i]['type'] == 'dose_volume_D' or constraint_def[i]['type'] == 'dose_volume_V'. But we can add dvh constraint method as CVAR. Something like below.
{
"type": "dose_volume_V",
"parameters": {
"structure_name": "RECTUM",
"dose_gy": 5,
"dvh_method": "cvar" // or use default available one in portpy echo-vmat extension
},
"constraints": {
"limit_volume_perc": 84,
"constraint_type": "upper"
}
}
In the code, you should check first if it is dose volume constraint. If yes, check if it is using cvar or not. If yes, then implement using cvar or else skip it/use portpy default. You can refer dvh constraint implementation in github.com/PortPy-Project/ECHO-VMAT/blob/main/examples/echo_vmat_portpy.ipynb
You have to modify clinical_criteria.py --> get_dvh_table method to add column for 'dvh_method' or other parameters you might need for cvar (I assume your "alpha" is same as 1-volume_perc/100. In this case you don't need to add alpha in dvh_table). Then loop through dvh table in optimization.py code to add the constraint. Let me know if you need any help. We can discuss.
There was a problem hiding this comment.
Thanks for the detailed suggestion. I’ll implement it.
Usage
JSON configuration:
"type": "CVaR_Upper".parameters.structure_name(e.g.,"HEART")parameters.alpha(e.g.,0.90)constraints.limit(CVaR upper limit on total dose, in Gy)Programmatic API:
Optimizationobject using the standard workflow.opt.add_CVaR_Upper(alpha=0.90, limit=5, struct="HEART")