matRad_plotVois3D

Purpose ^

matRad function that plots 3D structures of the volumes of interest

Synopsis ^

function patches = matRad_plotVois3D(axesHandle,ct,cst,selection,cMap)

Description ^

 matRad function that plots 3D structures of the volumes of interest
 If the 3D-data is not stored in the CT, it will be commputed on the fly.

 call
   patches = matRad_plotVois3D(axesHandle,ct,cst,selection)
   patches = matRad_plotVois3D(axesHandle,ct,cst,selection,cMap)

 input
   axesHandle  handle to axes the structures should be displayed in
   ct          matRad ct struct which contains resolution
   cst         matRad cst struct
   selection   logicals defining the current selection of contours
               that should be plotted. Can be set to [] to plot
               all non-ignored contours.
   cMap        optional argument defining the colormap, default are the
               colors stored in the cst

 output
   patches     patch objects created by the matlab 3D visualization

 References
   -

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Copyright 2015 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.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function patches = matRad_plotVois3D(axesHandle,ct,cst,selection,cMap)
0002 % matRad function that plots 3D structures of the volumes of interest
0003 % If the 3D-data is not stored in the CT, it will be commputed on the fly.
0004 %
0005 % call
0006 %   patches = matRad_plotVois3D(axesHandle,ct,cst,selection)
0007 %   patches = matRad_plotVois3D(axesHandle,ct,cst,selection,cMap)
0008 %
0009 % input
0010 %   axesHandle  handle to axes the structures should be displayed in
0011 %   ct          matRad ct struct which contains resolution
0012 %   cst         matRad cst struct
0013 %   selection   logicals defining the current selection of contours
0014 %               that should be plotted. Can be set to [] to plot
0015 %               all non-ignored contours.
0016 %   cMap        optional argument defining the colormap, default are the
0017 %               colors stored in the cst
0018 %
0019 % output
0020 %   patches     patch objects created by the matlab 3D visualization
0021 %
0022 % References
0023 %   -
0024 %
0025 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0026 %
0027 % Copyright 2015 the matRad development team.
0028 %
0029 % This file is part of the matRad project. It is subject to the license
0030 % terms in the LICENSE file found in the top-level directory of this
0031 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0032 % of the matRad project, including this file, may be copied, modified,
0033 % propagated, or distributed except according to the terms contained in the
0034 % LICENSE file.
0035 %
0036 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0037 
0038 if size(cst,2) < 8
0039     cst = matRad_computeAllVoiSurfaces(ct,cst);
0040 end
0041 
0042 %Use stored colors or colormap?
0043 if nargin < 5 || isempty(cMap)
0044     cMapScale = size(cMap,1)-1;
0045     %determine colors
0046     voiColors = cMap(round(linspace(1,cMapScale,size(cst,1))),:);
0047 else
0048     for i = 1:size(cst,1)
0049       voiColors(i,:) = cst{i,5}.visibleColor;
0050     end
0051 end
0052 
0053 if nargin < 4 || isempty(selection) || numel(selection) ~= size(cst,1)
0054     selection = logical(ones(size(cst,1),1));
0055 end
0056 
0057 cMapScale = size(cMap,1)-1;
0058 
0059 axes(axesHandle);
0060 wasHold = ishold();
0061 
0062 hold(axesHandle,'on');
0063 
0064 numVois = size(cst,1);
0065 
0066 patches = cell(0);
0067 
0068 for voiIx = 1:numVois
0069     if selection(voiIx) && ~strcmp(cst{voiIx,3},'IGNORED')
0070         patches{voiIx} = patch(cst{voiIx,8}{1},'VertexNormals',cst{voiIx,8}{2},'FaceColor',voiColors(voiIx,:),'EdgeColor','none','FaceAlpha',0.4,'Parent',axesHandle);
0071     end
0072 end
0073 
0074 if ~wasHold
0075     hold(axesHandle,'off');
0076 end
0077 
0078 
0079 end

| Generated by m2html © 2005