Main Content

setVolume

(To be removed) Set new volume in volshow object

setVolume will be removed in a future release. Set the Data property of a Volume object instead. For more information, see Compatibility Considerations.

Description

example

setVolume(hVol,V) updates the volshow object hVol with a new volume V. setVolume preserves the current viewpoint and other visualization settings remain unchanged.

Examples

collapse all

Load a volume.

load mri
V = squeeze(D);

Display the volume in a volshow object using the images.compatibility.volshow.R2022a.volshow function. Specify a nondefault colormap and background color.

vol = images.compatibility.volshow.R2022a.volshow(V, ...
    "Colormap",hot(256),"BackgroundColor","magenta");

MRI volume displayed with hot colormap in a figure window with a magenta background

Load a new volume, then display that volume in the existing volshow object. Note that setVolume preserves the colormap and the background color.

load spiralVol
setVolume(vol,spiralVol)

Spiral volume displayed with hot colormap in a figure window with a magenta background

Input Arguments

collapse all

Volume visualization, specified as a volshow object. You can create a volshow object using the images.compatibility.volshow.R2022a.volshow function.

Volumetric data, specified as a 3-D grayscale volume.

Version History

Introduced in R2019a

expand all