Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev_classGUI' into dev_classGUI
Browse files Browse the repository at this point in the history
# Conflicts:
#	gui/matRad_PlanWidget.m
#	gui/matRad_WorkflowWidget.m
  • Loading branch information
nellyabbani committed Mar 3, 2020
2 parents 4045a4b + 833e582 commit 986dbb6
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 374 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
List of all matRad developers that contributed code (alphabetical)

* Nabe Al-Hasnawi
* Mark Bangert
* Amit Ben Antony Bennan
* Lucas Burigo
Expand Down
7 changes: 3 additions & 4 deletions gui/matRad_InfoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
if nargin < 1
handleParent = figure(...
'Units','characters',...
'Position',[138.4 -7.38461538461539 273.4 59.5384615384615],...
'Position',[170.4 45 50 10],...
'Visible','on',...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],... 'CloseRequestFcn',@(hObject,eventdata) figure1_CloseRequestFcn(this,hObject,eventdata),...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],...
'IntegerHandle','off',...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'MenuBar','none',...
'Name','matRadGUI',...
'Name','MatRad Info',...
'NumberTitle','off',...
'HandleVisibility','callback',...
'Tag','figure1',...
'PaperSize',[20.99999864 29.69999902]);

end
this = this@matRad_Widget(handleParent);
end
Expand Down
13 changes: 4 additions & 9 deletions gui/matRad_LogoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
'PaperUnits','inches',...
'MenuBar','none',...
'Units','characters',...
'Position',[135.8 56.7692307692308 89.2 18.3846153846154],...
'Position',[135.8 70.7692307692308 500 18.3846153846154],...
'Color',[0.5 0.5 0.5],...
'Name','LogoWidget',...
'Name','MatRad Logo',...
'HandleVisibility','callback',...
'Tag','figure_importDialog',...
'WindowStyle','normal',...
'PaperSize',[8.5 11],...
'WindowStyle','normal',... 'PaperSize',[8.5 11],...
'PaperType','usletter');
end
this = this@matRad_Widget(handleParent);
Expand All @@ -33,7 +32,6 @@

h1 = this.widgetHandle;


h2 = axes(...
'Parent',h1,...
'CameraPosition',[0.5 0.5 9.16025403784439],...
Expand All @@ -46,15 +44,13 @@
'XTickLabel',{ '0'; '0.2'; '0.4'; '0.6'; '0.8'; '1' },...
'YTick',[0 0.5 1],...
'YTickLabel',{ '0'; '0.5'; '1' },...
'Position',[- 0.304874274661509 -0.12225992317542 0.994397163120567 1.048719590268886],...
'Position',[- 0.304874274661509 -0.12225992317542 0.994397163120567 1.048719590268886],...'Position',[- 0.304874274661509 -0.12225992317542 0.994397163120567 1.048719590268886],...
'ActivePositionProperty','position',...
'LooseInset',[0.182759687929063 0.112926163636008 0.133555156563546 0.0769951115700055],...
'FontSize',9.63,...
'SortMethod','childorder',...
'Tag','axesLogo');



[im, ~, alpha] = imread([filepath filesep '..' filesep 'gfx' filesep 'matrad_logo.png']);
f = image(im,'Parent',h2);
axis(h2,'equal','off');
Expand Down Expand Up @@ -223,7 +219,6 @@
'SortMethod','childorder',...
'Tag','axesDKFZ');


[im, ~, alpha] = imread([filepath filesep '..' filesep 'gfx' filesep 'DKFZ_Logo.png']);
f = image(im,'Parent',h7);
axis(h7,'equal','off');
Expand Down
19 changes: 4 additions & 15 deletions gui/matRad_MainGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
StructureVisibilityWidget
InfoWidget
ViewingWidget

eventListeners
end



methods(Access = protected)
function this = createMenuBar(this)
% h1 = widgethandle;
h1 = this.guiHandle;
load('matRad_iconsGUI.mat');

Expand Down Expand Up @@ -108,17 +106,12 @@

methods
function obj = matRad_MainGUI()
% obj.guiHandle = figure;
%Panel for Main Widget which contains label and titel etc.
%How to create Pnael which has to be as big as the figure
%itself
% p0 = uipanel();

%Panel for Main Widget
obj.guiHandle = figure(...
'Units','characters',...
'Position',[138.4 30.38461538461539 273.4 59.5384615384615],...
'Visible','on',...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],... 'CloseRequestFcn',@(hObject,eventdata) figure1_CloseRequestFcn(this,hObject,eventdata),...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],...
'IntegerHandle','off',...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'MenuBar','none',...
Expand Down Expand Up @@ -263,17 +256,16 @@ function matRadGUI_OpeningFcn(this, hObject, event)

% variable to check whether GUI is opened or just refreshed / new data
% loaded, since resetGUI needs to distinguish at one point
handles = this.handles;

handles = this.handles;
handles.initialGuiStart = true;

%If devMode is true, error dialogs will include the full stack trace of the error
%If false, only the basic error message is shown (works for errors that
%handle the MException object)
handles.devMode = true;

handles.devMode = true;
set(handles.radiobtnPlan,'value',0);

handles = resetGUI(hObject, handles);

%% parse variables from base workspace
Expand Down Expand Up @@ -303,11 +295,8 @@ function matRadGUI_OpeningFcn(this, hObject, event)
else
handles = reloadGUI(hObject, handles);
end

% guidata(hObject, handles);
this.handles = handles;
end

end
end

10 changes: 4 additions & 6 deletions gui/matRad_OptimizationWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
if nargin < 1
handleParent = figure(...
'Units','characters',...
'Position',[138.4 -7.38461538461539 273.4 59.5384615384615],...
'Position',[170.4 45 150.4 35.5384615384615],...
'Visible','on',...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],... 'CloseRequestFcn',@(hObject,eventdata) figure1_CloseRequestFcn(this,hObject,eventdata),...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],...
'IntegerHandle','off',...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'MenuBar','none',...
'Name','matRadGUI',...
'Name','MatRad Optimization',...
'NumberTitle','off',...
'HandleVisibility','callback',...
'Tag','figure1',...
Expand All @@ -37,9 +37,7 @@

methods
function cst = generateCstTable(handles,cst)

handles = this.handles;

cst = updateStructureTable(handles,cst);
cstPanel = handles.uipanel3;

Expand Down Expand Up @@ -235,7 +233,7 @@
sliderFac = exceedFac - 1;
uicontrol(cstPanel,'Style','slider','Units','normalized','Position',[0.975 0 0.025 1],'Min',0,'Max',ceil(sliderFac)*tableViewHeight,'SliderStep',[lineHeight tableViewHeight] ./ (ceil(sliderFac)*tableViewHeight),'Value',ceil(sliderFac)*tableViewHeight - sliderPos,'Callback',{@cstTableSlider_Callback,handles});
end

this.handles = handles;

end
Expand Down
46 changes: 14 additions & 32 deletions gui/matRad_PlanWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@

properties (Constant)
Modalities = {'photons','protons','carbon'};
% Optimizations = {'none','const_RBExD','LEMIV_effect','LEMIV_RBExD'};
end

methods
function this = matRad_PlanWidget(handleParent)
if nargin < 1
handleParent = figure(...
'Units','characters',...
'Position',[138.4 -7.38461538461539 273.4 59.5384615384615],...
'Position',[170.4 45 150.4 20.5384615384615],...
'Visible','on',...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],...
'IntegerHandle','off',...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'MenuBar','none',...
'Name','matRadGUI',...
'Name','MatRad Plan',...
'NumberTitle','off',...
'HandleVisibility','callback',...
'Tag','figure1',...
Expand Down Expand Up @@ -419,9 +418,6 @@ function changeWorkspace(obj)
ix = find(strcmp(pln.propOpt.bioOptimization,contentPopUp));
set(handles.popMenuBioOpt,'Value',ix);


%set(handles.popMenuBioOpt,'String',num2str(pln.propOpt.bioOptimization));

set(handles.btnRunSequencing,'Value',pln.propOpt.runSequencing);
set(handles.btnRunDAO,'Value',pln.propOpt.runDAO);

Expand Down Expand Up @@ -459,12 +455,10 @@ function updatePlnInWorkspace(this)
pln.propOpt.runSequencing = this.parseStringAsNum(get(handles.btnRunSequencing,'Value'),false);
pln.propOpt.runDAO = this.parseStringAsNum(get(handles.btnRunDAO,'Value'),false);

%Dose Grid resolution
pln.propDoseCalc.doseGrid.resolution.x = this.parseStringAsNum(get(handles.editDoseX,'String'),false);
pln.propDoseCalc.doseGrid.resolution.y = this.parseStringAsNum(get(handles.editDoseY,'String'),false);
pln.propDoseCalc.doseGrid.resolution.z = this.parseStringAsNum(get(handles.editDoseZ,'String'),false);



try
ct = evalin('base','ct');
pln.numOfVoxels = prod(ct.cubeDim);
Expand Down Expand Up @@ -542,8 +536,6 @@ function switchEnables(this)

case 'protons'
set(handles.popMenuBioOpt,'Enable','on');
%ix = find(strcmp(contentPopUp,'const_RBExD'));
%set(handles.popMenuBioOpt,'Value',ix);
set(handles.btnSetTissue,'Enable','on');

set(handles.btnRunSequencing,'Enable','off');
Expand All @@ -555,8 +547,6 @@ function switchEnables(this)
case 'carbon'

set(handles.popMenuBioOpt,'Enable','on');
%ix = find(strcmp(contentPopUp,'LEMIV_RBExD'));
%set(handles.popMenuBioOpt,'Value',ix);
set(handles.btnSetTissue,'Enable','on');

set(handles.btnRunSequencing,'Enable','off');
Expand All @@ -582,18 +572,20 @@ function manageRadModeSpecificDisplay(this)
end

function popupRadMode_Callback(this, hObject, eventdata)
% hObject handle to popupRadMode (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = this.handles;

% checkRadiationComposition(this); ...checkRadiationComposition(handles);
contents = cellstr(get(hObject,'String'));
RadIdentifier = contents{get(hObject,'Value')};
contentPopUp = get(handles.popMenuBioOpt,'String');

% switchcase depending on RadMode
%switchEnables(this);

switch RadIdentifier
case 'protons'
ix = find(strcmp(contentPopUp,'const_RBExD'));
set(handles.popMenuBioOpt,'Value',ix);

case 'carbon'
ix = find(strcmp(contentPopUp,'LEMIV_RBExD'));
set(handles.popMenuBioOpt,'Value',ix);
end

pln = evalin('base','pln');

Expand Down Expand Up @@ -810,21 +802,16 @@ function popMenuBioOpt_Callback(this, hObject, eventdata)
contentBioOpt = get(handles.popMenuBioOpt,'String');
NewBioOptimization = contentBioOpt(get(handles.popMenuBioOpt,'Value'),:);

%if handles.State > 0
if (strcmp(pln.propOpt.bioOptimization,'LEMIV_effect') && strcmp(NewBioOptimization,'LEMIV_RBExD')) ||...
(strcmp(pln.propOpt.bioOptimization,'LEMIV_RBExD') && strcmp(NewBioOptimization,'LEMIV_effect'))
% do nothing - re-optimization is still possible
elseif ((strcmp(pln.propOpt.bioOptimization,'const_RBE') && strcmp(NewBioOptimization,'none')) ||...
(strcmp(pln.propOpt.bioOptimization,'none') && strcmp(NewBioOptimization,'const_RBE'))) && isequal(pln.radiationMode,'protons')
% do nothing - re-optimization is still possible
else
%handles.State = 1;
end
%end
updatePlnInWorkspace(this);

%UpdateState(handles);
%guidata(hObject,handles);
this.handles = handles;
end

Expand All @@ -850,26 +837,21 @@ function getMachines(this)
end
for j = 1:length(Files)
if ~isempty(Files)
% Fehlermeldung wegen empty this.Machines
MachineName = Files(j).name(numel(this.Modalities{1,i})+2:end-4);
this.Machines{i}{j} = MachineName;
end
end
end

%set handles
selectedRadMod = get(handles.popupRadMode,'Value');

nMachines = numel(this.Machines{selectedRadMod});

selectedMachine = get(handles.popUpMachine,'Value');

if get(handles.popUpMachine,'Value') > nMachines
selectedMachine = 1;
end

set(handles.popUpMachine,'Value',selectedMachine,'String',this.Machines{selectedRadMod});

this.handles = handles;
end

Expand Down
8 changes: 3 additions & 5 deletions gui/matRad_StructureVisibilityWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
if nargin < 1
handleParent = figure(...
'Units','characters',...
'Position',[138.4 -7.38461538461539 273.4 59.5384615384615],...
'Position',[250.4 45 90.4 50.5384615384615],...
'Visible','on',...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],... 'CloseRequestFcn',@(hObject,eventdata) figure1_CloseRequestFcn(this,hObject,eventdata),...
'Color',[0.501960784313725 0.501960784313725 0.501960784313725],...
'IntegerHandle','off',...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'MenuBar','none',...
'Name','matRadGUI',...
'Name','MatRad Structure Visibility',...
'NumberTitle','off',...
'HandleVisibility','callback',...
'Tag','figure1',...
Expand Down Expand Up @@ -75,8 +75,6 @@ function legendTable_Callback(this, hObject, event)

% update cst in workspace accordingly
assignin('base','cst',cst)

% guidata(hObject, handles);
this.handles = handles;
UpdatePlot(handles)
end
Expand Down
Loading

0 comments on commit 986dbb6

Please sign in to comment.