Skip to content

Commit 0d68a2d

Browse files
committed
add test to capture PlanWidget behavior overwriting the isocenter in the workspace with nan if multiple isocenters are defined
1 parent c67b2a9 commit 0d68a2d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/gui/test_gui_PlanWidget.m

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,34 @@
110110
evalin('base','clear ct cst pln stf dij resultGUI');
111111
delete(h);
112112

113+
function test_PlanWidget_multiisocenter
114+
evalin('base','load protons_testData.mat');
115+
116+
%Modify to have multiple isocenters
117+
pln = evalin('base','pln');
118+
pln.propStf.isoCenter(2,:) = [0 0 0];
119+
iso = pln.propStf.isoCenter;
120+
assignin('base','pln',pln);
121+
122+
h = matRad_PlanWidget();
123+
124+
% check correct value in isocenter edit field
125+
str = get(h.handles.editIsoCenter,'String');
126+
assertEqual(str,'multiple isoCenter');
127+
128+
%Now force an update by changing a value and executing the callback
129+
set(h.handles.editBixelWidth,'String','1');
130+
cb = get(h.handles.editBixelWidth,'Callback');
131+
cb(h.handles.editBixelWidth,[]);
132+
133+
str = get(h.handles.editIsoCenter,'String');
134+
assertEqual(str,'multiple isoCenter');
135+
pln = evalin('base','pln');
136+
assertEqual(pln.propStf.isoCenter,iso);
137+
138+
evalin('base','clear ct cst pln stf dij resultGUI');
139+
delete(h);
140+
141+
113142

114143
%TODO: Test Buttons

0 commit comments

Comments
 (0)