Skip to content

Commit

Permalink
Input Parser for DVH and statistics widget
Browse files Browse the repository at this point in the history
  • Loading branch information
amitantony committed Apr 29, 2022
1 parent eae4a47 commit d17ecb2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
19 changes: 17 additions & 2 deletions gui/widgets/matRad_DVHStatsWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
end

methods
function this = matRad_DVHStatsWidget(handleParent)
function this = matRad_DVHStatsWidget(varargin)

p = inputParser;
p.addOptional('handleParent',[], @ishandle);
p.addParameter('SelectedCube','physicalDose', @ischar);
p.parse(varargin{:});

matRad_cfg = MatRad_Config.instance();
if nargin < 1
if isempty(p.Results.handleParent)
handleParent = figure(...
'Units','normalized',...
'Position',[0.005 0.05 0.495 0.9],...
Expand All @@ -31,6 +37,10 @@
end

this = this@matRad_Widget(handleParent);
this.SelectedCube = p.Results.SelectedCube;
this.dvhWidgetHandle.SelectedCube = this.SelectedCube;
this.statWidgetHandle.SelectedCube = this.SelectedCube;
this.showDVHstat();
end

function this=update(this,evt)
Expand Down Expand Up @@ -83,5 +93,10 @@
this.createHandles();

end

function this = showDVHstat(this)
this.dvhWidgetHandle.showDVH();
this.statWidgetHandle.showStatistics();
end
end
end
23 changes: 17 additions & 6 deletions gui/widgets/matRad_DVHWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
end

methods
function this = matRad_DVHWidget(handleParent)
if nargin < 1
function this = matRad_DVHWidget(varargin)

p = inputParser;
p.addOptional('handleParent',[], @ishandle);
p.addParameter('SelectedCube','physicalDose', @ischar);
p.parse(varargin{:});


if isempty(p.Results.handleParent)
handleParent = figure(...
'Units','normalized',...
'Position',[0.005 0.5 0.495 0.45],...
Expand All @@ -24,14 +31,17 @@
'HandleVisibility','callback',...
'Tag','figure1',...
'PaperSize',[20.99999864 29.69999902]);
else
handleParent = p.Results.handleParent;

end

this = this@matRad_Widget(handleParent);
this.SelectedCube = p.Results.SelectedCube;

if evalin('base','exist(''resultGUI'')')
this.showDVH();
end
% if evalin('base','exist(''resultGUI'')')
% this.showDVH();
% end
end

function this=initialize(this)
Expand Down Expand Up @@ -96,8 +106,9 @@ function showDVH(this)
end

dvh = matRad_calcDVH(cst,doseCube,'cum');

matRad_showDVH(axes(this.widgetHandle),dvh,cst,pln);
title(this.SelectedCube);
% this.widgetHandle.Title = this.SelectedCube;

end

Expand Down
13 changes: 11 additions & 2 deletions gui/widgets/matRad_StatisticsWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
end

methods
function this = matRad_StatisticsWidget(handleParent)
if nargin < 1
function this = matRad_StatisticsWidget(varargin)

p = inputParser;
p.addOptional('handleParent',[], @ishandle);
p.addParameter('SelectedCube','physicalDose', @ischar);
p.parse(varargin{:});

if isempty(p.Results.handleParent)
handleParent = figure(...
'Units','normalized',...
'Position',[0.005 0.05 0.495 0.45],...
Expand All @@ -24,10 +30,13 @@
'HandleVisibility','callback',...
'Tag','figure1',...
'PaperSize',[20.99999864 29.69999902]);
else
handleParent = p.Results.handleParent;

end

this = this@matRad_Widget(handleParent);
this.SelectedCube = p.Results.SelectedCube;

end

Expand Down
2 changes: 1 addition & 1 deletion gui/widgets/matRad_VisualizationWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function popupProfileType_Callback(this, hObject, event)

% 52 Callback
function btnDVH_Callback(this, hObject, event)
matRad_DVHStatsWidget();
matRad_DVHStatsWidget('SelectedCube',this.viewingWidgetHandle.SelectedDisplayOption); % pass fieldname in resultGUI
end

%H55 Callback
Expand Down

0 comments on commit d17ecb2

Please sign in to comment.