使用vtkVoxelContoursToSurfaceFilter由平行轮廓重建三角面片

在医学影像中,由于CT、MRI等成像设备的数据均以断层影像的形式输出,对其进行轮廓提取和三维重建就成为一个常见的需求。
将一组相互平行的轮廓线,以三角面片连接,形成放样曲面,即为surface from contours问题。这一问题的经典解决方法可参见论文Piecewise-Linear Interpolation between Polygonal Slices(简单贪心)
approximating complex surfaces by triangulation of contour lines
(动态规划)。
在VTK库中,类vtkVoxelContoursToSurfaceFilter提供了一个基于网格体元的实现。

create surface from contours
vtkVoxelContoursToSurfaceFilter is a filter that takes contours and produces surfaces. There are some restrictions for the contours:
The contours are input as vtkPolyData, with the contours being polys in the vtkPolyData.
The contours lie on XY planes - each contour has a constant Z
The contours are ordered in the polys of the vtkPolyData such that all contours on the first (lowest) XY plane are first, then continuing in order of increasing Z value.
The X, Y and Z coordinates are all integer values.
The desired sampling of the contour data is 1x1x1 - Aspect can be used to control the aspect ratio in the output polygonal dataset.
This filter takes the contours and produces a structured points dataset of signed floating point number indicating distance from a contour. A contouring filter is then applied to generate 3D surfaces from a stack of 2D contour distance slices. This is done in a streaming fashion so as not to use to much memory.

以下为代码注释

// 曲面提取主函数
// Append data sets into single unstructured grid
int vtkVoxelContoursToSurfaceFilter::RequestData(
  vtkInformation *vtkNotUsed(request),
  vtkInformationVector **inputVector,
  vtkInformationVector *outputVector)
{
  // get the info objects
  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
  vtkInformation *outInfo = outputVector->GetInformationObject(0);

  // get the input and output
  vtkPolyData *input = vtkPolyData::SafeDownCast(
    inInfo->Get(vtkDataObject::DATA_OBJECT()));
  vtkPolyData *output = vtkPolyData::SafeDownCast(
    outInfo->Get(vtkDataObject::DATA_OBJECT()));

  vtkCellArray         *inputPolys = input->GetPolys();
  int                  gridSize[3];
  double                gridOrigin[3];
  
  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值