Skip to content

Conversation

@sijiaww
Copy link
Contributor

@sijiaww sijiaww commented Dec 19, 2025

Usage

  • JSON configuration:

    • Add a constraint entry with "type": "CVaR_Upper".
    • Required fields:
      • parameters.structure_name (e.g., "HEART")
      • parameters.alpha (e.g., 0.90)
      • constraints.limit (CVaR upper limit on total dose, in Gy)
  • Programmatic API:

    • Construct an Optimization object using the standard workflow.
    • Add the constraint, for example:
      opt.add_CVaR_Upper(alpha=0.90, limit=5, struct="HEART")
    • Solve the optimization problem using the existing solve workflow.

Copy link
Collaborator

@gourav3017 gourav3017 Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed suggestion. I’ll implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants