阐明进行多维数据集算法 [英] Clarification on Marching Cubes Algorithm

查看:73
本文介绍了阐明进行多维数据集算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于行进多维数据集,我对其算法和实现有一些疑问。我浏览了Pauling Bourke在Marching Cubes上的出色文章以及该站点上的可用源代码,但是,在理解以及如何以自己的方式实现算法方面,我仍然遇到了一些问题。问题如下:




  • 网格单元大小-我已经读过,网格单元大小会影响生成的3D模型的质量。例如,如果我有一堆X射线图像集,其大小为(200 * 200 * 200),那么将从2个相邻图像切片中构建一个网格单元平板。因此,平板中的网格单元总数为(200-1)*(200-1),每个网格单元角对应于图像的像素值/密度。它是否正确??此外,我们如何为gridcell实现不同的大小?


  • 体素大小-我已经阅读了《行军多维数据集》的一些参考资料,但我似乎无法找到体素的大小在算法中照顾大小。如果我错了,请纠正我,在我的情况下,相邻图像层之间的间隙为100万密耳;因此,我该如何照顾Marching Cubes算法中的那些功能?是否照顾到Gridcell的大小? (假设:xy坐标中一个像素的大小为19微米,gap / z为25.4微米/ 1密耳,长度)


  • 网格单元角(多维数据集的顶点坐标)-我正尝试通过图像集尺寸(200 * 200 * 200)的嵌套循环来分配索引为ijk的网格单元角的坐标。它是否正确??有没有更快的方法?




注意:我已经在VTK中看到了MC的实现,但是

解决方案

很多问题,这使我很难消化它。

解决方案

很多问题。我将尝试给出一些指示。 200 ^ 3的第一个是ct的很小的数据集!那1024 ^ 3呢? :)



行进立方体是为常规网格构建的。因此,是否在立方体顶点或中心定义数据确实无关紧要:仅移动立方体大小的一半即可!如果您有不规则的数据,请使用其他方法或首先重新采样为规则的网格。



您似乎还缺少行进部分:该想法是找到一个多维数据集地表和洪水从那里填满。外部或内部的多维数据集将停止搜索。这样,您甚至无需查看巨大的常规网格中的大多数多维数据集。



缩放为实际单位应该是最后一步。将输入音量视为归一化为1x1x1。然后将输出顶点缩放为物理单位。您拥有的数据就是您拥有的数据。任何重采样都应在重建或过滤之前进行。它在几何阶段中没有位置。



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


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:

  • 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??

  • 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)

  • 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??

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.

解决方案

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.

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.

这篇关于阐明进行多维数据集算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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