Skip to content

Commit

Permalink
Merge branch 'dev_classGUI' into dev_classGUI_a
Browse files Browse the repository at this point in the history
  • Loading branch information
amitantony authored Jan 4, 2023
2 parents 8c9f8ee + 671baea commit ecc6e0c
Show file tree
Hide file tree
Showing 26 changed files with 218 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a basic workflow to help you get started with Actions
name: Testing
name: Tests
# Controls when the action will run.
on: [push, pull_request, workflow_dispatch]
jobs:
Expand Down
123 changes: 123 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
cff-version: 1.2.0
message: "If you use matRad, consider citing it and the corresponding research paper"
authors:
- family-names: "Ackermann"
given-names: "Benjamin"
- family-names: "Bangert"
given-names: "Mark"
- family-names: "Bennan"
given-names: "Amit Ben Antony"
- family-names: "Burigo"
given-names: "Lucas"
- family-names: "Cabal"
given-names: "Gonzalo"
- family-names: "Cisternas"
given-names: "Eduardo"
- family-names: "Charton"
given-names: "Louis"
- family-names: "Christiansen"
given-names: "Eric"
- family-names: "Ecker"
given-names: "Swantje"
- family-names: "Ellerbrock"
given-names: "Malte"
- family-names: "Gabryś"
given-names: "Hubert"
- family-names: "Handrack"
given-names: "Josefine"
- family-names: "Heath"
given-names: "Emily"
- family-names: "Hermann"
given-names: "Cindy"
- family-names: "Homolka"
given-names: "Noa"
- family-names: "Jäkel"
given-names: "Oliver"
- family-names: "Klinge"
given-names: "Thomas"
- family-names: "Mairani"
given-names: "Andrea"
- family-names: "Mescher"
given-names: "Hennig"
- family-names: "Müller"
given-names: "Lucas-Raphael"
- family-names: "Neishabouri"
given-names: "Ahmad"
- family-names: "Palkowitsch"
given-names: "Martina"
- family-names: "Parodi"
given-names: "Katia"
- family-names: "Pezzano"
given-names: "Giuseppe"
- family-names: "Ramirez"
given-names: "Daniel"
- family-names: "Stadler"
given-names: "Alexander"
- family-names: "Ulrich"
given-names: "Silke"
- family-names: "Wahl"
given-names: "Niklas"
orcid: "https://orcid.org/0000-0002-1451-223X"
- family-names: "Welsch"
given-names: "Jona"
- family-names: "Wieser"
given-names: "Hans-Peter"
- family-names: "Winter"
given-names: "Johanna"
- family-names: "Xu"
given-names: "Tong"

title: "matRad"
version: 2.10.1
doi: 10.5281/zenodo.3879616
date-released: 2020-06-05
url: "http://www.matRad.org"
location: "Heidelberg"
organization: "Deutsches Krebsforschungszentrum"
preferred-citation:
type: article
authors:
- family-names: "Wieser"
given-names: "Hans-Peter"
- family-names: "Cisternas"
given-names: "Eduardo"
- family-names: "Wahl"
given-names: "Niklas"
orcid: "https://orcid.org/0000-0002-1451-223X"
- family-names: "Ulrich"
given-names: "Silke"
- family-names: "Stadler"
given-names: "Alexander"
- family-names: "Mescher"
given-names: "Hennig"
- family-names: "Müller"
given-names: "Lucas-Raphael"
- family-names: "Klinge"
given-names: "Thomas"
- family-names: "Gabryś"
given-names: "Hubert"
- family-names: "Burigo"
given-names: "Lucas"
- family-names: "Mairani"
given-names: "Andrea"
- family-names: "Ecker"
given-names: "Swantje"
- family-names: "Ackermann"
given-names: "Benjamin"
- family-names: "Ellerbrock"
given-names: "Malte"
- family-names: "Parodi"
given-names: "Katia"
- family-names: "Jäkel"
given-names: "Oliver"
- family-names: "Bangert"
given-names: "Mark"

doi: 10.1002/mp.12251
journal: "Medical Physics"
start: 2556
end: 2568
title: "Development of the open-source dose calculation and optimization toolkit matRad"
issue: 6
volume: 46
year: 2017
23 changes: 19 additions & 4 deletions MatRad_Config.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@
% Therefore its constructor is private
% For instantiation, use the static MatRad_Config.instance();

obj.matRadRoot = fileparts(mfilename('fullpath'));
obj.matRadRoot = fileparts(mfilename('fullpath'))
addpath(genpath(obj.matRadRoot));

%Set Version
obj.getEnvironment();
obj.matRad_version = matRad_version();
obj.matRad_version = matRad_version();

%Configure Environment
obj.configureEnvironment();

%Just to catch people messing with the properties in the file
if ~isempty(obj.writeLog) && obj.writeLog
Expand Down Expand Up @@ -186,6 +189,9 @@ function setDefaultProperties(obj)
obj.propMC.direct_defaultHistories = 2e4;

obj.disableGUI = false;

obj.devMode = false;
obj.eduMode = false;
end

%%For testing
Expand Down Expand Up @@ -221,6 +227,7 @@ function setDefaultPropertiesForTesting(obj)
obj.propMC.direct_defaultHistories = 100;

obj.disableGUI = true;

obj.devMode = true;
obj.eduMode = false;
end
Expand Down Expand Up @@ -252,8 +259,9 @@ function setDefaultPropertiesForEduMode(obj)

obj.devMode = false;
obj.eduMode = true;
end

end

function setDefaultGUIProperties(obj)
obj.gui.backgroundColor = [0.5 0.5 0.5];
obj.gui.elementColor = [0.75 0.75 0.75];
Expand All @@ -263,7 +271,7 @@ function setDefaultGUIProperties(obj)
obj.gui.fontWeight = 'bold';
obj.gui.fontName = 'Helvetica';
end

function dispDebug(obj,formatSpec,varargin)
%dispDebug print debug messages (log level >= 4)
% input
Expand Down Expand Up @@ -353,6 +361,13 @@ function getEnvironment(obj)

end
end

function configureEnvironment(obj)
if obj.isOctave
struct_levels_to_print(0); %Disables full printing of struct array fields
warning("off","Octave:data-file-in-path"); %Disables warning of loading patients from the data folder
end
end
end

methods(Static)
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![Contributors](https://img.shields.io/github/contributors/e0404/matRad)](https://github.com/e0404/matRad/graphs/contributors)
[![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/e0404/matRad/master)

[![TravisCI Build Status](https://travis-ci.org/e0404/matRad.svg?branch=dev)](https://travis-ci.org/e0404/matRad)
[![Azure Pipelines Build Status](https://dev.azure.com/e0404/matRad/_apis/build/status/e0404.matRad?branchName=dev)](https://dev.azure.com/e0404/matRad)
[![GitHub Build Status](https://github.com/e0404/matRad/actions/workflows/tests.yml/badge.svg)](https://github.com/e0404/matRad/actions/workflows/tests.yml)
[![Azure Pipelines Build Status](https://dev.azure.com/e0404/matRad/_apis/build/status/e0404.matRad)](https://dev.azure.com/e0404/matRad)

DOIs:
- General DOI: [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.3879615.svg)](https://doi.org/10.5281/zenodo.3879615)
Expand Down Expand Up @@ -104,9 +104,16 @@ You can cite specific versions of matRad in your work! For example, Here is the

[![DOI](https://zenodo.org/badge/29671667.svg)](https://zenodo.org/badge/latestdoi/29671667)

# Funding Sources
matRad developments (on this branch) were (in parts) funded by:
- Grant No. BA 2279/3-1 (Project No. 265744405) from the German Research Foundation (DFG)
- Grant No. 70113094 from the German Cancer Aid
- Grant No. WA 4707/1-1 (Project No. 443188743) from the German Research Foundation (DFG)
- Mathworks Academic Research Support

---

Copyright 2020 the matRad development team.
Copyright 2022 the matRad development team.

[email protected]

Expand Down
6 changes: 2 additions & 4 deletions dicom/matRad_importDicom.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,8 @@
if ~(cellfun(@isempty,files.rtdose(1,1:2)))
fprintf('loading Dose files \n', structures(i).structName);
% parse plan in order to scale dose cubes to a fraction based dose
if exist('pln','var')
if isfield(pln,'numOfFractions')
resultGUI = matRad_importDicomRTDose(ct, files.rtdose, pln);
end
if exist('pln','var') && ~isempty(pln) && isfield(pln,'numOfFractions')
resultGUI = matRad_importDicomRTDose(ct, files.rtdose, pln);
else
resultGUI = matRad_importDicomRTDose(ct, files.rtdose);
end
Expand Down
7 changes: 7 additions & 0 deletions gui/matRad_MainGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ViewingWidget
DVHStatsWidget
GammaWidget

eventListeners

matRad_cfg = MatRad_Config.instance();
Expand All @@ -31,7 +32,9 @@
folder = fileparts(mfilename('fullpath'));
loadIcons = load(fullfile(folder,'matRad_iconsGUI.mat'),'icons');
icons = loadIcons.icons;

icons{end+1} = imread('icons8-gamma-16.png');

h60 = uitoolbar(...
'Parent',h1,...
'Tag','uitoolbar1');
Expand Down Expand Up @@ -113,6 +116,7 @@
'ClickedCallback',@(hObject, eventdata)uitoggletool8_ClickedCallback(this, hObject, eventdata),...
'Separator','on',...
'TooltipString','Insert Colorbar' );

h70 = uipushtool(...
'Parent',h60,...
'BusyAction','cancel',...
Expand All @@ -122,6 +126,7 @@
'ClickedCallback',@(hObject,eventdata)gammaWidget_ClickedCallback(this,hObject,eventdata),...
'Separator','on',...
'TooltipString','Gamma index tool' );


end
end
Expand Down Expand Up @@ -497,10 +502,12 @@ function toolbarLegend_ClickedCallback(this,hObject, eventdata)
%set(this.ViewingWidget.legendHandle,'visible',get(hObject,'State'));
end


function gammaWidget_ClickedCallback(this,hObject,eventdata)
this.GammaWidget = matRad_GammaWidget();
end


function toolbarZoomIn_ClickedCallback(this,hObject, eventdata)
set(this.ViewingWidget.zoomHandle,'Enable',char(get(hObject,'State')));
set(this.ViewingWidget.zoomHandle,'Direction','in');
Expand Down
2 changes: 2 additions & 0 deletions gui/matRad_Widget.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
classdef matRad_Widget < handle

% matRad_Widget Main Class for GUI widget generation
% Describes a standard fluence optimization problem by providing the
% implementation of the objective & constraint function/gradient wrappers
Expand All @@ -20,6 +21,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


properties (GetAccess = public , SetAccess = protected)
widgetHandle %Holds parent widget handle
Expand Down
2 changes: 2 additions & 0 deletions gui/widgets/matRad_3DWidget.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
classdef matRad_3DWidget < matRad_ViewingWidget

% matRad_3DWidget class to generate GUI widget for 3D plan visualization
% Describes a standard fluence optimization problem by providing the
% implementation of the objective & constraint function/gradient wrappers
Expand All @@ -20,6 +21,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

properties
viewingWidgetHandle;
end
Expand Down
5 changes: 2 additions & 3 deletions gui/widgets/matRad_DVHStatsWidget.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
classdef matRad_DVHStatsWidget < matRad_Widget

% matRad_DVHStatsWidget class to generate GUI widget display DVH and
% stats
% Describes a standard fluence optimization problem by providing the
Expand Down Expand Up @@ -34,6 +35,7 @@

matRad_cfg = MatRad_Config.instance();
if nargin<2 %isempty(p.Results.handleParent)

handleParent = figure(...
'Units','normalized',...
'Position',[0.005 0.05 0.495 0.9],...
Expand Down Expand Up @@ -125,13 +127,10 @@ function removeOverlap(this)

this.dvhWidgetHandle = matRad_DVHWidget([],p1);
this.statWidgetHandle = matRad_StatisticsWidget([],p2);

this.createHandles();

end



end
end

2 changes: 2 additions & 0 deletions gui/widgets/matRad_DVHWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
end

function this=update(this,evt)

if this.lockUpdate
doUpdate = true;
if nargin == 2
Expand Down Expand Up @@ -87,6 +88,7 @@ function removeOverlap(this)
end

methods

function set.SelectedCube(this,value)
this.SelectedCube=value;
end
Expand Down
1 change: 1 addition & 0 deletions gui/widgets/matRad_InfoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

properties

end
Expand Down
1 change: 1 addition & 0 deletions gui/widgets/matRad_LogoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

properties
end

Expand Down
1 change: 1 addition & 0 deletions gui/widgets/matRad_OptimizationWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

properties
end

Expand Down
Loading

0 comments on commit ecc6e0c

Please sign in to comment.