diff --git a/matRad/util/matRad_plotSlice.m b/matRad/util/matRad_plotSlice.m index a704d88dd..676636c73 100644 --- a/matRad/util/matRad_plotSlice.m +++ b/matRad/util/matRad_plotSlice.m @@ -1,4 +1,4 @@ -function [] = matRad_plotSlice(ct, varargin) +function [hCMap,hDose,hCt,hContour,hIsoDose] = matRad_plotSlice(ct, varargin) % matRad tool function to directly plot a complete slice of a ct with dose % optionally including contours and isolines % @@ -68,14 +68,14 @@ isCubeIdx = @(x) isscalar(x); isPlane = @(x) isscalar(x) && (sum(x==[1, 2, 3])==1); isDoseWindow = @(x) (length(x) == 2 && isvector(x)); -isThresh = @(x) isscalar(x) && (x>=0) && (x<=1); -isAlpha = @(x) isscalar(x) && (x>=0) && (x<=1); +isThresh = @(x) (isscalar(x) && (x>=0) && (x<=1)) || isempty(x); +isAlpha = @(x) isscalar(x) && (x>=0) && (x<=1) || isempty(x); isDoseColorMap = @(x) isnumeric(x) && (size(x, 2)==3) && all(x(:) >= 0) && all(x(:) <= 1); -isDoseIsoLevels = @(x) isnumeric(x) && isvector(x); -isVOIselection = @(x) all(x(:)==1 | x(:)==0); +isDoseIsoLevels = @(x) isnumeric(x) && isvector(x)|| isempty(x); +isVOIselection = @(x) isnumeric(x) || isempty(x); %all(x(:)==1 | x(:)==0) || isempty(x); isContourColorMap = @(x) isnumeric(x) && (size(x, 2)==3) && size(x, 1)>=2 && all(x(:) >= 0) && all(x(:) <= 1); isBoolPlotLegend = @(x) x==0 || x ==1; -isColorBarLabel = @(x) isstring(x) || ischar(x); +isColorBarLabel = @(x) isstring(x) || ischar(x) || isempty(x); isShowCt = @(x) isscalar(x) && (x==0) || (x==1); p = inputParser; diff --git a/matRad/util/matRad_plotSliceWrapper.m b/matRad/util/matRad_plotSliceWrapper.m index bcc7d9436..f56d2bac6 100644 --- a/matRad/util/matRad_plotSliceWrapper.m +++ b/matRad/util/matRad_plotSliceWrapper.m @@ -63,6 +63,8 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +warning('Deprecation warning: matRad_plotSliceWrapper is deprecated. Using matRad_plot_Slice instead'); + % Handle the argument list if ~exist('thresh','var') || isempty(thresh) thresh = []; @@ -101,6 +103,11 @@ matRad_cfg = MatRad_Config.instance(); +warning('Deprecation warning: matRad_plotSliceWrapper is deprecated. Using matRad_plot_Slice instead'); + +[hCMap,hDose,hCt,hContour,hIsoDose] = matRad_plotSlice(ct, 'axesHandle', axesHandle, 'cst', cst, 'cubeIdx', cubeIdx, 'dose', dose, 'plane', plane, 'slice', slice,'thresh', thresh, 'alpha', alpha, 'contourColorMap', contourColorMap, 'doseColorMap', doseColorMap, 'doseWindow', doseWindow, 'doseIsoLevels', doseIsoLevels, 'voiSelection', voiSelection, 'colorBarLabel', colorBarLabel, 'boolPlotLegend', boolPlotLegend, 'others', varargin); + +%{ set(axesHandle,'YDir','Reverse'); % plot ct slice hCt = matRad_plotCtSlice(axesHandle,ct.cubeHU,cubeIdx,plane,slice); @@ -171,6 +178,6 @@ if ~isempty(colorBarLabel) set(get(hCMap,'YLabel'),'String', colorBarLabel,'FontSize',matRad_cfg.gui.fontSize); end - +%} end