Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions matRad/gui/widgets/matRad_PlanWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,9 @@ function updatePlnInWorkspace(this,hObject,evtData)
pln.propStf.gantryAngles = this.parseStringAsNum(get(handles.editGantryAngle,'String'),true); % [°]
pln.propStf.couchAngles = this.parseStringAsNum(get(handles.editCouchAngle,'String'),true); % [°]

if ~isempty(hObject) && (strcmp(hObject.Tag,'editGantryAngle')||strcmp(hObject.Tag,'editCouchAngle'))
objectTag = get(hObject,'Tag');

if ~isempty(hObject) && (strcmp(objectTag,'editGantryAngle')||strcmp(objectTag,'editCouchAngle'))
if numel(this.parseStringAsNum(get(handles.editCouchAngle,'String'),true))<numel(this.parseStringAsNum(get(handles.editGantryAngle,'String'),true)) % Feature: autofill couch angles to single plane by entering a single value
couchGantryDifference = numel(this.parseStringAsNum(get(handles.editGantryAngle,'String'),true))-numel(this.parseStringAsNum(get(handles.editCouchAngle,'String'),true));
pln.propStf.couchAngles = [this.parseStringAsNum(get(handles.editCouchAngle,'String'),true) zeros(1,couchGantryDifference)];
Expand All @@ -982,8 +984,12 @@ function updatePlnInWorkspace(this,hObject,evtData)
this.plotPlan = true;
end

pln.propStf.numOfBeams = numel(pln.propStf.gantryAngles);
pln.propStf.isoCenter = this.parseStringAsNum(get(handles.editIsoCenter,'String'),true);
pln.propStf.numOfBeams = numel(pln.propStf.gantryAngles);

isoStr = get(handles.editIsoCenter,'String');
if ~isequal(isoStr,'multiple isoCenter')
pln.propStf.isoCenter = this.parseStringAsNum(isoStr,true);
end

% switch machines depending on radmode selection
selectedMachine = get(handles.popUpMachine,'Value');
Expand Down
29 changes: 29 additions & 0 deletions test/gui/test_gui_PlanWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,34 @@
evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);

function test_PlanWidget_multiisocenter
evalin('base','load protons_testData.mat');

%Modify to have multiple isocenters
pln = evalin('base','pln');
pln.propStf.isoCenter(2,:) = [0 0 0];
iso = pln.propStf.isoCenter;
assignin('base','pln',pln);

h = matRad_PlanWidget();

% check correct value in isocenter edit field
str = get(h.handles.editIsoCenter,'String');
assertEqual(str,'multiple isoCenter');

%Now force an update by changing a value and executing the callback
set(h.handles.editBixelWidth,'String','1');
cb = get(h.handles.editBixelWidth,'Callback');
cb(h.handles.editBixelWidth,[]);

str = get(h.handles.editIsoCenter,'String');
assertEqual(str,'multiple isoCenter');
pln = evalin('base','pln');
assertEqual(pln.propStf.isoCenter,iso);

evalin('base','clear ct cst pln stf dij resultGUI');
delete(h);



%TODO: Test Buttons
Loading