plotting
Visualization and plotting functions for treatment plans and dose distributions.
- matRad_shadowPlot(x, yLow, yUp, color, legendName, alphaTrans)
shadowPlot to plot confidence bands mainly
call
shadowPlot(x, yLow, yUp, color, legendName, alphaTrans)
- Input:
x – x axis values
yLow – lower bound (start of shadowing)
yUp – upper bound (end of shadowing)
color – color as [R G B]
legendName – legendname to be shown in the plot
alphaTrans – transparency
- Output:
axesHandle
Copyright 2017-2026 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/LICENSE.md. 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.
- matRad_getColormap(name, size)
matRad function wrapper for getting a colormap We use this wrapper to manually handle the supported colormaps enabling the definition of custom colormaps.
call
cMap = matRad_getColormap(name,size) list = matRad_getColormap()
- Input:
name name of the colorbar
size optional argument for the size / resolution of the colorbar
if no argument is passed, a list (cell array)
supported colormaps will be returned
- Output:
This is either the requested colormap, or a list of all available
colormaps (see above)
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_computeVoiContoursWrapper(cst, ct)
matRad computation of VOI contours if not precomputed
call
cst = matRad_computeVoiContoursWrapper(ct,cst)
- Input:
cst – matRad cst struct
ct – matRad ct struct
- Output:
cst – matRad cst struct with VOI contours
- References
Copyright 2017-2026 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/LICENSE.md. 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.
- matRad_plotAxisLabels(axesHandle, ct, plane, slice, defaultFontSize, tickdist)
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-2026 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/LICENSE.md. 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.
- matRad_plotIsoDose3D(axesHandle, xMesh, yMesh, zMesh, doseCube, isoLevels, cMap, window, alpha)
matRad function that plots isolines in 3d
call
hpatch = matRad_plotIsoDose3D(axesHandle,xMesh,yMesh,zMesh,doseCube,isoLevels,cMap,window,alpha)
- Input:
axesHandle handle to axes the slice should be displayed in
x/y/zMesh meshs
doseCube dose cube
isoLevels levels for computation
cMap colormap
window window for dose display
alpha transparency
- Output:
hpatch – handle to the patch object
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotIsoDoseLines(axesHandle, doseCube, isoContours, isoLevels, plotLabels, plane, slice, cMap, window, varargin)
matRad function that plots isolines, by precomputed contourc data computed by matRad_computeIsoDoseContours or manually by calling contourc itself
call
isoLineHandles = matRad_plotIsoDoseLines(axesHandle,doseCube,isoContours,isoLevels,plotLabels,plane,slice,…)
- Input:
axesHandle handle to axes the slice should be displayed in
doseCube 3D array of the corresponding dose cube
isoContours precomputed isodose contours in a cell array {maxDim,3} – if the parameter is empty, contours will be plotted the slow way with MATLABs contour function
isoLevels the levels of the isodose (same units as doseCube)
plotLabels if set to true labels will be added to the contours
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
cMap optional argument defining the colormap, default is jet – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(doseCube(:)) max(doseCube(:))]
varargin Additional MATLAB Line-Property/Value-Pairs etc.
- Output:
isoLineHandles – handle to the plotted isolines
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotIsoCenterMarker(axesHandle, pln, ct, plane, slice, style)
matRad function that plots an isocenter marker
call
markerHandle = matRad_plotIsoCenterMarker(axesHandle,pln,ct,plane,slice) markerHandle = matRad_plotIsoCenterMarker(axesHandle,pln,ct,plane,slice,style)
- Input:
axesHandle handle to axes the marker should be displayed in
pln matRad plan structure
ct matRad ct structure
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
style optional argument can be ‘marker’ or ‘lines’. – this might be useful for some issues with export to tikz for example
- Output:
markerHandle – handle to the isocenter marker
References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotProjectedGantryAngles(axesHandle, pln, ct, plane)
matRad function that plots all gantry angles projected to the coplanar plane if current view is axial view
call
matRad_plotProjectedGantryAngles(axesHandle,pln,ct,plane)
- Input:
axesHandle – handle to the axis where the plot shouldd appear
pln – matRad pln struct
ct – matRad ct struct
plane – current view plane
- Output:
-
- References
Copyright 2019-2026 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/LICENSE.md. 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.
- matRad_plotPlan3D(axesHandle, pln, stf)
matRad function to visualize a plan in 3D Stf is optional for plotting more detailed field contours in visualization of the impinging beams.
call
rotMat = matRad_plotPlan3D(axesHandle,pln) rotMat = matRad_plotPlan3D(axesHandle,pln,stf)
- Input:
axesHandle – handle to the axes the plan should be visualized in.
pln – matRad plan meta information struct
stf – optional steering information struct. if stf is passed and not empty, the function will use the ray position information to plot more detailed field contours than with pln only
- Output:
-
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotDoseSlice(axesHandle, doseCube, plane, slice, threshold, alpha, cMap, window)
matRad function that generates a dose plot of a selected slice The function can also be used in personal matlab figures by passing the corresponding axes handle.
call
[doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,alpha) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,cMap) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,window) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,alpha,cMap) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,alpha,window) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,cMap,window) [doseHandle,cMap,window] = matRad_plotDoseSlice(axesHandle, doseCube,plane,slice,threshold,alpha,cMap,window)
- Input:
axesHandle handle to axes the slice should be displayed in
doseCube 3D array of the dose to select the slice from
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
threshold threshold above which the dose shall be displayed – for negative values (i.e. difference maps), also the values smaller than the negative threshold will be displayed if empty, no threshold will be applied
alpha optional argument defining the alpha value, default is 0.6. – To use the default when providing a custom culormap, put in an empty array by [].
cMap optional argument defining the colormap, default is jet – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(doseCube(:)) max(doseCube(:))]
- Output:
doseHandle – handle of the plotted dose axes
cMap used colormap (same as input if set)
window used window (same as input if set)
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_computeVoiContours(ct, cst)
matRad function that computes all VOI contours
call
cst = matRad_computeVoiContours(ct,cst)
- Input:
ct matRad ct struct
cst matRad cst struct
- Output:
cst the new cst with the column containing the precomputed contours
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotColorbar(axesHandle, cMap, window, varargin)
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-2026 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/LICENSE.md. 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.
- matRad_plotVois3D(axesHandle, ct, cst, selection, cMap)
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-2026 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/LICENSE.md. 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.
- matRad_plotVoiContourSlice(axesHandle, cst, ct, ctIndex, selection, plane, slice, cMap, varargin)
matRad function that plots the contours of the segmentations given in cst
call: voiContourHandles = matRad_plotVoiContourSlice(axesHandle,cst,ct,ctIndex,selection,plane,slice) voiContourHandles = matRad_plotVoiContourSlice(axesHandle,cst,ct,ctIndex,selection,plane,slice,cMap) voiContourHandles = matRad_plotVoiContourSlice(axesHandle,cst,ct,ctIndex,selection,plane,slice,cMap,…)
- Input:
axesHandle handle to axes the slice should be displayed in
cst matRad cst cell array
ct matRad ct structure
ctIndex index of the ct cube
selection logicals defining the current selection of contours – that should be plotted. Can be set to [] to plot all non-ignored contours.
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
cMap optional argument defining the colormap, default is – colorcube
varargin Additional Matlab Line-Property/value pairs
- Output:
voiContourHandles – handles of the plotted contours
visibleOnSlice – logicals defining if the contour is actually visible on the current slice
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_computeAllVoiSurfaces(ct, cst)
matRad function that computes all VOI surfaces
call
cst = matRad_computeAllVoiSurfaces(ct,cst)
- Input:
ct matRad ct struct
cst matRad cst struct
- Output:
cst the new cst with the column containing the precomputed surface
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotCtSlice(axesHandle, ctCube, cubeIdx, plane, slice, cMap, window)
matRad function that generates the plot for the CT in the GUI The function can also be used in personal matlab figures by passing the corresponding axes handle
call
[ctHandle,cMap,window] = matRad_plotCtSlice(axesHandle,ctCube,cubeIdx,plane,slice) [ctHandle,cMap,window] = matRad_plotCtSlice(axesHandle,ctCube,cubeIdx,plane,slice,cMap) [ctHandle,cMap,window] = matRad_plotCtSlice(axesHandle,ctCube,cubeIdx,plane,slice,window) [ctHandle,cMap,window] = matRad_plotCtSlice(axesHandle,ctCube,cubeIdx,plane,slice,cMap,window)
- Input:
axesHandle handle to axes the slice should be displayed in
ctCube the cell of ct cubes
cubeIdx Index of the desired cube in the ct struct
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
cMap optional argument defining the colormap, default is bone – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(ctCube(:)) max(ctCube(:))]
- Output:
ctHandle handle of the plotted CT axes
cMap used colormap (same as input if set)
window used window (same as input if set)
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotDVHBand(nominalDVH, structureStat, doseLabel)
matRad_plotDVHBand to plot dose volume bands
call
matRad_plotDVHBand(nominalDVH, structureStat, doseLabel)
- Input:
nominalDVH – x axis values
structureStat – lower bound (start of shadowing)
doseLabel – upper bound (end of shadowing)
- Output:
-
Copyright 2017-2026 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/LICENSE.md. 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.
- matRad_computeIsoDoseContours(doseCube, isoLevels)
matRad function that computes all isodse contours (along each dose cube dimension)
call
isoDoseContours = matRad_computeIsoDoseContours(doseCube,isoLevels)
- Input:
doseCube 3D array containing the dose cube
isoLevels iso dose levels (same units as doseCube)
- Output:
isoDoseContours cell array containing the isolines along each dim
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotDoseSlice3D(axesHandle, ct, doseCube, plane, slice, threshold, alpha, cMap, window)
matRad function that generates a dose plot of a selected slice in 3D view
call
[doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,alpha) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,cMap) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,window) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,alpha,cMap) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,alpha,window) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,cMap,window) [doseHandle,cMap,window] = matRad_plotDose3DSlice(axesHandle, doseCube,plane,slice,threshold,alpha,cMap,window)
- Input:
axesHandle handle to axes the slice should be displayed in
ct matRad CT struct which contains resolution
doseCube 3D array of the dose to select the slice from
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
threshold threshold above which the dose shall be displayed – for negative values (i.e. difference maps), also the values smaller than the negative threshold will be displayed if empty, no threshold will be applied
alpha optional argument defining the alpha value, default is 0.6. – To use the default when providing a custom culormap, put in an empty array by [].
cMap optional argument defining the colormap, default is jet – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(doseCube(:)) max(doseCube(:))]
- Output:
doseHandle – handle of the plotted dose axes
cMap used colormap (same as input if set)
window used window (same as input if set)
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotIsoDoseLines3D(axesHandle, ct, doseCube, isoContours, isoLevels, plane, slice, cMap, window, varargin)
matRad function that plots isolines in 3D, by precomputed contourc data computed by matRad_computeIsoDoseContours or manually by calling contourslice itself
call
isoLineHandles = matRad_plotIsoDoseLines3D(axesHandle,ct,doseCube,isoContours,isoLevels,plane,slice) isoLineHandles = matRad_plotIsoDoseLines3D(axesHandle,ct,doseCube,isoContours,isoLevels,plane,slice,cMap) isoLineHandles = matRad_plotIsoDoseLines3D(axesHandle,ct,doseCube,isoContours,isoLevels,plane,slice,window) isoLineHandles = matRad_plotIsoDoseLines3D(axesHandle,ct,doseCube,isoContours,isoLevels,plane,slice,cMap,window) isoLineHandles = matRad_plotIsoDoseLines3D(axesHandle,ct,doseCube,isoContours,isoLevels,plane,slice,cMap,window, …)
- Input:
axesHandle handle to axes the slice should be displayed in
ct matRad ct struct which contains resolution
doseCube 3D array of the corresponding dose cube
isoContours precomputed isodose contours in a cell array {maxDim,3} – if the parameter is empty, contours will be plotted the slow way with MATLABs contour function
isoLevels the levels of the isodose (same units as doseCube)
plane plane view (coronal=1,sagittal=2,axial=3)
slice slice in the selected plane of the 3D cube
cMap optional argument defining the colormap, default is jet – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(doseCube(:)) max(doseCube(:))]
varargin Additional Matlab Line-Property/value pairs
- Output:
isoLineHandles – handle to the plotted isolines
- References
Copyright 2015-2026 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/LICENSE.md. 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.
- matRad_plotCtSlice3D(axesHandle, ct, cubeIdx, plane, ctSlice, cMap, window)
matRad function that generates the plot for the CT in the GUI 3D view The function can also be used in personal matlab figures by passing the corresponding axes handle
call
[ctHandle,cMap,window] = matRad_plotCtSlice3D(axesHandle,ct,cubeIdx,plane,ctSlice,cMap,window)
- Input:
axesHandle handle to 3D axes the slice should be displayed in
ct the ct struct used in matRad
cubeIdx Index of the desired cube in the ct struct
plane plane view (coronal=1,sagittal=2,axial=3)
ctSlice slice in the selected plane of the 3D cube
cMap optional argument defining the colormap, default is bone – if you want to use the default map with the window argument you can use an empty array []
window optional argument defining the displayed range. default is – [min(ctCube(:)) max(ctCube(:))]
- Output:
ctHandle handle of the plotted CT axes
cMap used colormap (same as input if set)
window used window (same as input if set)
- References
Copyright 2015-2026 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/LICENSE.md. 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.
Colormaps
Custom colormaps optimized for dose distribution visualization.
- diffMap(cMapSize)
matRad difference colormap
Copyright 2015-2026 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/LICENSE.md. 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.
- gammaIndex(cMapSize)
matRad gamma index colormap
- References
Copyright 2015-2026 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/LICENSE.md. 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.