setVolume
Set new volume
Syntax
Description
Examples
Change the Volume in volshow Object
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
hVol
— Volume visualization
volshow
object
Volume visualization, specified as a volshow
object.
V
— Volumetric data
3-D grayscale volume
Volumetric data, specified as a 3-D grayscale volume.
Version History
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)