Drawing based on Matlab three-dimensional slice data

Example 1

Introduction to slice usage

load mri
D = double(squeeze(D));
D(D==0)=nan;
h = slice(D, [], [], 1:size(D,3));
set(h, 'EdgeColor','none', 'FaceColor','interp')
alpha(.4)

Insert picture description here

Example 2

Official document introduction

[x,y,z] = meshgrid(-1.25:.1:-.25,-2:.2:2,-2:.1:2);
v = x.*exp(-x.^2-y.^2-z.^2);

h = slice(x,y,z,v,[-1 -.75 -.5],[],[0]);
set(h,'EdgeColor','none',...
'FaceColor','interp',...
'FaceAlpha','interp')
alpha('color')

alphamap('rampdown')
alphamap('increase',.1)
colormap hsv

Insert picture description here

Other effects
Insert picture description here

Guess you like

Origin blog.csdn.net/wokaowokaowokao12345/article/details/113241452