Skip to content

Commit

Permalink
plotSlice function modification to include display ct option and make…
Browse files Browse the repository at this point in the history
… dose an optional variable. plotSliceWrapper modified to deprecated function and calling plotSlice instead.
  • Loading branch information
SimonaFa committed Feb 14, 2025
1 parent a1163e1 commit 4d6d96e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions matRad/util/matRad_plotSlice.m
Original file line number Diff line number Diff line change
@@ -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
%
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion matRad/util/matRad_plotSliceWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -171,6 +178,6 @@
if ~isempty(colorBarLabel)
set(get(hCMap,'YLabel'),'String', colorBarLabel,'FontSize',matRad_cfg.gui.fontSize);
end

%}
end

0 comments on commit 4d6d96e

Please sign in to comment.