Main Content

setVolume

Set new labelvolshow object

Description

example

setVolume(hLabelVol,L) updates the labelvolshow object hLabelVol with a new labeled volume L. setVolume preserves the current viewpoint and other visualization settings remain unchanged, but the label properties are set to their respective defaults.

setVolume(hLabelVol,L,V) updates the labelvolshow object hLabelVol with a new labeled volume L and a new intensity volume V.

Examples

collapse all

Load an intensity volume and an associated labeled volume into the workspace.

load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','images','vol_001.mat'));
load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','labels','label_001.mat'));

Customize the display panel.

ViewPnl = uipanel(figure,'Title','Labeled Volume');

Display the labeled volume along with an intensity volume.

hVol = labelvolshow(label,vol,'Parent',ViewPnl);

Change the background color to magenta and decrease the opacity of the intensity volume.

hVol.VolumeOpacity = 0.2;
hVol.BackgroundColor = 'magenta';

Load another intensity volume and an associated labeled volume into the workspace.

im = load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','images','vol_002.mat'));
data = load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','labels','label_002.mat'));

newIntensityVol = im.vol;
newLabelVol = data.label;

Change the volume in the labelvolshow object hVol. Note how labelvolshow preserves the rendering settings of the background color and intensity volume transparency.

setVolume(hVol,newLabelVol,newIntensityVol)

Input Arguments

collapse all

Labeled volume object, specified as a labelvolshow object.

Labeled volumetric data, specified as a 3-D labeled volume.

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

See Also

Introduced in R2019a