gpt4 book ai didi

vtk - 如何获取点数据的边界框?

转载 作者:行者123 更新时间:2023-12-04 23:22:50 25 4
gpt4 key购买 nike

如何获取数据集的范围?也称为数据的边界框。使用 StructuredPointsReader 读取数据.

最佳答案

因为 vtkStructuredPoints(vtkStructuredPointsReader 上的 GetOutput() 类型)是 vtkDataSet 的子类,所以您可以使用 vtkDataSet 的 GetBounds(double[6]) 函数。下面是一个例子:

  double bounds[6];
structuredPointsReader->Update();
structuredPointsReader->GetOutput()->GetBounds(bounds);

std::cout << "xmin: " << bounds[0] << " "
<< "xmax: " << bounds[1] << std::endl
<< "ymin: " << bounds[2] << " "
<< "ymax: " << bounds[3] << std::endl
<< "zmin: " << bounds[4] << " "
<< "zmax: " << bounds[5] << std::endl;

关于vtk - 如何获取点数据的边界框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19484854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com