本示例显示了在MATLAB中可视化体积数据的几种方法。
显示等值面
一个等值面是一种表面,在一定体积空间内的所有点具有恒定值。使用isosurface
函数可为曲面的外部生成面和顶点,用,isocaps
函数为体积的覆盖面生成面和顶点。使用patch
命令绘制体积及其覆盖。
load mri D % load data
D = squeeze(D); % remove singleton dimension
limits = [NaN NaN NaN NaN NaN 10];
[x, y, z, D] = subvolume(D, limits); % extract a subset of the volume data
[fo,vo] = isosurface(x,y,z,D,5); % isosurface for the outside of the volume
[fe,ve,ce] = isocaps(x,y,z,D,5); % isocaps for the end caps of the volume
figure
p1 = patch('Faces', fo, 'Vert