Displaying volumes with volshow
The function volshow can display Medical Volumes directly in live scripts. It's a simpler and faster way to display volumes without launching a separate app like the Medical Volume Viewer.
| Display Medical Volume using volshow | |
|---|---|

medicalVolumes displayed with volshow are transformed into Anatomical Space (LPS). Notice that by default,
volshowcreates a 3D viewer with a blue background and a black gradient.
You can right-click on the volshow window to bring up a contextual menu with additional options, such as displaying a scale bar or voxel info.

If you uncheck "Always embed Viewer in Live Editor", volshow will display the volume in a separate figure.
Manually adjusting the figure background and render style
If you want to modify the background, you first need to create an empty scene using viewer3D. Here we create a viewer with a white background and no gradient.
| White Background | |
|---|---|

You can adjust the rendering style by modifying the RenderingStyle field in the volshow handle:
| Change Rendering Style to GradientOpacity | |
|---|---|

Comparison of Rendering Styles using
volshow
We can also modify the Colormap and add a title by modifying the respective fields in the volshow and viewer3d handles, respectively:
| Change colormap and add title | |
|---|---|

Customizing the Render using mmSetVolShowColors
mmSetVolShowColors is a utility function for volshow that simplifies the customization of the display. It automatically changes the background color of the volshow background to white and the applies a Medical alphamap and colormap to the volume render. The alpha- and colormaps are the same options available in the Medical Volume Viewer
To use, first display a volume using volshow and then simply input the handle from volshow into mmSetVolShowColors.
The function displays a list dialog with a choice of alphamap presets.

Select an alphamap to apply.

Here we apply the lung alphamap and colormap.
Overlaying label volumes
Label Maps (or segmentation volumes) can be added as additional elements to the volume rendering using the following syntax:
segMV = medicalVolume("CTACardio/Salcedo Segmentation.seg.nrrd"); % load label map
hvs = volshow(intMV,...
OverlayData=segMV.Voxels, ... % add label volume
RenderingStyle="GradientOpacity", ... % change rendering style
OverlayAlpha=0.4); % adjust overlay transparency
hvs.Parent.BackgroundGradient = 'off'; % modify parent properties (viewer3d)
hvs.Parent.BackgroundColor = 'white'; % modify parent properties (viewer3d)