# vtkProbe not passing scalar values?

**URL:** https://discourse.vtk.org/t/vtkprobe-not-passing-scalar-values/13272
**Category:** Support
**Created:** [February 6, 2024, 4:59pm UTC](https://discourse.vtk.org/t/vtkprobe-not-passing-scalar-values/13272 "2024-02-06T16:59:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 6, 2024, 4:59pm UTC](https://discourse.vtk.org/t/vtkprobe-not-passing-scalar-values/13272/1 "2024-02-06T16:59:49Z")

</div>

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.

```python

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()

```

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 6, 2024, 7:04pm UTC](https://discourse.vtk.org/t/vtkprobe-not-passing-scalar-values/13272/2 "2024-02-06T19:04:54Z")

</div>

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

```python

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()

```

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 6, 2024, 8:50pm UTC](https://discourse.vtk.org/t/vtkprobe-not-passing-scalar-values/13272/3 "2024-02-06T20:50:44Z")

</div>

Based on [this post](https://discourse.paraview.org/t/how-to-transfer-scalar-data-from-mesh-a-to-mesh-b/2100/2), I tried vtkResampleWithDataset … also only produced zero scalar values. I also gather [from here](https://discourse.paraview.org/t/resample-with-dataset-on-thin-surfaces/4759) 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.
