@@ -158,28 +158,6 @@ def ex_wavelet():
158158 sol = [sol_no_quad_no_wav , sol_no_quad_with_wav , sol_quad_no_wav , sol_quad_with_wav ],
159159 sol_names = ['no_quad_no_wav' , 'no_quad_with_wav' , 'quad_no_wav' , 'quad_with_wav' ])
160160
161- '''
162- 7) Visualize the dose dicrepancy between optimized and final deliverable plan using leaf sequencing
163- '''
164- # perform leaf sequencing for quadratic objective without and with wavelets using PortPy
165- leaf_seq_quad_no_wav = pp .leaf_sequencing_siochi (my_plan , sol_quad_no_wav )
166- leaf_seq_quad_wav = pp .leaf_sequencing_siochi (my_plan , sol_quad_with_wav )
167-
168- # Visualize the dvh after performing leaf sequencing using the optimal intensities
169- # plot DVH for the structures in the given list. Default dose_1d is in Gy and volume is in relative scale(%).
170- struct_names = ['PTV' , 'ESOPHAGUS' , 'HEART' , 'CORD' , 'LUNG_L' , 'LUNG_R' ]
171- num_fractions = my_plan .get_num_of_fractions ()
172- fig , ax = plt .subplots (1 , 2 , figsize = (20 , 7 ))
173- ax0 = pp .Visualization .plot_dvh (my_plan , sol = sol_no_quad_no_wav , struct_names = struct_names , style = 'solid' , ax = ax [0 ])
174- ax0 = pp .Visualization .plot_dvh (my_plan , dose_1d = inf_matrix .A @ leaf_seq_quad_no_wav ['optimal_intensity' ] * num_fractions , struct_names = struct_names , style = 'dashed' , ax = ax0 )
175- fig .suptitle ('DVH comparison' )
176- ax0 .set_title ('Without wavelets \n solid: Before leaf sequencing, Dash: After leaf sequencing' )
177-
178- # fig, ax = plt.subplots(figsize=(12, 8))
179- ax1 = pp .Visualization .plot_dvh (my_plan , sol = sol_quad_with_wav , struct_names = struct_names , style = 'solid' , ax = ax [1 ])
180- ax1 = pp .Visualization .plot_dvh (my_plan , dose_1d = inf_matrix .A @ leaf_seq_quad_wav ['optimal_intensity' ] * num_fractions , struct_names = struct_names , style = 'dashed' , ax = ax1 )
181- ax1 .set_title ('With wavelets \n solid: Before leaf sequencing, Dash: After leaf sequencing' )
182- plt .show ()
183161
184162if __name__ == "__main__" :
185163 ex_wavelet ()
0 commit comments