setVolume

Set new volume

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 two volumes.

load mri
V = squeeze(D);

load spiralVol

Display one of the volumes, using volshow.

intensity = [0 20 40 120 220 1024];
alpha = [0 0 0.15 0.3 0.38 0.5];
color = ([0 0 0; 43 0 0; 103 37 20; 199 155 97; 216 213 201; 255 255 255]) ./ 255;
queryPoints = linspace(min(intensity),max(intensity),256);
alphamap = interp1(intensity,alpha,queryPoints)';
colormap = interp1(intensity,color,queryPoints);
vol = volshow(V,'Colormap',colormap,'Alphamap',alphamap);

Change rendering settings.

newColormap = hot(256);
vol.Colormap = newColormap;
vol.BackgroundColor = 'magenta';

Change the volume in the volshow object. Note that, when changing the volume, the volshow object preserves your rendering settings.

setVolume(vol,spiralVol)

Input Arguments

collapse all

Volume visualization, specified as a volshow object.

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

See Also

Introduced in R2019a