matRad_plotAxisLabels

Purpose ^

matRad function to plot x and y labels denoting the ct dimensions

Synopsis ^

function matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize,tickdist)

Description ^

 matRad function to plot x and y labels denoting the ct dimensions 
 according to the selected plane

 call
   matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize)
   matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize,
   tickdist)

 input
   axesHandle         handle to axes the slice should be displayed in
   ct                 matRad ct structure
   plane              plane view (coronal=1,sagittal=2,axial=3)
   slice              slice in the selected plane of the 3D cube
   defaultFontSize    default font size as double value

 output
   -

 References
   -

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

 Copyright 2017 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  matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize,tickdist)
0002 % matRad function to plot x and y labels denoting the ct dimensions
0003 % according to the selected plane
0004 %
0005 % call
0006 %   matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize)
0007 %   matRad_plotAxisLabels(axesHandle,ct,plane,slice,defaultFontSize,
0008 %   tickdist)
0009 %
0010 % input
0011 %   axesHandle         handle to axes the slice should be displayed in
0012 %   ct                 matRad ct structure
0013 %   plane              plane view (coronal=1,sagittal=2,axial=3)
0014 %   slice              slice in the selected plane of the 3D cube
0015 %   defaultFontSize    default font size as double value
0016 %
0017 % output
0018 %   -
0019 %
0020 % References
0021 %   -
0022 %
0023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 %
0025 % Copyright 2017 the matRad development team.
0026 %
0027 % This file is part of the matRad project. It is subject to the license
0028 % terms in the LICENSE file found in the top-level directory of this
0029 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0030 % of the matRad project, including this file, may be copied, modified,
0031 % propagated, or distributed except according to the terms contained in the
0032 % LICENSE file.
0033 %
0034 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0035 
0036 if ~exist('defaultFontSize','var') || isempty(defaultFontSize)
0037     defaultFontSize = 12;
0038 end
0039 
0040 if ~exist('tickdist','var') || isempty(tickdist)
0041     tickdist = 50;
0042 end
0043 %% Set axis labels and plot iso center
0044 if  plane == 3% Axial plane
0045     if ~isempty(ct.resolution.x) && ~isempty(ct.resolution.y)
0046         set(axesHandle,'XTick',0:tickdist/ct.resolution.x:1000);
0047         set(axesHandle,'YTick',0:tickdist/ct.resolution.y:1000);
0048         set(axesHandle,'XTickLabel',0:tickdist:1000*ct.resolution.x);
0049         set(axesHandle,'YTickLabel',0:tickdist:1000*ct.resolution.y);   
0050         xlabel(axesHandle,'x [mm]','FontSize',defaultFontSize)
0051         ylabel(axesHandle,'y [mm]','FontSize',defaultFontSize)
0052         title(axesHandle,['axial plane z = ' num2str(ct.resolution.z*slice) ' [mm]'],'FontSize',defaultFontSize)
0053     else
0054         xlabel(axesHandle,'x [voxels]','FontSize',defaultFontSize)
0055         ylabel(axesHandle,'y [voxels]','FontSize',defaultFontSize)
0056         title(axesHandle,'axial plane','FontSize',defaultFontSize)
0057     end
0058 elseif plane == 2 % Sagittal plane
0059     if ~isempty(ct.resolution.y) && ~isempty(ct.resolution.z)
0060         set(axesHandle,'XTick',0:tickdist/ct.resolution.z:1000)
0061         set(axesHandle,'YTick',0:tickdist/ct.resolution.y:1000)
0062         set(axesHandle,'XTickLabel',0:tickdist:1000*ct.resolution.z)
0063         set(axesHandle,'YTickLabel',0:tickdist:1000*ct.resolution.y)
0064         xlabel(axesHandle,'z [mm]','FontSize',defaultFontSize);
0065         ylabel(axesHandle,'y [mm]','FontSize',defaultFontSize);
0066         title(axesHandle,['sagittal plane x = ' num2str(ct.resolution.y*slice) ' [mm]'],'FontSize',defaultFontSize)
0067     else
0068         xlabel(axesHandle,'z [voxels]','FontSize',defaultFontSize)
0069         ylabel(axesHandle,'y [voxels]','FontSize',defaultFontSize)
0070         title(axesHandle,'sagittal plane','FontSize',defaultFontSize);
0071     end
0072 elseif plane == 1 % Coronal plane
0073     if ~isempty(ct.resolution.x) && ~isempty(ct.resolution.z)
0074         set(axesHandle,'XTick',0:tickdist/ct.resolution.z:1000)
0075         set(axesHandle,'YTick',0:tickdist/ct.resolution.x:1000)
0076         set(axesHandle,'XTickLabel',0:tickdist:1000*ct.resolution.z)
0077         set(axesHandle,'YTickLabel',0:tickdist:1000*ct.resolution.x)
0078         xlabel(axesHandle,'z [mm]','FontSize',defaultFontSize)
0079         ylabel(axesHandle,'x [mm]','FontSize',defaultFontSize)
0080         title(axesHandle,['coronal plane y = ' num2str(ct.resolution.x*slice) ' [mm]'],'FontSize',defaultFontSize)
0081     else
0082         xlabel(axesHandle,'z [voxels]','FontSize',defaultFontSize)
0083         ylabel(axesHandle,'x [voxels]','FontSize',defaultFontSize)
0084         title(axesHandle,'coronal plane','FontSize',defaultFontSize)
0085     end
0086 end
0087 
0088 end
0089

| Generated by m2html © 2005