简体   繁体   English

内存中的VTK 3D卷渲染

[英]VTK 3D Volume Rendering from Memory

I am going to render 3D Data, which is a one dimensional array. 我将渲染3D数据,这是一维数组。 This data are precomputed in the same program that will do the visualization. 这些数据是在进行可视化的同一程序中预先计算的。 The data represents an uniform 3D grid. 数据代表统一的3D网格。 Each cell of the grid consists of a vector. 网格的每个像元都由一个向量组成。

GridSize = dx * dy * dz * 3

How can I visualize this array without copying by VTK? 如何在不通过VTK复制的情况下可视化此数组? Please, provide a short sequence of VTK invocation . 请提供简短的VTK调用序列。

How about this? 这个怎么样?

int dx = 10, dy = 10, dz = 10;

vtkSmartPointer <vtkImageData> image =
  vtkSmartPointer <vtkImageData>::New();
image->SetDimensions(dx, dy, dz);
image->AllocateScalars(VTK_DOUBLE, 3);

double * Grid = reinterpret_cast<double*>(image->GetScalarPointer());
populate(Grid,dx,dy,dz);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM