vtkProbe not passing scalar values?

I have a vtkXMLPolyData file that stores point data (temperature, etc.), I wanted to probe it with vtkProbeFilter. The resulting file (out.vtp) has all of the point data array names, but the ranges of the values in those arrays is all [0, 0]? I have also verified that the data (which sort of looks like a cone) has a tip at the origin, and does pass through the radius 1 area with nodes having nonzero temperature.


import sys, vtk

def project_onto_sphere(pd):
    s = vtk.vtkSphereSource()
    s.SetThetaResolution(60)
    s.SetPhiResolution(30)
    s.SetRadius(1)

    pf = vtk.vtkProbeFilter()
    pf.SetInputConnection(s.GetOutputPort())
    pf.SetSourceData(pd)
    pf.Update()

    return pf.GetOutput()

if __name__ == "__main__":
    r = vtk.vtkXMLPolyDataReader()
    r.SetFileName(sys.argv[1])
    r.Update()

    b = project_onto_sphere(r.GetOutput())

    w = vtk.vtkXMLPolyDataWriter()
    w.SetFileName("out.vtp")
    w.SetInputData(b)
    w.Write()

I tried to increase the node density, that didn’t seem to work either:


def project_onto_sphere(pd):
    s = vtk.vtkSphereSource()
    s.SetThetaResolution(60)
    s.SetPhiResolution(30)
    s.SetRadius(1)

    tf = vtk.vtkTriangleFilter()
    tf.SetInputData(pd)

    lf = vtk.vtkLoopSubdivisionFilter()
    lf.SetInputConnection(tf.GetOutputPort())
    lf.SetNumberOfSubdivisions(3)
    lf.Update()

    pf = vtk.vtkProbeFilter()
    pf.SetInputConnection(s.GetOutputPort())
    pf.SetSourceConnection(lf.GetOutputPort())
    pf.Update()

    return pf.GetOutput()

Based on this post, I tried vtkResampleWithDataset … also only produced zero scalar values. I also gather from here that using vtkResampleWithDataset using the scalars from a surface is probably not going to work.

I was able to get output somewhat similar to what I was expecting by using vtkPointInterpolator … but I still don’t understand why vtkProbe didn’t produce nonzero output.