I am working with a vtk dataset that has both scalar and vector field data, and the vtk type is
vtkStructuredPoints. I want to decrease the grid resolution for each field to reduce file size and write the new dataset into a new vtk file using
SetResizeMethodToOutputSpacing methods from python vtk library:
resize = vtkImageResize() resize.SetInputData(data) # data is original StructuredPoints dataset resize.SetResizeMethodToOutputSpacing() nfactor = 4 # downscaling factor resize.SetOutputSpacing(dx*nfactor, dy*nfactor, dz*nfactor) resize.Update()
However, it returns me an error ‘vtkImageResize (0x556db860fb30): ThreadedRequestData: output scalar type does not match input scalar type’, and the dataset resolution does not change.
What is the right way to downsample the dataset?
I would appreciate any help!