Skip to content

Commit

Permalink
Code style comments addressed (MB review)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitantony committed Jan 27, 2023
1 parent 260bd66 commit 5084863
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 313 deletions.
4 changes: 2 additions & 2 deletions examples/matRad_example3_photonsDAO.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@

%%
% Enable sequencing and direct aperture optimization (DAO).
pln.propSeq.runSequencing = 1;
pln.propOpt.runDAO = 1;
pln.propSeq.runSequencing = true;
pln.propOpt.runDAO = true;

%% Generate Beam Geometry STF
stf = matRad_generateStf(ct,cst,pln);
Expand Down
24 changes: 12 additions & 12 deletions gui/widgets/matRad_DVHStatsWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
properties
SelectedDisplayOption;
selectedDisplayOption;
lockUpdate = false;
dvhWidgetHandle = [];
statWidgetHandle = [];
end

methods
function this = matRad_DVHStatsWidget(SelectedDisplayOption,handleParent)
function this = matRad_DVHStatsWidget(selectedDisplayOption,handleParent)


matRad_cfg = MatRad_Config.instance();
if nargin<2 %isempty(p.Results.handleParent)
if nargin < 2

handleParent = figure(...
'Units','normalized',...
Expand All @@ -52,9 +52,9 @@

end
this = this@matRad_Widget(handleParent);
this.SelectedDisplayOption = SelectedDisplayOption;
this.dvhWidgetHandle.SelectedCube = SelectedDisplayOption;
this.statWidgetHandle.SelectedCube = SelectedDisplayOption;
this.selectedDisplayOption = selectedDisplayOption;
this.dvhWidgetHandle.selectedCube = selectedDisplayOption;
this.statWidgetHandle.selectedCube = selectedDisplayOption;
this.lockUpdate = true;
this.dvhWidgetHandle.lockUpdate = true;
this.statWidgetHandle.lockUpdate = true;
Expand All @@ -72,22 +72,22 @@
this.statWidgetHandle.update(evt);
end
else
if ~strcmp(this.dvhWidgetHandle.SelectedCube, this.SelectedDisplayOption)
this.dvhWidgetHandle.SelectedCube = this.SelectedDisplayOption;
this.statWidgetHandle.SelectedCube = this.SelectedDisplayOption;
if ~strcmp(this.dvhWidgetHandle.selectedCube, this.selectedDisplayOption)
this.dvhWidgetHandle.selectedCube = this.selectedDisplayOption;
this.statWidgetHandle.selectedCube = this.selectedDisplayOption;

end
this.dvhWidgetHandle = this.dvhWidgetHandle.update();
this.statWidgetHandle = this.statWidgetHandle.update();
if numel(this.dvhWidgetHandle.widgetHandle.Children)>2
if numel(this.dvhWidgetHandle.widgetHandle.Children) > 2
this.removeOverlap();
end

end
end
end
function set.SelectedDisplayOption(this,value)
this.SelectedDisplayOption=value;
function set.selectedDisplayOption(this,value)
this.selectedDisplayOption = value;
this.update();

end
Expand Down
24 changes: 12 additions & 12 deletions gui/widgets/matRad_DVHWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

end
this = this@matRad_Widget(handleParent);
this.SelectedCube = SelectedCube;
this.SelectedCube = SelectedCube;

end

Expand All @@ -56,22 +56,23 @@

function this=update(this,evt)

if this.lockUpdate
if this.lockUpdate
doUpdate = true;
if nargin == 2
doUpdate = this.checkUpdateNecessary({'resultGUI','cst','pln'},evt);
end
if nargin == 2
doUpdate = this.checkUpdateNecessary({'resultGUI','cst','pln'},evt);
end

if doUpdate && evalin('base','exist(''resultGUI'')') && evalin('base','exist(''cst'')')
this.showDVH();
if numel(this.widgetHandle.Children) > 2
this.removeOverlap();
if doUpdate && evalin('base','exist(''resultGUI'')') && evalin('base','exist(''cst'')')
this.showDVH();
if numel(this.widgetHandle.Children) > 2
this.removeOverlap();
end
end
end
end
end

function removeOverlap(this)
delete(this.widgetHandle.Children(3)); % hack to clear previous plotted objects from the figure
delete(this.widgetHandle.Children(3)); % clear previous plotted objects from the figure
delete(this.widgetHandle.Children(3));
end

Expand All @@ -81,7 +82,6 @@ function removeOverlap(this)
methods(Access = protected)
function this = createLayout(this)
h88 = this.widgetHandle;

this.createHandles();

end
Expand Down
Loading

0 comments on commit 5084863

Please sign in to comment.