Esempio n. 1
0
def create_bladder_objectives(plan, ss, total_dose):
    OF.uniform_dose(ss, plan, ROIS.ctv.name, total_dose * 100, 30)
    OF.min_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 0.95, 150)
    OF.max_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 1.05, 80)
    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.05, 30)
    OF.max_dvh(ss, plan, ROIS.femoral_l.name, 45 * 100, 2, 2)
    OF.max_dvh(ss, plan, ROIS.femoral_r.name, 45 * 100, 2, 2)
Esempio n. 2
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)
Esempio n. 3
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)
Esempio n. 4
0
def create_rectum_objectives(ss, plan, total_dose):
    if total_dose == 50:
        OF.uniform_dose(ss, plan, ROIS.ctv_50.name, total_dose * 100, 20)
        OF.uniform_dose(ss, plan, ROIS.ctv_47.name, 47 * 100, 35)
        OF.min_dose(ss, plan, ROIS.ptv_47_50.name, 44.8 * 100, 200)
        OF.min_dose(ss, plan, ROIS.ptv_50.name, total_dose * 0.95 * 100, 150)
        OF.max_dvh(ss, plan, ROIS.ptv_47.name, total_dose * 0.95 * 100, 3, 20)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 2, 10)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 20)
        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.z_bladder.name, 28 * 100, 1, 2)
        OF.max_eud(ss, plan, ROIS.bowel_space.name, 20 * 100, 1, 5)
        OF.fall_off(ss, plan, ROIS.z_ptv_50_wall.name, 49 * 100, 45 * 100, 0.5,
                    5)
    #elif total_dose == 25:
    else:  # (Had to to change this for a rare 1.5*30 case.)
        OF.uniform_dose(ss, plan, ROIS.ctv.name, total_dose * 100, 35)
        OF.min_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 0.95, 150)
        OF.max_dose(ss, plan, ROIS.ptv.name, total_dose * 100 * 1.05, 50)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 1.8, 15)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 20)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 16.2 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_spc_bowel.name, 14 * 100, 1, 2)
Esempio n. 5
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)
Esempio n. 6
0
def create_prostate_bed_objectives(ss, plan, total_dose):
    if SSF.has_roi_with_shape(ss, ROIS.ptv_56.name):  # With lymph node volume
        OF.uniform_dose(ss, plan, ROIS.ctv_70.name, total_dose * 100, 20)
        OF.uniform_dose(ss, plan, ROIS.ctv_56.name, 56 * 100, 20)
        OF.min_dose(ss, plan, ROIS.ptv_70.name, 67 * 100, 150)
        OF.min_dose(ss, plan, ROIS.ptv_56.name, 54 * 100, 150)
        OF.max_dose(ss, plan, ROIS.ptv_70.name, total_dose * 100 * 1.045, 70)
        OF.fall_off(ss, plan, ROIS.external.name, 70 * 100, 35 * 100, 3, 15)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 20)
        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, 35 * 100, 1, 1)
        OF.max_eud(ss, plan, ROIS.z_bladder.name, 44 * 100, 1, 2)
        OF.max_eud(ss, plan, ROIS.z_spc_bowel.name, 28 * 100, 1, 2)
        OF.fall_off(ss, plan, ROIS.z_ptv_70_wall.name, total_dose * 100,
                    56 * 100, 1, 1)
        OF.fall_off(ss, plan, ROIS.z_ptv_56_wall.name, 56 * 100, 42 * 100, 1,
                    1)
    else:  # Without lymph node volume
        OF.uniform_dose(ss, plan, ROIS.ctv_70.name, total_dose * 100, 25)
        OF.min_dose(ss, plan, ROIS.ptv_70.name, total_dose * 100 * 0.96, 100)
        OF.max_dose(ss, plan, ROIS.ptv_70.name, total_dose * 100 * 1.03, 50)
        OF.fall_off(ss, plan, ROIS.external.name, total_dose * 100,
                    total_dose * 100 / 2, 2, 20)
        OF.max_dose(ss, plan, ROIS.external.name, total_dose * 100 * 1.05, 40)
        OF.max_dvh(ss, plan, ROIS.femoral_l.name, 35 * 100, 2, 15)
        OF.max_dvh(ss, plan, ROIS.femoral_r.name, 35 * 100, 2, 15)
        OF.max_eud(ss, plan, ROIS.rectum.name, 40 * 100, 1, 2)
        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)
Esempio n. 7
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)
Esempio n. 8
0
def create_lung_stereotactic_objectives(ss, plan, region_code, total_dose):
    nr_targets = SSF.determine_nr_of_indexed_ptvs(ss)
    for i in range(0, nr_targets):
        OF.fall_off(ss,
                    plan,
                    ROIS.external.name,
                    total_dose * 100,
                    total_dose * 100 / 2,
                    3,
                    5,
                    beam_set_index=i)
        OF.max_dose(ss,
                    plan,
                    ROIS.external.name,
                    total_dose * 130,
                    15,
                    beam_set_index=i)
        OF.max_dose(ss, plan, ROIS.skin.name, 30 * 100, 10, beam_set_index=i)
        OF.max_dose(ss,
                    plan,
                    ROIS.spinal_canal.name,
                    13 * 100,
                    5,
                    beam_set_index=i)
        OF.max_dvh(ss,
                   plan,
                   ROIS.chestwall.name,
                   30 * 100,
                   2,
                   100,
                   beam_set_index=i)
        OF.max_eud(ss,
                   plan,
                   ROIS.lungs.name,
                   4.5 * 100,
                   1,
                   1,
                   beam_set_index=i)
        if region_code in RC.lung_r_codes:
            OF.max_eud(ss,
                       plan,
                       ROIS.lung_r.name,
                       6.5 * 100,
                       1,
                       3,
                       beam_set_index=i)
            OF.max_dose(ss,
                        plan,
                        ROIS.ribs_r.name,
                        total_dose * 120,
                        10,
                        beam_set_index=i)
        else:
            OF.max_eud(ss,
                       plan,
                       ROIS.lung_l.name,
                       6.5 * 100,
                       1,
                       3,
                       beam_set_index=i)
            OF.max_dose(ss,
                        plan,
                        ROIS.ribs_l.name,
                        total_dose * 120,
                        10,
                        beam_set_index=i)
    if nr_targets == 1:
        OF.min_dose(ss, plan, ROIS.ptv.name, total_dose * 100, 250)
        OF.fall_off(ss, plan, ROIS.wall_ptv.name, total_dose * 100,
                    0.7 * total_dose * 100, 0.8, 5)
    else:
        for i in range(0, nr_targets):
            OF.min_dose(ss,
                        plan,
                        ROIS.ptv.name + str(i + 1),
                        total_dose * 100,
                        250,
                        beam_set_index=i)
            OF.fall_off(ss,
                        plan,
                        "zPTV" + str(i + 1) + "_Wall",
                        total_dose * 100,
                        0.7 * total_dose * 100,
                        0.8,
                        5,
                        beam_set_index=i)