Skip to content

Commit ff71400

Browse files
committed
fix dvh in compare dose
1 parent 74f0723 commit ff71400

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

examples/matRad_example6_protonsNoise.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
cst{ixRectum,6}{1}.parameters{1} = 40; % Change the reference dose
110110
cst{ixRectum,6}{1}.penalty = 500; % Change the penalty
111-
resultGUI = matRad_fluenceOptimization(dij,cst,pln);
111+
resultGUI = matRad_fluenceOptimization(dij,cst,pln);
112112
resultGUI = matRad_planAnalysis(resultGUI,ct,cst,stf,pln);
113113

114114
display(resultGUI.qi(ixRectum).D_5);

matRad/planAnalysis/matRad_compareDose.m

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757

5858
matRad_cfg = MatRad_Config.instance();
5959

60+
colorSpec = {'Color',matRad_cfg.gui.elementColor,...
61+
'XColor',matRad_cfg.gui.textColor,...
62+
'YColor',matRad_cfg.gui.textColor,...
63+
'GridColor',matRad_cfg.gui.textColor,...
64+
'MinorGridColor',matRad_cfg.gui.backgroundColor};
65+
6066
%% check if cubes consistent
6167
if ~isequal(size(cube1),size(cube2))
6268
matRad_cfg.dispError('dose cubes must be the same size\n');
@@ -159,11 +165,10 @@
159165
matRad_cfg.dispInfo('Plotting %s plane...\n',planename{plane});
160166

161167
% Initialize Figure
162-
hfig.(planename{plane}).('fig') = figure('Renderer', 'painters', 'Position', [10 50 800 800]);
163-
set(gcf,'Color',[1 1 1]);
168+
hfig.(planename{plane}).('fig') = figure('Position', [10 50 800 800],'Color',matRad_cfg.gui.backgroundColor);
164169

165170
% Plot Dose 1
166-
hfig.(planename{plane}).('cube1').Axes = subplot(2,2,1);
171+
hfig.(planename{plane}).('cube1').Axes = subplot(2,2,1,colorSpec{:});
167172
[hfig.(planename{plane}).('cube1').CMap,...
168173
hfig.(planename{plane}).('cube1').Dose,...
169174
hfig.(planename{plane}).('cube1').Ct,...
@@ -172,7 +177,7 @@
172177
matRad_plotSliceWrapper(gca,ct,cstHandle,1,cube1,plane,slicename{plane},[],[],colorcube,jet,doseWindow,[],100);
173178

174179
% Plot Dose 2
175-
hfig.(planename{plane}).('cube2').Axes = subplot(2,2,2);
180+
hfig.(planename{plane}).('cube2').Axes = subplot(2,2,2,colorSpec{:});
176181
[hfig.(planename{plane}).('cube2').CMap,...
177182
hfig.(planename{plane}).('cube2').Dose,...
178183
hfig.(planename{plane}).('cube2').Ct,...
@@ -181,7 +186,7 @@
181186
matRad_plotSliceWrapper(gca,ct,cstHandle,1,cube2,plane,slicename{plane},[],[],colorcube,jet,doseWindow,[],100);
182187

183188
% Plot absolute difference
184-
hfig.(planename{plane}).('diff').Axes = subplot(2,2,3);
189+
hfig.(planename{plane}).('diff').Axes = subplot(2,2,3,colorSpec{:});
185190
[hfig.(planename{plane}).('diff').CMap,...
186191
hfig.(planename{plane}).('diff').Dose,...
187192
hfig.(planename{plane}).('diff').Ct,...
@@ -190,7 +195,7 @@
190195
matRad_plotSliceWrapper(gca,ct,cstHandle,1,differenceCube,plane,slicename{plane},[],[],colorcube,diffCMap,doseDiffWindow,[],100);
191196

192197
% Plot gamma analysis
193-
hfig.(planename{plane}).('gamma').Axes = subplot(2,2,4);
198+
hfig.(planename{plane}).('gamma').Axes = subplot(2,2,4,colorSpec{:});
194199
gammaCMap = matRad_getColormap('gammaIndex');
195200
[hfig.(planename{plane}).('gamma').CMap,...
196201
hfig.(planename{plane}).('gamma').Dose,...
@@ -244,33 +249,32 @@
244249
yLabelString = 'Dose [Gy]';
245250
end
246251

247-
hfig.profiles.fig = figure('Renderer', 'painters', 'Position', [10 50 800 800]);
248-
set(gcf,'Color',[1 1 1]);
252+
hfig.profiles.fig = figure('Position', [10 50 800 800],'Color',matRad_cfg.gui.backgroundColor);
249253

250-
hfig.profiles.x = subplot(2,2,1);
251-
plot(posX,profilex{1},'r')
254+
hfig.profiles.x = subplot(2,2,1,colorSpec{:});
255+
plot(hfig.profiles.x,posX,profilex{1},'r')
252256
hold on
253-
plot(posX,profilex{2},'r--')
257+
plot(hfig.profiles.x,posX,profilex{2},'r--')
254258
xlabel('X [mm]','FontSize',fontsize)
255259
ylabel(yLabelString,'FontSize',fontsize);
256260
title('x-Profiles');
257261
legend({'Dose 1','Dose 2'},'Location','southeast')
258262
legend boxoff
259263

260-
hfig.profiles.y = subplot(2,2,2);
261-
plot(posY,profiley{1},'r')
264+
hfig.profiles.y = subplot(2,2,2,colorSpec{:});
265+
plot(hfig.profiles.y,posY,profiley{1},'r')
262266
hold on
263-
plot(posY,profiley{2},'r--')
267+
plot(hfig.profiles.y,posY,profiley{2},'r--')
264268
xlabel('Y [mm]','FontSize',fontsize)
265269
ylabel(yLabelString,'FontSize',fontsize);
266270
title('y-Profiles');
267271
legend({'Dose 1','Dose 2'},'Location','southeast')
268272
legend boxoff
269273

270-
hfig.profiles.z = subplot(2,2,3);
271-
plot(posZ,profilez{1},'r')
274+
hfig.profiles.z = subplot(2,2,3,colorSpec{:});
275+
plot(hfig.profiles.z,posZ,profilez{1},'r')
272276
hold on
273-
plot(posZ,profilez{2},'r--')
277+
plot(hfig.profiles.z,posZ,profilez{2},'r--')
274278
xlabel('Z [mm]','FontSize',fontsize)
275279
ylabel(yLabelString,'FontSize',fontsize);
276280
title('z-Profiles');
@@ -290,9 +294,8 @@
290294
% Plot DVH
291295
matRad_cfg.dispInfo('Plotting DVH...');
292296

293-
hfig.dvh.fig = figure('Renderer', 'painters', 'Position', [10 100 1000 700]);
294-
set(gcf,'Color',matRad_cfg.gui.backgroundColor);
295-
matRad_showDVH(dvh1,cst,pln);
297+
hfig.dvh.fig = figure('Position', [10 100 1000 700],'Color',matRad_cfg.gui.backgroundColor);
298+
matRad_showDVH(dvh1,cst,pln,'axesHandle',axes(hfig.dvh.fig,colorSpec{:}));
296299
hold on
297300
matRad_showDVH(dvh2,cst,pln,'axesHandle',gca,'LineStyle','--');
298301
xlim([0 dvhWindow*1.2])

matRad/planAnalysis/matRad_showDVH.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function matRad_showDVH(dvh,cst,varargin)
4242

4343
p.addRequired('dvh',@isstruct);
4444
p.addRequired('cst',@iscell);
45-
p.addOptional('pln',[],@isstruct);
45+
p.addOptional('pln',[],@(x) isstruct(x) || isempty(x));
4646
p.addParameter('axesHandle',[],@isgraphics);
4747
p.addParameter('plotLegend',true,@(x) isscalar(x) && islogical(x));
4848
%p.addParameter('plotObjectives',false,@(x) isscalar(x) && islogical(x));

0 commit comments

Comments
 (0)