matRad function wrapper for plotting the colorbar This is necessary since the rgb colors are manually mapped within the ct and the dose plotting, and MATLAB attaches colorbars to axes. call cBarHandle = matRad_plotColorbar(axesHandle,cMap,window,varargin) input axesHandle handle to axes the colorbar will be attached to cMap corresponding colormap window colormap window (corresponds to clim) varargin additional key-value pairs that will be forwarded to the MATLAB colorbar(__) call output cBarHandle handle of the colorbar object 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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function cBarHandle = matRad_plotColorbar(axesHandle,cMap,window,varargin) 0002 % matRad function wrapper for plotting the colorbar 0003 % This is necessary since the rgb colors are manually mapped within the ct 0004 % and the dose plotting, and MATLAB attaches colorbars to axes. 0005 % 0006 % call 0007 % cBarHandle = matRad_plotColorbar(axesHandle,cMap,window,varargin) 0008 % 0009 % input 0010 % axesHandle handle to axes the colorbar will be attached to 0011 % cMap corresponding colormap 0012 % window colormap window (corresponds to clim) 0013 % varargin additional key-value pairs that will be forwarded to the 0014 % MATLAB colorbar(__) call 0015 % 0016 % output 0017 % cBarHandle handle of the colorbar object 0018 % 0019 % References 0020 % - 0021 % 0022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 % 0024 % Copyright 2015 the matRad development team. 0025 % 0026 % This file is part of the matRad project. It is subject to the license 0027 % terms in the LICENSE file found in the top-level directory of this 0028 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0029 % of the matRad project, including this file, may be copied, modified, 0030 % propagated, or distributed except according to the terms contained in the 0031 % LICENSE file. 0032 % 0033 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0034 0035 v=version; 0036 0037 colormap(axesHandle,cMap); 0038 caxis(window); 0039 0040 if str2double(v(1:3))>=8.5 0041 cBarHandle = colorbar(axesHandle,varargin{:}); 0042 else 0043 cBarHandle = colorbar('peer',axesHandle,varargin{:}); 0044 end 0045 0046 0047 0048 0049 0050 end 0051