对Marching Cubes算法的澄清 [英] Clarification on Marching Cubes Algorithm

查看:27
本文介绍了对Marching Cubes算法的澄清的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Marching Cubes,我对它的算法和实现有一些疑问.我已经阅读了 Marching Cubes 的优秀 Paul Bourke 文章以及网站上可用的源代码,但是,我在理解以及如何以自己的方式实现算法方面仍然遇到了一些问题.问题如下:

In regards of Marching Cubes, i have some doubts regarding its algorithm and implementation. I have gone through the excellent Paul Bourke article of Marching Cubes and also the available source code on the site, yet, i still encountered some problems in term of understanding as well as how to implement the algo in my own way. The questions are as below:

  • 网格单元大小 - 我读到网格单元大小会影响生成的 3D 模型的质量.例如,如果我有一堆大小为 (200*200*200) 的 x 射线图像,那么,一块网格单元将由 2 个相邻的图像切片构成.因此,块中网格单元的总数将为 (200-1)*(200-1),每个网格单元角对应于图像的像素值/密度.这样对吗??此外,我们如何为 gridcell 实现不同的大小?

  • Gridcell size - I have read that gridcell size affects the quality of the produced 3D model. For example if i have a stack of xray image set with size of (200*200*200), so, a slab of gridcells will be constructed from 2 adjacent slices of image. Thus, the total of the gridcells in a slab would be (200-1)*(200-1) with each of the gridcell corner correspond to the pixel value/density of the image. Is this correct?? Besides, how do we implement different size for gridcell??

体素大小 - 我已经阅读了一些关于 Marching Cubes 的参考资料,但我似乎无法找到算法中如何处理体素大小的问题.如果我错了,请纠正我,就我而言,相邻图像层之间的间隙为 1 mil;因此,我该如何处理 Marching Cubes 算法中的那些人,或者这是一个死胡同?是否按照Gridcell的大小来处理??(假设:一个像素在其 xy 坐标中的大小为 19 微米,而间隙/z 的长度为 25.4 微米/1 密耳)

Voxel size - I have read the few references of Marching Cubes and i cant seem to find how voxel size is taken care of in the algorithm. Please correct me if i am wrong, in my case, the gap between the adjacent layer of images is 1 mil in size; thus, how do i take care of those in Marching Cubes algo or is it a dead end?? Is it taken care of as the size of Gridcell?? (Assumption: the size of one pixel in its xy coordinate is 19 micron while the gap/z is 25.4 micron/1 mil in length)

网格单元角的坐标(立方体的顶点坐标) - 我试图通过图像集维度(200*200*200)的嵌套循环来分配索引 i j k 的网格单元角的坐标.这样对吗??有没有更快的方法?

Coordinates of the Gridcell corner(Vertices Coordinates of the cube) - I am trying to assign the coordinates of the corners of gridcells with index i j k by nested looping of the image set dimension (200*200*200). Is this correct?? Is there any faster way to do it??

注意:我已经在 VTK 中看到了 MC 的实现,但我很难理解它,因为它依赖于其他一些 VTK 类.

Note: i have seen implementation of MC in VTK but it is quite hard for me to digest it as it depends on some other VTK classes.

推荐答案

很多问题.我将尝试提供一些指示.第一个 200^3 是一个非常小的 ct 数据集!1024^3 怎么样?:)

Lots of questions. I am going to try to give some pointers. First of 200^3 is a pretty small dataset for ct! what about 1024^3? :)

行进立方体是为常规网格构建的.所以数据是在立方体的顶点还是中心定义真的没有关系:只需移动立方体大小的一半!如果您有不规则数据,请使用其他数据或先重新采样到规则网格.

Marching cubes is built for regular grids. So wether data is defined at cube vertices or centers really does not matter: just shift by half the cube size! If you have irregular data use something else or resample to a regular grid first.

您似乎也错过了行进"部分:这个想法是找到一个有表面的立方体,然后从那里填充.全部在外面或全部在里面的立方体将停止搜索.这样一来,您的巨大规则网格中的大多数立方体甚至都不需要查看.

You also seem to be missing the "marching" part: The idea is to find one cube with the surface and flood fill out from there. Cubes that are all outside or all inside stop the search. That way most cubes in your huge regular grid do not even need to be looked at.

缩放到实际单位应该是最后一步.将输入音量视为标准化为 1x1x1.然后将输出顶点缩放为物理单位.你拥有的数据就是你拥有的数据.任何重采样都应该在重建或过滤之前完成.它在几何阶段没有立足之地.

Scaling to real units should be a last step. Think of the input volume as normalized to 1x1x1. Then scale the output vertices to physical units. The data you have is the data you have. Any resampling should be done before during reconstruction or filtering. It has no place in the geometry stage.

我不确定我是否理解最后一个问题,但是对于进一步处理来说非常重要的一件事是创建一个连接的索引网格.一个重要的技巧是保留一种前一个切片/行/邻居的哈希表.因此,您可以快速查找已创建的顶点并重用它们的索引.结果应该是具有唯一顶点的连接网格.然后您可以在任何类型的几何处理中使用它.

I am not sure I understand the last question, but one thing that is really important for further processing is to create a connected, indexed mesh. One important trick there is to just keep a kind of hash table of the previous slice/line/neighbor. So you can quickly look up already created vertices and reuse their index. The result should be a connected mesh with unique vertices. This you can then use in any kind of geometry processing.

这篇关于对Marching Cubes算法的澄清的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆