Skip to content

Commit

Permalink
extended GUI tests using the testData for photons, protons, helium an…
Browse files Browse the repository at this point in the history
…d carbon

Signed-off-by: Niklas Wahl <[email protected]>
  • Loading branch information
wahln committed Nov 19, 2024
1 parent d0ff281 commit 3f50eb7
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 4 deletions.
57 changes: 57 additions & 0 deletions test/gui/test_gui_DVHStatsWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,61 @@
delete(h);
close(get(p,'Parent'));

function test_DVHStatsWidget_constructWithPhotonPln
evalin('base','load photons_testData.mat');
h = matRad_DVHStatsWidget();
h.selectedDisplayOption = 'physicalDose';
try
assertTrue(isa(h, 'matRad_DVHStatsWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_DVHStatsWidget_constructWithProtonPln
evalin('base','load protons_testData.mat');
h = matRad_DVHStatsWidget();
try
assertTrue(isa(h, 'matRad_DVHStatsWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_DVHStatsWidget_constructWithCarbonPln
evalin('base','load carbon_testData.mat');
h = matRad_DVHStatsWidget();
try
assertTrue(isa(h, 'matRad_DVHStatsWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_DVHStatsWidget_constructWithHeliumPln
evalin('base','load helium_testData.mat');
h = matRad_DVHStatsWidget();
try
assertTrue(isa(h, 'matRad_DVHStatsWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

%TODO: Test Buttons / visibility depending on data
63 changes: 60 additions & 3 deletions test/gui/test_gui_PlanWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
delete(h);
close(get(p,'Parent'));

function test_PlanWidget_constructWithData
function test_PlanWidget_constructWithTG119
evalin('base','load TG119.mat');
h = matRad_PlanWidget();
try
Expand All @@ -52,6 +52,63 @@
rethrow(ME);
end
evalin('base','clear ct cst pln');
delete(h);
delete(h);

function test_PlanWidget_constructWithPhotonPln
evalin('base','load photons_testData.mat');
h = matRad_PlanWidget();
try
assertTrue(isa(h, 'matRad_PlanWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_PlanWidget_constructWithProtonPln
evalin('base','load protons_testData.mat');
h = matRad_PlanWidget();
try
assertTrue(isa(h, 'matRad_PlanWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_PlanWidget_constructWithCarbonPln
evalin('base','load carbon_testData.mat');
h = matRad_PlanWidget();
try
assertTrue(isa(h, 'matRad_PlanWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_PlanWidget_constructWithHeliumPln
evalin('base','load helium_testData.mat');
h = matRad_PlanWidget();
try
assertTrue(isa(h, 'matRad_PlanWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);


%TODO: Test Buttons / visibility depending on data
%TODO: Test Buttons
14 changes: 14 additions & 0 deletions test/gui/test_gui_exportWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,18 @@
evalin('base','clear ct cst pln');
delete(h);

function test_exportWidget_constructWithCarbonPln
evalin('base','load carbon_testData.mat');
h = matRad_exportWidget();
try
assertTrue(isa(h, 'matRad_exportWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

%TODO: Test Buttons / visibility depending on data
58 changes: 57 additions & 1 deletion test/gui/test_gui_viewingWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
delete(h);
close(get(p,'Parent'));

function test_viewingWidget_constructWithData
function test_viewingWidget_constructWithTG119
evalin('base','load TG119.mat');
h = matRad_ViewingWidget();
try
Expand All @@ -53,4 +53,60 @@
evalin('base','clear ct cst pln');
delete(h);

function test_ViewingWidget_constructWithPhotonPln
evalin('base','load photons_testData.mat');
h = matRad_ViewingWidget();
try
assertTrue(isa(h, 'matRad_ViewingWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_ViewingWidget_constructWithProtonPln
evalin('base','load protons_testData.mat');
h = matRad_ViewingWidget();
try
assertTrue(isa(h, 'matRad_ViewingWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_ViewingWidget_constructWithCarbonPln
evalin('base','load carbon_testData.mat');
h = matRad_ViewingWidget();
try
assertTrue(isa(h, 'matRad_ViewingWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_ViewingWidget_constructWithHeliumPln
evalin('base','load helium_testData.mat');
h = matRad_ViewingWidget();
try
assertTrue(isa(h, 'matRad_ViewingWidget'));
assertTrue(isa(h, 'matRad_Widget'));
catch ME
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);
rethrow(ME);
end
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

%TODO: Test Buttons / visibility depending on data

0 comments on commit 3f50eb7

Please sign in to comment.