How do I get the range of the data set? Also known as the bounding box for the data. The data is read with the StructuredPointsReader
.
Because vtkStructuredPoints (the type of GetOutput() on a vtkStructuredPointsReader) is a subclass of vtkDataSet, you can use the GetBounds(double[6]) function of vtkDataSet. Here is an example:
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With