overlayVolume
overlayVolume interactively shows three orthogonal slices from a 3D volume, with optional overlay. Display ranges, colormaps, transparency and the pixelsize can be changed.
Volumes of interest can be drawn, and plotted. Scrolling through the images is possible with the mouse wheel.
The function is especially useful for the display of medical images.
Try "help overlayVolume" for some examples.
Usage:
- OVERLAYVOLUME(V1, V2);
Displays a 3D datasets V1, and an overlay dataset V2, with default display settings.4D datasets are also supported.
- OVERLAYVOLUME(V1);
Displays one 3D dataset VOL1
- OVERLAYVOLUME(...,'p',V);
Displays 3D datasets with addional user specified display settings. Settings should be provided as parameter name - value pairs.
Optional parameters:
- backRange: Display range of background data as [lower, upper]. Default: [lowest value in data, highest value]
- backMap: Colormap of the background as Nx3 matrix or standard colormap name (e.g., 'jet'). Default: gray(256)
- overRange: Display range of overlay data as [lower, upper]. Default: [lowest value in data, highest value]
- overMap: Colormap of the overlay as Nx3 matrix or cmap name. Default: jet(256)
- alpha: Transparency of the overlay as scalar between 0 and 1. Default: 0.5
- maskRange: Range of values in the overlay that will be displayed as [LO, HI]. That is, all values lower than LO, and all values higher than HI will not be shown. Default: []
- pixelSize: Pixel size of the three dimensions as [x,y,z]. Default: [1 1 1]
- title: Adds a name to the windows [char array]
Cite As
J.A. Disselhorst (2025). overlayVolume (https://www.mathworks.com/matlabcentral/fileexchange/39460-overlayvolume), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > 3-D Volumetric Image Processing >
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Tags
Acknowledgements
Inspired by: Overlay two datasets or indexed images, ct3 - A Simple Mousewheel-based 3D Image Browser for Medical Images
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.