Skip to content

Commit

Permalink
Merge branch 'dev_classGUI' of https://github.com/e0404/matRad into p…
Browse files Browse the repository at this point in the history
…r/652

# Conflicts:
#	dicom/matRad_importDicomRTPlan.m
#	dicom/matRad_scanDicomImportFolder.m
#	gui/widgets/matRad_OptimizationWidget.m
#	gui/widgets/matRad_PlanWidget.m
#	matRad.m
  • Loading branch information
wahln committed Aug 31, 2023
2 parents fe7fe40 + 51734ac commit 0040374
Show file tree
Hide file tree
Showing 36 changed files with 477 additions and 476 deletions.
5 changes: 1 addition & 4 deletions dicom/@matRad_DicomExporter/matRad_exportDicomRTDoses.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
matRad_cfg = MatRad_Config.instance();
matRad_cfg.dispInfo('Exporting DICOM RTDose...\n');

env = matRad_getEnvironment();
isOctave = strcmp(env,'OCTAVE');

if isOctave
if matRad_cfg.isOctave
matRad_cfg.dispWarning('RTDose export currently not supported by matRad running in Octave using the dicom package! Skipping...');
return;
end
Expand Down
9 changes: 3 additions & 6 deletions dicom/@matRad_DicomExporter/matRad_exportDicomRTStruct.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
matRad_cfg = MatRad_Config.instance();
matRad_cfg.dispInfo('Exporting DICOM RTStruct...\n');

env = matRad_getEnvironment();
isOctave = strcmp(env,'OCTAVE');

if isOctave
if matRad_cfg.isOctave
matRad_cfg.dispWarning('RTStruct export currently not supported by matRad running in Octave due to crashing dicomwrite! Skipping...');
return;
end
Expand Down Expand Up @@ -158,7 +155,7 @@
meta.StructureSetROISequence.(['Item_' num2str(i)]) = ROISequenceItem;

%Contour Sequence
if ~isOctave
if ~ matRad_cfg.isOctave
ROIContourSequenceItem.ROIDisplayColor = int32(round(255 * obj.cst{i,5}.visibleColor));
end

Expand Down Expand Up @@ -251,7 +248,7 @@
filename = fullfile(filepath,filename);


if isOctave
if matRad_cfg.isOctave
dicomwrite(int16(zeros(2)),filename,meta);
else
obj.rtssExportStatus = dicomwrite([],filename,meta,'CreateMode','copy');%,'TransferSyntax',TransferSyntaxUID);
Expand Down
6 changes: 2 additions & 4 deletions dicom/matRad_importDicom.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[env, ~] = matRad_getEnvironment();

matRad_cfg = MatRad_Config.instance();

%%
if ~exist('dicomMetaBool','var')
Expand All @@ -55,7 +53,7 @@
resolution.z = files.resz; % [mm] / lps coordinate system
if files.useDoseGrid && isfield(files,'rtdose')
% get grid from dose cube
if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
doseInfo = dicominfo(files.rtdose{1,1});
else
doseInfo = dicominfo(files.rtdose{1,1},'UseDictionaryVR',true);
Expand Down
10 changes: 3 additions & 7 deletions dicom/matRad_importDicomCt.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
visBool = 0;
end

env = matRad_getEnvironment();

matRad_checkEnvDicomRequirements(env);

isOctave = strcmp(env,'OCTAVE');
matRad_checkEnvDicomRequirements(matRad_cfg.env);


% creation of ctInfo list
Expand All @@ -59,7 +55,7 @@
sliceThicknessStandard = true;
for i = 1:numOfSlices

if isOctave ||verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
tmpDicomInfo = dicominfo(ctList{i,1});
else
tmpDicomInfo = dicominfo(ctList{i,1},'UseDictionaryVR',true);
Expand Down Expand Up @@ -149,7 +145,7 @@
origCt = zeros(ctInfo(1).Height, ctInfo(1).Width, numOfSlices);
for i = 1:numOfSlices
currentFilename = ctList{i};
if isOctave
if matRad_cfg.isOctave
currentImage = dicomread(currentFilename);
map = [];
else
Expand Down
3 changes: 2 additions & 1 deletion dicom/matRad_importDicomRTPlan.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

matRad_cfg = MatRad_Config.instance();
matRad_checkEnvDicomRequirements(matRad_cfg.env);

%% load plan file
% check size of RT Plan
Expand All @@ -38,7 +39,7 @@
end

% read information out of the RT file
if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
planInfo = dicominfo(rtPlanFiles{1});
else
planInfo = dicominfo(rtPlanFiles{1},'UseDictionaryVR',true);
Expand Down
7 changes: 3 additions & 4 deletions dicom/matRad_importDicomRtss.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@
visBool = 0;
end
matRad_cfg = MatRad_Config.instance();
env = matRad_getEnvironment();
matRad_checkEnvDicomRequirements(env);
isOctave = strcmp(env,'OCTAVE');
matRad_checkEnvDicomRequirements(matRad_cfg.env);



% read dicom info (this includes already all data for the rtss)
if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
structInfo = dicominfo(filename);
else % apply 'UseVRHeuristic' option when available to use a to help read certain
% noncompliant files which switch value representation (VR) modes incorrectly
Expand Down
7 changes: 3 additions & 4 deletions dicom/matRad_importDicomSteeringParticles.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
%% load plan file
% load machine data

env = matRad_getEnvironment();
matRad_checkEnvDicomRequirements(env);
isOctave = strcmp(env,'OCTAVE');
matRad_cfg = MatRad_Config.instance();
matRad_checkEnvDicomRequirements(matRad_cfg.env);

dlgBaseDataText = ['Import steering information from DICOM Plan.','Choose corresponding matRad base data for ', ...
pln.radiationMode, '.'];
Expand All @@ -55,7 +54,7 @@
pln.machine = fileName(ix(1)+1:end-4);

% RT Plan consists only on meta information
if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
rtPlanInfo = dicominfo(rtPlanFile{1});
else
rtPlanInfo = dicominfo(rtPlanFile{1},'UseDictionaryVR',true);
Expand Down
8 changes: 4 additions & 4 deletions dicom/matRad_interpDicomDoseCube.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

% read information out of the RT file

env = matRad_getEnvironment();
matRad_checkEnvDicomRequirements(env);
isOctave = strcmp(env,'OCTAVE');
matRad_cfg = matRad_Config.instance();
matRad_checkEnvDicomRequirements(matRad_cfg.env);


dosefile = currDose{1};

if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
doseInfo = dicominfo(dosefile);
else
doseInfo = dicominfo(dosefile,'UseDictionaryVR',true);
Expand Down
6 changes: 2 additions & 4 deletions dicom/matRad_scanDicomImportFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
%% get all files in search directory

% dicom import needs image processing toolbox -> check if available

available = matRad_checkEnvDicomRequirements();
isOctave = strcmp(matRad_cfg.env,'OCTAVE');
available = matRad_checkEnvDicomRequirements(matRad_cfg.env);

if ~available
matRad_cfg.dispError('Image processing toolbox / packages not available!');
Expand All @@ -61,7 +59,7 @@
for i = numOfFiles:-1:1
waitbar((numOfFiles+1-i) / steps)
try % try to get DicomInfo
if isOctave || verLessThan('matlab','9')
if matRad_cfg.isOctave || verLessThan('matlab','9')
info = dicominfo(fileList{i});
else
info = dicominfo(fileList{i},'UseDictionaryVR',true);
Expand Down
16 changes: 15 additions & 1 deletion gui/matRad_InfoWidget_uiwrapper.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
classdef matRad_InfoWidget_uiwrapper < matRad_Widget

% Class that defines and deploys the infoWidget to display matRad information
%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2019 the matRad development team.
%
% This file is part of the matRad project. It is subject to the license
% terms in the LICENSE file found in the top-level directory of this
% distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
% of the matRad project, including this file, may be copied, modified,
% propagated, or distributed except according to the terms contained in the
% LICENSE file.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
properties

end
Expand Down
Loading

0 comments on commit 0040374

Please sign in to comment.