Matlab 3d 体积可视化和 3d 叠加

发布于 2024-09-03 09:36:57 字数 354 浏览 5 评论 0原文

问题几乎就是标题。

我有一个作为原始数据加载的 3d 体积 [256, 256, 256] = size(A)。它仅包含零和一的值,其中 1 代表结构,0 代表“空气”。

我想在 MATLAB 中可视化该结构,然后对其运行算法并在其上覆盖一个覆盖层,假设颜色为红色。

更准确地说:

  1. 我如何可视化 3d 体积。 0是透明,1是半透明?
  2. 在 3D 可视化中绘制一条线作为叠加?

我已经阅读了 MathWorks 教程,但它们没有帮助。 我尝试使用 set 命令,但它完全失败,对于我尝试的每个属性都显示“无效的根属性”。

The question is pretty much the title.

I have a 3d volume loaded as raw data [256, 256, 256] = size(A). It contains only values of zero's and ones, where the 1's represent the structure and 0's the "air".

I want to visualize the structure in MATLAB and then run an algorithm on it and put an overlay on it, let's say in the color red.

So to be more precise:

  1. How do i visualize the 3d volume. 0's transparent, 1's semitransparent?
  2. Plot a line in the 3d visualization as an overlay?

I already read the MathWorks tutorials and they didn't help.
I tried using the set command, but it fails completely saying for every property I try "invalid root property".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

靖瑶 2024-09-10 09:36:57

我不确定我是否理解问题的第二部分,但以下是如何使用 等值面(我正在使用流体-流示例数据)

%# get a sample data with 0 for empty, 1 for solid
[~,~,~,v] = flow;
v = double( v<-3 );

%# visualize the volume
p = patch( isosurface(v,0) );                 %# create isosurface patch
isonormals(v, p)                              %# compute and set normals
set(p, 'FaceColor','r', 'EdgeColor','none')   %# set surface props
daspect([1 1 1])                              %# axes aspect ratio
view(3), axis vis3d tight, box on, grid on    %# set axes props
camproj perspective                           %# use perspective projection
camlight, lighting phong, alpha(.5)           %# enable light, set transparency

flow_volume

要了解有关 MATLAB 中体积可视化的更多信息,请参阅这篇优秀的 视频教程系列发布在 Doug 的博客上

I'm not sure I understand the second part of the question, but here's how you visualize a 3D volume using isosurfaces (I'm using the fluid-flow example data)

%# get a sample data with 0 for empty, 1 for solid
[~,~,~,v] = flow;
v = double( v<-3 );

%# visualize the volume
p = patch( isosurface(v,0) );                 %# create isosurface patch
isonormals(v, p)                              %# compute and set normals
set(p, 'FaceColor','r', 'EdgeColor','none')   %# set surface props
daspect([1 1 1])                              %# axes aspect ratio
view(3), axis vis3d tight, box on, grid on    %# set axes props
camproj perspective                           %# use perspective projection
camlight, lighting phong, alpha(.5)           %# enable light, set transparency

flow_volume

To learn more about volume visualization in MATLAB, refer to this excellent video tutorial series posted on Doug's blog

夜访吸血鬼 2024-09-10 09:36:57

有一个名为 vol3d 的优秀实用程序,由 mathworks 员工开发乔·康蒂.我认为它完全满足了您的可视化需求 - 尝试一下。

更新 (11/2012):上面链接的文件不再存在。不过这里有一个新版本。

There's an excellent utility called vol3d, by mathworks employee Joe Conti. I think it addresses your visualization needs exactly - give it a try.

Update (11/2012): File that is linked to above no longer exists. There is a new version here though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文