Example #1
0
def create_lung_objectives(ss, plan, target, total_dose):
    if total_dose > 40:
        # Curative fractionation:
        OF.uniform_dose(ss, plan, target, total_dose * 100, 25)
        OF.max_dose(ss, plan, target, total_dose * 100 * 1.05, 5)
        OF.min_dvh(ss, plan, target, total_dose * 0.95 * 100, 98, 100)
        OF.min_dvh(ss, plan, ROIS.ptv.name, total_dose * 0.95 * 100, 95, 80)
        OF.max_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 1.05, 50)
        OF.max_eud(ss, plan, ROIS.esophagus.name, 0.51 * total_dose * 100, 1,
                   1)  # (~34 Gy for 66 Gy total dose)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 80)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 3, 2)
        OF.max_eud(ss, plan, ROIS.heart.name, 0.53 * total_dose * 100, 1,
                   10)  # (~35 Gy for 66 Gy total dose)
        OF.max_eud(ss, plan, ROIS.spinal_canal.name, 0.6818 * total_dose * 100,
                   1, 10)  # (~45 Gy for 66 Gy total dose)
        match = False
        if SSF.has_roi_with_shape(ss, ROIS.lungs_gtv.name):
            l = ROIS.lungs_gtv.name
        elif SSF.has_roi_with_shape(ss, ROIS.lungs_igtv.name):
            l = ROIS.lungs_igtv.name
        else:
            l = ROIS.lungs.name
        OF.max_eud(ss, plan, l, 0.29 * total_dose * 100, 1,
                   15)  # (~19 Gy for 66 Gy total dose)
        OF.max_dvh(ss, plan, l, total_dose * 0.07575 * 100, 55,
                   70)  # (~5 Gy for 66 Gy total dose)
        OF.max_dvh(ss, plan, l, total_dose * 0.3030 * 100, 30,
                   80)  # (~5 Gy for 66 Gy total dose)
    elif total_dose < 40:
        # Palliative fractionation:
        OF.uniform_dose(ss, plan, target, total_dose * 100, 35)
        OF.max_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 1.05, 120)
        OF.min_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 0.95, 150)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 80)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 3, 2)
        OF.max_eud(ss, plan, ROIS.heart.name, 0.29 * total_dose * 100, 1, 10)
        OF.max_eud(ss, plan, ROIS.lungs.name, 0.23 * total_dose * 100, 1, 15)
        OF.max_eud(ss, plan, ROIS.spinal_canal.name, 0.9 * total_dose * 100, 1,
                   5)
Example #2
0
def create_breast_reg_objectives(ss, plan, region_code, total_dose,
                                 technique_name):
    OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                total_dose * 100 / 2, 2.5, 30)
    OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 30)
    OF.max_eud(ss, plan, ROIS.heart.name, 2 * 100, 1, 5)
    OF.uniform_dose(ss, plan, ROIS.ctv.name, total_dose * 0.998 * 100, 15)
    OF.max_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 1.044 * 100, 2, 100)
    if technique_name == 'VMAT':
        OF.min_dvh_robust(ss, plan, ROIS.ptv_pc.name, total_dose * 0.97 * 100,
                          99, 100)
        OF.min_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 0.97 * 100, 99, 100)
        if region_code in RC.breast_reg_l_codes:
            # Left sided target:
            OF.max_eud(ss, plan, ROIS.breast_r.name, 3 * 100, 1, 1)
        else:
            # Right sided target:
            OF.max_eud(ss, plan, ROIS.breast_l.name, 3 * 100, 1, 1)
    else:
        OF.min_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 0.97 * 100, 99, 100)
Example #3
0
def create_breast_reg_objectives(ss, plan, region_code, total_dose,
                                 technique_name):
    if SSF.has_roi_with_shape(ss, ROIS.ctv_p.name):
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 2.5, 30)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 30)
        OF.max_eud(ss, plan, ROIS.heart.name, 2 * 100, 1, 5)
        OF.uniform_dose(ss, plan, ROIS.ctv.name, total_dose * 0.998 * 100, 15)
        OF.max_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 1.044 * 100, 2, 100)
        if technique_name == 'VMAT':
            OF.min_dvh_robust(ss, plan, ROIS.ptv_pc.name,
                              total_dose * 0.97 * 100, 99, 100)
            OF.min_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 0.97 * 100, 99,
                       100)
            if region_code in RC.breast_reg_l_codes:  # Left
                OF.max_eud(ss, plan, ROIS.breast_r.name, 3 * 100, 1, 1)
            else:
                OF.max_eud(ss, plan, ROIS.breast_l.name, 3 * 100, 1, 1)
        else:
            OF.min_dvh(ss, plan, ROIS.ptv_c.name, total_dose * 0.97 * 100, 99,
                       100)
    else:
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 2.5, 30)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 30)
        OF.max_eud(ss, plan, ROIS.heart.name, 2 * 100, 1, 5)
        OF.uniform_dose(ss, plan, ROIS.ctv_50.name, total_dose * 0.998 * 100,
                        15)
        OF.uniform_dose(ss, plan, ROIS.ctv_47.name, total_dose * 0.94 * 100, 5)
        OF.min_dvh(ss, plan, ROIS.ptv_47c.name, total_dose * 0.9 * 100, 99,
                   100)
        OF.max_dvh(ss, plan, ROIS.ptv_47c.name, total_dose * 0.95 * 100, 2,
                   100)
        OF.max_dvh(ss, plan, ROIS.ptv_50c.name, total_dose * 1.044 * 100, 2,
                   100)
        if technique_name == 'VMAT':
            OF.min_dvh_robust(ss, plan, ROIS.ptv_50c.name,
                              total_dose * 0.97 * 100, 99, 100)
            if region_code in RC.breast_reg_l_codes:  # Left
                OF.max_eud(ss, plan, ROIS.breast_r.name, 3 * 100, 1, 1)
            else:
                OF.max_eud(ss, plan, ROIS.breast_l.name, 3 * 100, 1, 1)
        else:
            OF.min_dvh(ss, plan, ROIS.ptv_50c.name, total_dose * 0.97 * 100,
                       99, 100)
Example #4
0
def create_prostate_objectives(ss, plan, total_dose):
    if total_dose == 60:  # Hypofractionation
        OF.uniform_dose(ss, plan, ROIS.ctv_60.name, total_dose * 100, 40)
        OF.uniform_dose(ss, plan, ROIS.ctv_57.name, total_dose * 0.95 * 100,
                        40)
        OF.min_dose(ss, plan, ROIS.ptv_60.name, 57.1 * 100, 150)
        OF.min_dose(ss, plan, ROIS.ptv_57.name, total_dose * 100 * 0.91, 170)
        OF.min_dose(ss, plan, ROIS.ctv_57.name, total_dose * 100 * 0.93, 35)
        OF.max_dose(ss, plan, ROIS.ptv_60.name, total_dose * 100 * 1.02, 60)
        OF.max_dvh(ss, plan, ROIS.ptv_57.name, total_dose * 0.978 * 100, 1, 50)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 1.5, 30)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.038, 25)
        OF.max_dvh(ss, plan, ROIS.femoral_l.name, 20 * 100, 2, 10)
        OF.max_dvh(ss, plan, ROIS.femoral_r.name, 20 * 100, 2, 10)
        OF.max_eud(ss, plan, ROIS.rectum.name, 22.6 * 100, 1, 2)
        OF.max_dvh(ss, plan, ROIS.rectum.name, total_dose * 0.975 * 100, 3, 4)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 18 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 28 * 100, 3, 1)
        OF.max_dvh(ss, plan, ROIS.z_rectum.name, 51 * 100, 1, 10)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 12.4 * 100, 1, 1)
        OF.fall_off(ss, plan, ROIS.z_ptv_60_wall.name, total_dose * 100,
                    57 * 100, 0.3, 1)
        OF.fall_off(ss, plan, ROIS.z_ptv_57_60_wall.name, total_dose * 100,
                    42 * 100, 0.8, 12)
    elif total_dose == 55:  # Hypofractionation
        OF.uniform_dose(ss, plan, ROIS.ctv.name, total_dose * 100, 40)
        OF.min_dose(ss, plan, ROIS.ptv.name, 52.3 * 100, 150)
        OF.max_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 1.02, 60)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 1.5, 30)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.038, 25)
        OF.max_dvh(ss, plan, ROIS.femoral_l.name, 20 * 100, 2, 10)
        OF.max_dvh(ss, plan, ROIS.femoral_r.name, 20 * 100, 2, 10)
        OF.max_eud(ss, plan, ROIS.rectum.name, 22.6 * 100, 1, 2)
        OF.max_dvh(ss, plan, ROIS.rectum.name, total_dose * 0.975 * 100, 3, 4)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 18 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 28 * 100, 3, 1)
        OF.max_dvh(ss, plan, ROIS.z_rectum.name, 51 * 100, 1, 10)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 12.4 * 100, 1, 1)
        OF.fall_off(ss, plan, ROIS.z_ptv_wall.name, total_dose * 100, 42 * 100,
                    1, 1)
    elif total_dose == 77 and SSF.has_roi_with_shape(
            ss, ROIS.ptv_56.name):  # Normo-fractionation and lymph node volume
        OF.uniform_dose(ss, plan, ROIS.ctv_56.name, 56 * 100, 15)
        OF.uniform_dose(ss, plan, ROIS.ctv_70_sib.name, 70 * 100, 25)
        OF.uniform_dose(ss, plan, ROIS.ctv_77.name, 77 * 100, 20)
        OF.min_dose(ss, plan, ROIS.ptv_56.name, 55 * 100, 100)
        OF.max_dvh(ss, plan, ROIS.ptv_56.name, 58.5 * 100, 5, 5)
        OF.min_dose(ss, plan, ROIS.ptv_70_sib.name, total_dose * 100 * 0.88,
                    100)
        OF.max_dvh(ss, plan, ROIS.ptv_70_sib.name, total_dose * 0.95 * 100, 5,
                   50)
        OF.min_dose(ss, plan, ROIS.ptv_77.name, total_dose * 100 * 0.98, 100)
        OF.max_dose(ss, plan, ROIS.ptv_77.name, total_dose * 100 * 1.02, 70)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 20)
        OF.fall_off(ss, plan, ROIS.external.name, 56 * 100, 28 * 100, 2, 15)
        OF.max_dvh(ss, plan, ROIS.femoral_l.name, 35 * 100, 2, 10)
        OF.max_dvh(ss, plan, ROIS.femoral_r.name, 35 * 100, 2, 10)
        OF.max_dvh(ss, plan, ROIS.rectum.name, 72.5 * 100, 5, 10)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 31 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 34 * 100, 1, 2)
        OF.max_eud(ss, plan, ROIS.z_spc_bowel.name, 14.2 * 100, 1, 2)
        OF.fall_off(ss, plan, ROIS.z_ptv_77_wall.name, total_dose * 100,
                    71 * 100, 0.3, 10)
        OF.fall_off(ss, plan, ROIS.z_ptv_70_77_wall.name, total_dose * 100,
                    56 * 100, 0.5, 5)
    elif total_dose == 77:  # Normo-fractionation
        OF.uniform_dose(ss, plan, ROIS.ctv_77.name, total_dose * 100, 40)
        OF.uniform_dose(ss, plan, ROIS.ctv_70_sib.name, 70 * 100, 40)
        OF.min_dose(ss, plan, ROIS.ctv_70_sib.name, total_dose * 100 * 0.89,
                    25)
        OF.min_dose(ss, plan, ROIS.ptv_77.name, total_dose * 100 * 0.98, 150)
        OF.min_dvh(ss, plan, ROIS.ptv_70_sib.name, total_dose * 100 * 0.89, 98,
                   150)
        OF.max_dose(ss, plan, ROIS.ptv_77.name, total_dose * 100 * 1.02, 70)
        OF.max_dose(ss, plan, ROIS.ptv_70_sib.name, total_dose * 0.935 * 100,
                    50)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 1.5, 30)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.038, 25)
        OF.max_dvh(ss, plan, ROIS.femoral_l.name, 35 * 100, 2, 10)
        OF.max_dvh(ss, plan, ROIS.femoral_r.name, 35 * 100, 2, 10)
        OF.max_eud(ss, plan, ROIS.rectum.name, 40 * 100, 1, 2)
        OF.max_dvh(ss, plan, ROIS.rectum.name, 72.4 * 100, 5, 15)
        OF.max_dvh(ss, plan, ROIS.z_rectum.name, 60 * 100, 3, 10)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 29.5 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_rectum.name, 30 * 100, 5, 1)
        OF.max_dvh(ss, plan, ROIS.z_rectum.name, 51 * 100, 1, 10)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 25 * 100, 1, 3)
        OF.fall_off(ss, plan, ROIS.z_ptv_77_wall.name, total_dose * 100,
                    68 * 100, 0.3, 15)